Skip to content

Instantly share code, notes, and snippets.

@surfiend
Created June 3, 2025 17:19
Show Gist options
  • Select an option

  • Save surfiend/70217e4835355045c31e492f084e1387 to your computer and use it in GitHub Desktop.

Select an option

Save surfiend/70217e4835355045c31e492f084e1387 to your computer and use it in GitHub Desktop.
Ollama Vision API: Clean curl Example for Image Analysis
IMAGE_BASE64=$(base64 -w 0 'path/to/the/image')
curl -X POST "http://localhost:11434/api/chat" -d @- << EOF
{
"model": "qwen3",
"messages": [
{
"role": "user",
"content": "Describe this image.",
"images": ["$IMAGE_BASE64"]
}
],
"options": {
"num_ctx": 4096
},
"stream": false
}
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment