Structured output
Pydantic models are turned into JSON Schema and sent in the format field of /api/chat. Ollama constrains generation to that schema: no free-text parsing. If it still fails, it retries once.
For recruiters and the curious
A vision model and a text model running on a Mac, served to the internet through a small API that is honest about its limits and measured with evals.
Pydantic models are turned into JSON Schema and sent in the format field of /api/chat. Ollama constrains generation to that schema: no free-text parsing. If it still fails, it retries once.
The LLM proposes; rules decide. What's truly missing is recomputed, recipes that exceed the time limit or break the diet are discarded, and a consolidated shopping list is built.
The Mac serves one inference at a time: asyncio.Semaphore with a wait counter (429 with position when the queue is full) and a per-IP sliding window in Redis, reading X-Forwarded-For behind Traefik.
If the Mac is off, the API returns 503 with demo_available and the UI offers a real saved result. The app never looks broken.
The Vercel frontend calls the VPS without serverless proxy functions: an inference can take 30 s and we don't want intermediate timeouts. CORS is restricted to the frontend domain.
The queue lives in process memory. With several uvicorn workers there would be several queues and the Mac would get twice the requests. For this case, one is enough and it's the right call.
POST /api/chat
{
"model": "qwen3-vl:4b-instruct",
"stream": false,
"keep_alive": "30m",
"options": { "temperature": 0.1 },
"format": VisionLLM.model_json_schema(),
"messages": [
{ "role": "user", "content": "Lista SOLO lo que se ve…",
"images": ["<jpeg 768px, base64>"] }
]
}You haven't made one in this browser yet.
generation speed
Pillow · queue —
Current status: checking
Precision, recall, F1 and latency per model, and how much deterministic validation adds.