# Images and Vision

Groq API offers fast inference and low latency for multimodal models with vision capabilities for understanding and interpreting visual data from images. By analyzing the content of an image, multimodal models can generate 
human-readable text for providing insights about given visual data. 

## Supported Models

Groq API supports powerful multimodal models that can be easily integrated into your applications to provide fast and accurate image processing for tasks such as visual question answering, caption generation, 
and Optical Character Recognition (OCR).

## How to Use Vision

Use Groq API vision features via:

- **GroqCloud Console Playground**: Use [Llama 4 Scout](/playground?model=meta-llama/llama-4-scout-17b-16e-instruct) or [Llama 4 Maverick](/playground?model=meta-llama/llama-4-maverick-17b-128e-instruct) as the model and
upload your image.
- **Groq API Request:** Call the [`chat.completions`](/docs/text-chat#generating-chat-completions-with-groq-sdk) API endpoint and set the model to `meta-llama/llama-4-scout-17b-16e-instruct` or `meta-llama/llama-4-maverick-17b-128e-instruct`. 
See code examples below.

<br />
## How to Pass Images from URLs as Input
The following are code examples for passing your image to the model via a URL: 

## How to Pass Locally Saved Images as Input
To pass locally saved images, we'll need to first encode our image to a base64 format string before passing it as the `image_url` in our API request as follows:

<br />

## Tool Use with Images
The `meta-llama/llama-4-scout-17b-16e-instruct`, `meta-llama/llama-4-maverick-17b-128e-instruct` models support tool use! The following cURL example defines a `get_current_weather` tool that the model can leverage to answer a user query that contains a question about the 
weather along with an image of a location that the model can infer location (i.e. New York City) from:

<br />

The following is the output from our example above that shows how our model inferred the state as New York from the given image and called our example function:
<br />
```python
[
  {
    "id": "call_q0wg",
    "function": {
      "arguments": "{\"location\": \"New York, NY\",\"unit\": \"fahrenheit\"}",
      "name": "get_current_weather"
    },
    "type": "function"
  }
]
```

<br />

## JSON Mode with Images
The `meta-llama/llama-4-scout-17b-16e-instruct` and `meta-llama/llama-4-maverick-17b-128e-instruct` models support JSON mode! The following Python example queries the model with an image and text (i.e. "Please pull out relevant information as a JSON object.") with `response_format`
set for JSON mode:

<br />

## Multi-turn Conversations with Images
The `meta-llama/llama-4-scout-17b-16e-instruct` and `meta-llama/llama-4-maverick-17b-128e-instruct` models support multi-turn conversations! The following Python example shows a multi-turn user conversation about an image:

<br />


## Venture Deeper into Vision

### Use Cases to Explore
Vision models can be used in a wide range of applications. Here are some ideas:

- **Accessibility Applications:** Develop an application that generates audio descriptions for images by using a vision model to generate text descriptions for images, which can then 
be converted to audio with one of our audio endpoints.
- **E-commerce Product Description Generation:** Create an application that generates product descriptions for e-commerce websites.
- **Multilingual Image Analysis:** Create applications that can describe images in multiple languages.
- **Multi-turn Visual Conversations:** Develop interactive applications that allow users to have extended conversations about images.

These are just a few ideas to get you started. The possibilities are endless, and we're excited to see what you create with vision models powered by Groq for low latency and fast inference!

<br />

### Next Steps
Check out our [Groq API Cookbook](https://github.com/groq/groq-api-cookbook) repository on GitHub (and give us a ⭐) for practical examples and tutorials:
- [Image Moderation](https://github.com/groq/groq-api-cookbook/blob/main/tutorials/image_moderation.ipynb)
- [Multimodal Image Processing (Tool Use, JSON Mode)](https://github.com/groq/groq-api-cookbook/tree/main/tutorials/multimodal-image-processing)
<br />
We're always looking for contributions. If you have any cool tutorials or guides to share, submit a pull request for review to help our open-source community!

---

## Prefilling: Example1 (py)