Repository navigation
feat(news-creator): switchable Ollama / llama.cpp server backend with an explicit LLM_BACKEND (ADR-001066) - #440
Merged
Conversation
…wire mapping, LLM_BACKEND selection and the OpenAI-compatible proxy routes (ADR-001066) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n the deep health expectation with the existing pass/fail shape (ADR-001066) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… LLM_BACKEND, a llama-server image and an opt-in CUDA overlay (ADR-001066) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…that the upstream server kind matches it, and a zero reasoning budget whenever llama.cpp chat thinking is off (ADR-001066) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…m server kind at startup, zero the llama.cpp reasoning budget when thinking is off, and declare the host key as NEWS_CREATOR_LLM_BACKEND (ADR-001066) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ma's physical batch size of 1024 (ADR-001066) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… benchmark both backends through news-creator's own prompt path with explicit runtime settings (ADR-001066) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ama-server entrypoint (ADR-001066) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pt ADR-001066 with the Ollama vs llama-server benchmark results Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ADR-001066: news-creator can now send its generation traffic to either Ollama or llama.cpp
llama-server, selected explicitly withLLM_BACKEND. Its inbound Ollama-shaped API, the four callers and their Pact contracts are unchanged.LLM_BACKENDacceptsollamaorllamacpp; unset or any other value fails startup.NEWS_CREATOR_LLM_BACKEND, declared"ollama"indeploy/desired-env.lkaland listed inrequired_env.LLM_BACKENDon the host because rag-orchestrator already reads that name, with the valuesollama|eino.owned_by == "llamacpp"on/v1/models; Ollama must answer/api/tagswith 200./v1/completions; chat goes to/v1/chat/completions. SSE is translated back to the Ollama shape, with token counts and nanosecond durations fromusage/timings.thinking_budget_tokens: 0. Against a real llama-server with the production Gemma 4 GGUF, ajson_schemachat request otherwise spendsmax_tokensin a thought channel and returns empty content.news-creator/Dockerfile.llamacpppins build b12808 for both cuda and vulkan, and the flavor build arg is required.entrypoint-llamacpp.shdownloads the GGUF and MTP draft with the same sha256 pins as ADR-000981. It takes exactly three required inputs; every other server argument is a fixed constant.compose/compose.llamacpp-cuda.yamlis an opt-in overlay and is not included incompose/compose.yaml.POST /v1/completions,POST /v1/chat/completionsandGET /v1/models. Its/healthstays local.scripts/benchmark_real_articles.pyruns both backends through news-creator's own summary prompt path and drivers. The news-creator runtime settings must be given explicitly, and a dry-run mode prints the parameters that decide whether Ollama rebuilds its runner.Benchmark (same GPU, same GGUF and MTP draft, 24 recent articles)
--flash-attn onWith
--flash-attn auto, llama-server decoded 5.7% slower, so the entrypoint forceson. Whether production switches tollamacppon NVIDIA is left to a separate ADR; production stays onollama.Deploy note
NEWS_CREATOR_LLM_BACKENDis a new required host env key. Reconcile it onto the production host with kisage before this merges. Otherwise compose refuses to render and the deploy does not start.Test plan
cd news-creator/app && uv run pytest: 1538 passed, 1 skipped.go test ./...indocker/inference-proxy../scripts/lint/run.sh news-creator/app,compose,docker/inference-proxyandrepo.check_layers.sh --changed,docdag validate --immutable-since origin/main,alt-harness adr-gate --base origin/main.docker compose ... configfails withNEWS_CREATOR_LLM_BACKENDunset and renders with it set. The cuda overlay renders withLLM_BACKEND=llamacppon news-creator.🤖 Generated with Claude Code