Skip to content
Nevera AI

For recruiters and the curious

Under the hood

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.

Architecture

Nevera AI architecture: Vercel, VPS with FastAPI and a Mac with OllamaVERCELNext.jsBrowserApp Router · staticCalls the API directlyVPS · DOKPLOYFastAPITraefik + HTTPSQueue · rate limit (Redis)Deterministic validationMAC · APPLE SILICONOllamaLocal modelsqwen3-vl:4b (vision)qwen2.5:3b (text)HTTPSCORSTailscaleWireGuard
The browser never talks to the Mac. No serverless functions in between: no proxy timeouts.

Design decisions

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.

Deterministic validation

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.

Queue and rate limit

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.

Demo mode

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.

Direct API calls

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.

A single worker

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.

Stack

Frontend
Next.js 16 (App Router), TypeScript, Tailwind CSS 4, Radix UI, Framer Motion, Sonner
API
FastAPI, Pydantic v2, pydantic-settings, httpx, Pillow, Redis
Models
Ollama on Apple Silicon · qwen3-vl:4b-instruct (vision) · qwen2.5:3b (text)
Infra
Vercel · Docker Compose on a VPS with Dokploy (Traefik + HTTPS) · Tailscale to the Mac
Quality
pytest (no Ollama, mock mode), Ruff, mypy, ESLint, Playwright e2e, reproducible evals

The request to Ollama

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>"] }
  ]
}

Your last request

You haven't made one in this browser yet.

Vision
—
Recipes
—
Tokens/s
—

generation speed

Resize
—

Pillow · queue —

Current status: checking

Does it actually work?

Precision, recall, F1 and latency per model, and how much deterministic validation adds.