Why "one endpoint, two backends"

The hard part of local deployment was never getting a model to run — it is getting it to run in a way clients can call reliably. A common 2026 mistake is pushing every request into a single inference process. The result: daytime code-completion calls queue behind the nightly batch summarization job, and the experience collapses.

A calmer setup splits the two workloads:

  • Interactive workload (completion, chat, short rewrites): low concurrency, fast first token, arrives at any moment. Serve it with an always-on Ollama daemon that keeps the model resident in VRAM.
  • Batch / long-context workload (bulk summarization, benchmark runs, long-document extraction): high concurrency, tolerant of waiting, benefits from continuous batching. Serve it with vLLM launched on demand and stopped when done, returning VRAM to the interactive path.

The key is exposing both as OpenAI-compatible endpoints. Ollama ships a /v1 compatibility layer and vLLM is natively OpenAI-compatible, so clients (IDE plugins, SDKs, agent frameworks) only need to change base_url — no business-code changes.

Steps

1. Plan directories and ports

Fix the ports first so the two backends do not collide:

```

~/local-token/

├── models/ # weights (keep GGUF and safetensors separate)

├── logs/

├── start-ollama.sh

├── start-vllm.sh

└── router.yaml # router config

```

Port convention: Ollama on 11434 (default), vLLM on 8000, router exposed on 4000.

2. Keep Ollama resident

Ollama runs as a resident service by default. Pull the daily models locally:

```bash

ollama pull qwen3:8b

ollama pull qwen3:14b

```

Set OLLAMA_KEEP_ALIVE=-1 (config or env) so models stay in VRAM instead of being unloaded after a few idle minutes; set OLLAMA_MAX_LOADED_MODELS to 1–2 so several models do not fight over VRAM.

Verify the compatibility layer:

```bash

curl http://127.0.0.1:11434/v1/chat/completions \

-H "Content-Type: application/json" \

-d '{"model":"qwen3:8b","messages":[{"role":"user","content":"ping"}]}'

```

3. Launch vLLM on demand

Do not make vLLM a boot-time service. Write a script and start it manually or from a scheduled job:

```bash

#!/usr/bin/env bash

vllm serve Qwen/Qwen3-14B \

--host 127.0.0.1 --port 8000 \

--max-model-len 32768 \

--gpu-memory-utilization 0.85 \

--enable-prefix-caching

```

--gpu-memory-utilization follows your VRAM budget: if sharing a card with Ollama, drop it to 0.6–0.7, run ollama stop before launching vLLM, and switch back afterwards.

4. Router: one base_url, two paths

Put a lightweight OpenAI-compatible router (LiteLLM Proxy, one-api, or similar) between clients and backends, splitting by model alias:

```yaml

model_list:

  • model_name: local-daily

litellm_params:

model: openai/qwen3:8b

api_base: http://127.0.0.1:11434/v1

api_key: ollama

  • model_name: local-batch

litellm_params:

model: openai/Qwen/Qwen3-14B

api_base: http://127.0.0.1:8000/v1

api_key: dummy

```

Clients only know local-daily and local-batch, pointed at http://127.0.0.1:4000/v1. Point your IDE at local-daily and batch scripts at local-batch. If vLLM is not running, the router returns a connection error; the batch job can simply fall back to local-daily without code changes.

5. Quantization: VRAM first, quality second

  • Single 8–12 GB card: daily use 7B–8B at Q4_K_M GGUF; batch use AWQ/GPTQ of the same size.
  • Single 16–24 GB card: daily 14B at Q4_K_M; batch 14B AWQ.
  • Multi-GPU: enable tensor parallelism in vLLM (--tensor-parallel-size N); keep Ollama on one card.

The principle: interactive workloads prioritize first-token latency, batch workloads prioritize throughput, and their tolerance for quantization differs.

Caveats

  • VRAM is the only hard constraint. When both backends share a card, always unload before launching, or vLLM will fail to start on out-of-memory.
  • Ollama's /v1 layer is not a full OpenAI implementation. Some parameters (certain response_format options, tool-calling details) vary by version — verify with real requests before wiring it in.
  • vLLM startup takes tens of seconds to minutes (model size and first-time compilation), so it is unsuitable for "user clicked, answer now" flows.
  • Do not expect local models to cover everything. For code completion and long-context reasoning, small local models still trail cloud flagships. A sensible split: local as the fallback for high-frequency, low-value calls; leave the hard requests elsewhere.
  • Check licenses. Commercial terms differ across open-weight models; confirm the chosen weights allow your use case.

When it fits

  • Individual developers with 1–2 consumer GPUs who want to drive high-frequency call costs to zero.
  • Teams needing offline or intranet-only environments that cannot send data out.
  • Teams wanting local models for batch evaluation, data cleaning, or document extraction without hurting daily development experience.

When it does not fit

  • Machines with only integrated graphics or CPU: it runs, but throughput is too low to be useful.
  • Scenarios needing multimodality, very long context, or top-tier reasoning quality: local open weights still struggle to match cloud flagships.
  • Multi-tenant, metered, audited production: requires auth and quota layers; this design covers single-machine, single-user only.