You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docker model compose up can pass context-size, runtime-flags and speculative-decoding settings into ConfigureBackend, but it cannot pass process environment variables for the backend (for example GGML_CUDA_ENABLE_UNIFIED_MEMORY=1 for AMD UMA workarounds).
The runner already supports this at the process layer: RunnerConfig.Env is validated by ValidateEnv and appended onto os.Environ() when spawning the backend. Compose and BackendConfiguration never expose a field for it, so compose users cannot set backend env without leaving the compose provider path.
Ollama-style compose snippets set env on the service container. DMR compose only configures the model backend and cannot mirror that today.
Maintainers have already indicated env should not be exposed as an unauthenticated REST knob for security reasons. Compose is the right control plane because it is local provider configuration, not a broad network API.
No env field (only ContextSize, RuntimeFlags, speculative, backend-specific structs)
cmd/cli/commands/compose.goup
Flags: model, context-size, runtime-flags, backend, speculative-* only
compose metadata
Reflects those flags only
Proposed direction (for discussion)
Add an optional Environment []string (KEY=VALUE entries) to BackendConfiguration (or under LlamaCpp / shared block) and plumb it into RunnerConfig.Env when starting runners.
On docker model compose up, add a string-array flag such as --env KEY=VALUE (and/or a documented allowlist of keys).
Prefer an allowlist for keys (e.g. GGML_*, selected CUDA/Vulkan vars) so compose cannot inject arbitrary process env into the backend. Reject unknown keys with a clear error.
Advertise the parameter via compose metadata so Compose integration can document it.
Keep REST/OpenAI inference paths from accepting free-form env from remote clients.
Alternatives already available
Manual llama-server after docker model pull (works, loses compose lifecycle).
Global process env for the whole model-runner daemon (too coarse and easy to misconfigure).
Summary
docker model compose upcan passcontext-size,runtime-flagsand speculative-decoding settings intoConfigureBackend, but it cannot pass process environment variables for the backend (for exampleGGML_CUDA_ENABLE_UNIFIED_MEMORY=1for AMD UMA workarounds).The runner already supports this at the process layer:
RunnerConfig.Envis validated byValidateEnvand appended ontoos.Environ()when spawning the backend. Compose andBackendConfigurationnever expose a field for it, so compose users cannot set backend env without leaving the compose provider path.Why this matters
Current code shape (main)
pkg/inference/backendsRunnerConfig.Env+ValidateEnvinference.BackendConfigurationContextSize,RuntimeFlags, speculative, backend-specific structs)cmd/cli/commands/compose.goupcompose metadataProposed direction (for discussion)
Environment []string(KEY=VALUEentries) toBackendConfiguration(or underLlamaCpp/ shared block) and plumb it intoRunnerConfig.Envwhen starting runners.docker model compose up, add a string-array flag such as--env KEY=VALUE(and/or a documented allowlist of keys).GGML_*, selected CUDA/Vulkan vars) so compose cannot inject arbitrary process env into the backend. Reject unknown keys with a clear error.compose metadataso Compose integration can document it.Alternatives already available
llama-serverafterdocker model pull(works, loses compose lifecycle).Related
I am happy to implement an allowlisted prototype if this direction sounds right.