Skip to content

Vision & Multimodal Guide

In addition to text completions and image generation, KoboiLLM natively supports Vision Models — AI models capable of “seeing” and analyzing input images. Ideal applications include:

  • Automated captioning and alt-text generation
  • Document processing and simple OCR
  • Product photo and screenshot inspection
  • Visual Question Answering (Visual QA)

The API strictly adheres to the standard OpenAI Chat Completions specification using multimodal array content, making existing OpenAI and LiteLLM SDKs immediately compatible.


Table of Contents

  1. Endpoint & Authentication
  2. Available Vision Models
  3. Quick Start — Sending Image URLs
  4. Sending Local Images (Base64)
  5. Multi-Image Inputs
  6. Parameters (detail & format)
  7. Checking Model Vision Support
  8. Quick Spec Summary
  9. Tips & Best Practices

1. Endpoint & Authentication

Base URL:

https://lite.koboillm.com/v1

(The alias https://api.koboillm.com/v1 is also available and identical in behavior).

Primary Endpoint: POST /v1/chat/completions — identical to standard chat completions, except that the user message content field is structured as an array containing text and image_url objects.

Authentication: Include the header `Authorization: Bearer *** Set your secret API key in your environment variables:

Terminal window
export LITELLM_API_KEY="sk-xxxxxx"

2. Available Vision Models

The following models natively support image understanding at KoboiLLM:

ProviderEndpoint NameBest Used For
OpenAIopenai/gpt-4o-miniFast & budget-friendly vision — recommended default
OpenAIopenai/gpt-4oHigh-reasoning visual analysis and complex layout reading
Google Geminigemini/gemini-2.5-flashHigh-speed, low-cost multimodal processing
Google Geminigemini/gemini-2.5-proComprehensive document analysis and detailed OCR

For the live model catalog, query /v1/models or check your dashboard at https://lite.koboillm.com.


3. Quick Start — Sending Image URLs

3.1 — cURL

Terminal window
curl -X POST https://lite.koboillm.com/v1/chat/completions \
-H "Authorization: Bearer *** \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4o-mini",
"messages": [
{
"role": "user",
"content": [
{ "type": "text", "text": "Describe what you see in this image in detail." },
{
"type": "image_url",
"image_url": {
"url": "https://docs.koboillm.com/koboi_llm_logo.png"
}
}
]
}
]
}'

3.2 — Python (OpenAI SDK)

from openai import OpenAI
client = OpenAI(
base_url="https://lite.koboillm.com/v1",
api_key="sk-xxxxxx",
)
response = client.chat.completions.create(
model="openai/gpt-4o-mini",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Describe what you see in this image."},
{
"type": "image_url",
"image_url": {"url": "https://docs.koboillm.com/koboi_llm_logo.png"},
},
],
}
],
)
print(response.choices[0].message.content)

4. Sending Local Images (Base64)

For local images stored on disk, encode the image to base64 and supply it as a data URL:

import base64
from openai import OpenAI
client = OpenAI(
base_url="https://lite.koboillm.com/v1",
api_key="sk-xxxxxx",
)
def encode_image(image_path):
with open(image_path, "rb") as image_file:
return base64.b64encode(image_file.read()).decode('utf-8')
base64_image = encode_image("document.png")
response = client.chat.completions.create(
model="openai/gpt-4o-mini",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Extract all text from this document image."},
{
"type": "image_url",
"image_url": {
"url": f"data:image/png;base64,{base64_image}"
},
},
],
}
],
)
print(response.choices[0].message.content)