ADR-0033: Retire the in-process llama.cpp engine and the GGUF model store — every model call goes through the provider

StateAccepted
Architectural SignificanceVERY HIGH
DomainInference
Document version1.0

Reference

Summary

Roteiro no longer runs a model in its own process. The llama feature of rto-llama, the llama-cpp-2 / llama-cpp-sys-2 crates and every GGUF entry in the model registry are gone. Ask, spec draft, review --llm, infer --model, image description and audio transcription all go through the provider engine — Ollama, llama-server, LM Studio, or a hosted API — named by [provider] base_url and [models]. roteiro model pull installs the OCR weights only. roteiro serve keeps its /v1 as the graph-tools layer in front of the provider, and joins the default build.

Context

The in-process engine was the reason Roteiro needed a C/C++ toolchain (cmake, libclang, minutes of build on small machines) and the reason docs/VENDORED_DEPENDENCIES.md tracked 13 llama.cpp advisories by hand, outside cargo audit's reach. ADR-0028 had already made the provider engine the single path for everything the provider could serve, so the in-process half was a second engine maintained for one configuration.

Decision makers

The Roteiro Project Team. The owner decided the plan on 2026-10-30 (D1–D3) and the open points on 2026-11-14.

Owner decisions

Decision
D1roteiro serve's /v1 stays, as the graph-tools layer in front of the provider.
D2OCR stays in-process (pure Rust, ocrs); model pull is narrowed to its weights.
D3Transcription stays, through a provider that accepts audio (llama-server; Ollama has none).
TransportAudio is sent as an OpenAI input_audio chat part, the same path images take — no /v1/audio/transcriptions client.
Media identityA provider exposes no weights digest, quantisation or projector, so those producer fields carry provider:<host>/<model>. A record names the server and model that wrote it; the first media build after upgrading writes new records.
--typed-classRemoved. It read the label-token distribution, which only the in-process engine exposed. Recorded runs that used it still parse.
[serve] budget keysmemory_budget_mb, max_context_tokens and prefix_cache_mb are accepted with a warning that they do nothing; the provider owns context and memory.
Defaultsserve joins the default features: without llama.cpp it is axum, tokio and rustls-on-ring.

How each surface reaches a model

SurfaceBeforeNow
Ask (serve)provider, else installed GGUF modelsprovider; without base_url, the browse-only UI
spec draft, review --llmprovider, else llama.cppprovider, else a refusal naming what to set
infer --modela GGUF embedding modelEngine::embed on the provider, probed once so a wrong id is a named error
media build (vision, audio)llama.cpp mtmd with a projectorEngine::chat with an image or input_audio part
OCR (sync)ocrs in-processunchanged

The provider engine lives in roteiro, which depends on rto-graph, so the media producers cannot build it. roteiro hands it over with rto_graph::media::producers::provide before media status / media build.

The resolver

[models] ocr still resolves against the registry. Every other key is a provider model id, passed through as ModelSource::Provider: the provider owns its list and refuses an unknown id itself.

Options considered + consequences

OptionWhy not
Keep llama.cpp behind a non-default featureA second engine kept for one configuration, with the toolchain and the unmonitored advisories it brings for whoever enables it.
/v1/audio/transcriptions for audioNew multipart code, drops the transcription prompt, and llama-server serving that route was not confirmed; input_audio already works.
Make the media digest fields optionalA schema change for a fact the sentinel states exactly.

Consequences

Status

Accepted and implemented in the PR that closes #969.

Version history

VersionDateChange
1.02026-11-14Initial. Retires the in-process llama.cpp engine and the GGUF model store; every model call goes through the provider. Records D1–D3 and the 2026-11-14 decisions: input_audio for transcription, the provider:<host>/<model> media identity, --typed-class removed, the [serve] budget keys warned about, serve in the default build. Supersedes ADR-0006.