Repository navigation
feat(models): add llmman as a models provider - #14452
ericcurtin wants to merge 3 commits into
Conversation
a90ffe9 to
08bc74e
Compare
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟡 NEEDS ATTENTION
Lower-confidence findings (not posted inline)
- [low] pkg/compose/model_llmman.go:212 —
scanner.Err()not checked after stdout-scanning loop in PullModel (confidence: weak 38/100) - [low] pkg/compose/model_llmman.go:161 —
llmman list <model> --formatflag after positional arg may be unsupported by some CLI frameworks (confidence: weak 34/100) - [low] pkg/compose/model.go:57 —
ListModelserror silently ignored; could mask backend failures (confidence: weak 38/100)
Add llmman (https://github.com/llmmanorg/llmman) as an alternative backend for the top-level models element. It is selected explicitly with COMPOSE_MODEL_PROVIDER=llmman (shell or .env), and is also used when COMPOSE_MODEL_PROVIDER is unset, the docker model plugin is not installed and llmman is found in PATH. Docker Model Runner remains the default and is unchanged whenever its plugin is installed. modelAPI becomes a small internal interface implemented by the existing Docker Model Runner code and by a new llmman backend that drives the llmman CLI: llmman ps checks the daemon first, llmman list finds stored models, llmman pull fetches missing ones. context_size and runtime_flags have no per-model equivalent in llmman and are ignored with a warning. Signed-off-by: Eric Curtin <eric.curtin@docker.com>
08bc74e to
71564db
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
IMHO compose is not the right place to select a model runtime. Docker Model Runner has been design to abstract this away, so that model reference is the only thing user has to provide. Better request DMR to support this alternative runtime |
A line past the scanner's limit stopped it reading, which could block the child. Signed-off-by: Eric Curtin <eric.curtin@docker.com>
Signed-off-by: Eric Curtin <eric.curtin@docker.com>
That's not how this works. llmman is a replacement for DMR, like a DMR 2.0, DMR is not an llmman wrapper. |
What this PR does
Adds llmman (https://github.com/llmmanorg/llmman) as an alternative backend for the top-level
modelselement, selected explicitly withCOMPOSE_MODEL_PROVIDER=llmman(shell or.env). It is also used automatically whenCOMPOSE_MODEL_PROVIDERis unset, thedocker modelplugin is not installed andllmmanis on PATH (debug log only). Docker Model Runner always wins when its plugin is installed, and an explicitdocker-model-runnernever falls back. Any other value is an error.Related issue
No linked issue yet: this is a proposal and I'm aware CONTRIBUTING.md asks for a
status/approvedissue for AI-assisted PRs. Happy to open an issue and discuss the design there if maintainers prefer.Changes made
modelAPIbecomes a small internal interface (Check,ListModels,HasModel,PullModel,ConfigureModel,SetModelVariables,Close). The existing code isdmrModelAPI, with the same commands and errors. The model/endpoint variable injection is shared by both providers.pkg/compose/model_llmman.go, driving thellmmanCLI with the project environment:llmman psverifies the daemon first (never starts it; actionable error otherwise).llmman list --formatfinds models already stored, and llmman itself resolves references, so only missing models are pulled withllmman pull.context_sizeandruntime_flagshave no per-model equivalent in llmman, so they are ignored with a warning event.<NAME>_MODELand<NAME>_URL(ormodel_var/endpoint_var), where the URL is the OpenAI base URL built fromLLMMAN_HOST(defaulthttp://host.docker.internal:17434/v1).psandlistcommands.model_llmman.go; there is no hand-written models doc to update.Testing done
go test ./pkg/...(new fake-llmmantests plus the unchanged Docker Model Runner dry-run test)./pkg/compose/...with golangci-lint (3 remainingnolintlintreports are in files this PR does not touch)gofmt, gofumpt/gci through golangci-lintdocker.io/ai/smollm2:135M-Q2_Kandhf.co/unsloth/SmolLM2-135M-Instruct-GGUF:Q2_Kthroughdocker compose create, re-ran with nothing to pull, checked the container env vars,--dry-run, daemon down, missing binary and a bad provider value. Not tested: a container calling the daemon, inference, Docker Desktop, API-key auth or TLS.AI tool used (if applicable)
AI Tool: opencode with anthropic/claude-sonnet-5-5 (high variant), supervised by me. The code, tests and this description were drafted by the agent, and I have reviewed the change (
AI_AGENT_DISCLOSURE.mdremoved from the commit).Additional context
Behaviour worth knowing
ai/<name>as a Hugging Face repo, not Docker Hub, unlike Docker Model Runner. Use<name>ordocker.io/ai/<name>; a failed pull of anai/reference says so.0.0.0.0needsLLMMAN_API_KEYSorLLMMAN_AUTH=off) andextra_hosts: host.docker.internal:host-gateway. Documented, not automated.ensureModelsis touched (Check/HasModelhooks, a localerrin the goroutine instead of the shared outer one); Docker Model Runner behaviour is the same. This may conflict with fix(models): check the model listing error and keep pull errors per goroutine #14284.