Documentation
¶
Index ¶
- Variables
- func AllowedOrigins() (origins []string)
- func AsMap() map[string]EnvVar
- func Bool(key string) func() bool
- func BoolWithDefault(key string) func(defaultValue bool) bool
- func DiffusersServerPath() string
- func LlamaArgs() string
- func LlamaServerPath() string
- func LlamaServerVersion() string
- func LogLevel() slog.Level
- func MLXServerPath() string
- func ModelsPath() (string, error)
- func SGLangServerPath() string
- func SocketPath() string
- func String(key string) func() string
- func TCPPort() string
- func TLSCert() string
- func TLSKey() string
- func TLSPort() string
- func VLLMMetalServerPath() string
- func VLLMServerPath() string
- func Var(key string) string
- type EnvVar
Constants ¶
This section is empty.
Variables ¶
var DisableMetrics = Bool("DISABLE_METRICS")
DisableMetrics is true when DISABLE_METRICS is set to a truthy value (e.g. "1").
var DisableServerUpdate = Bool("DISABLE_SERVER_UPDATE")
DisableServerUpdate is true when DISABLE_SERVER_UPDATE is set to a truthy value.
var TLSAutoCert = BoolWithDefault("MODEL_RUNNER_TLS_AUTO_CERT")
TLSAutoCert is true (default) unless MODEL_RUNNER_TLS_AUTO_CERT is set to a falsy value. Call as TLSAutoCert(true) to get the default-true behaviour.
var TLSEnabled = Bool("MODEL_RUNNER_TLS_ENABLED")
TLSEnabled is true when MODEL_RUNNER_TLS_ENABLED is set to a truthy value.
Functions ¶
func AllowedOrigins ¶
func AllowedOrigins() (origins []string)
AllowedOrigins returns a list of CORS-allowed origins. It reads DMR_ORIGINS and always appends default localhost/127.0.0.1/0.0.0.0 entries on http and https with wildcard ports.
func AsMap ¶
AsMap returns a map of all model-runner environment variables with their current values and descriptions. Useful for introspection and documentation.
func BoolWithDefault ¶
BoolWithDefault returns a lazy bool accessor for the given environment variable, allowing a caller-specified default. If the variable is set but cannot be parsed as a bool, the defaultValue is returned.
func DiffusersServerPath ¶
func DiffusersServerPath() string
DiffusersServerPath returns the optional path to the Diffusers server binary. Configured via DIFFUSERS_SERVER_PATH.
func LlamaArgs ¶
func LlamaArgs() string
LlamaArgs returns custom arguments to pass to the llama.cpp server. Configured via LLAMA_ARGS.
func LlamaServerPath ¶
func LlamaServerPath() string
LlamaServerPath returns the path to the llama.cpp server binary. Configured via LLAMA_SERVER_PATH; defaults to the Docker Desktop bundle location.
func LlamaServerVersion ¶
func LlamaServerVersion() string
LlamaServerVersion returns a specific llama.cpp server version to pin. Configured via LLAMA_SERVER_VERSION; empty string means use the bundled version.
func MLXServerPath ¶
func MLXServerPath() string
MLXServerPath returns the optional path to the MLX server binary. Configured via MLX_SERVER_PATH.
func ModelsPath ¶
ModelsPath returns the directory where models are stored. Configured via MODELS_PATH; defaults to ~/.docker/models.
func SGLangServerPath ¶
func SGLangServerPath() string
SGLangServerPath returns the optional path to the SGLang server binary. Configured via SGLANG_SERVER_PATH.
func SocketPath ¶
func SocketPath() string
SocketPath returns the Unix socket path for the model runner. Configured via MODEL_RUNNER_SOCK; defaults to "model-runner.sock".
func TCPPort ¶
func TCPPort() string
TCPPort returns the optional TCP port for the model runner HTTP server. Configured via MODEL_RUNNER_PORT; empty string means use Unix socket.
func TLSCert ¶
func TLSCert() string
TLSCert returns the path to the TLS certificate file. Configured via MODEL_RUNNER_TLS_CERT.
func TLSKey ¶
func TLSKey() string
TLSKey returns the path to the TLS private key file. Configured via MODEL_RUNNER_TLS_KEY.
func TLSPort ¶
func TLSPort() string
TLSPort returns the TLS listener port. Configured via MODEL_RUNNER_TLS_PORT; defaults to "12444".
func VLLMMetalServerPath ¶
func VLLMMetalServerPath() string
VLLMMetalServerPath returns the optional path to the vLLM Metal server binary. Configured via VLLM_METAL_SERVER_PATH.
func VLLMServerPath ¶
func VLLMServerPath() string
VLLMServerPath returns the optional path to the vLLM server binary. Configured via VLLM_SERVER_PATH.