Documentation
¶
Index ¶
Constants ¶
const ( DefaultBaseURL = "http://localhost:12434" ContainerBaseURL = "http://model-runner.docker.internal" )
const ( ModelSmoLLM2 = "ai/smollm2" // 360M Q4_K_M (default tag) ModelSmoLLM2Tiny = "ai/smollm2:135M-Q4_K_M" // smallest available SmolLM2 variant ModelQwen25 = "ai/qwen2.5" // 7B Q4_K_M ModelQwen25Small = "ai/qwen2.5:0.5B-F16" // cheapest Qwen2.5 variant ModelQwen3 = "ai/qwen3" ModelQwen3Coder = "ai/qwen3-coder" ModelLlama32 = "ai/llama3.2" ModelLlama33 = "ai/llama3.3" ModelPhi4Mini = "ai/phi4-mini" ModelPhi4 = "ai/phi4" ModelGemma3 = "ai/gemma3" ModelGemma4 = "ai/gemma4" ModelDeepSeekR1 = "ai/deepseek-r1" ModelMistralSmall = "ai/mistral-small3.2" ModelGLM47Flash = "ai/glm-4.7-flash" ModelGranite4Nano = "ai/granite4.0-nano" ModelFunctionGemma = "ai/functiongemma" // ModelDefault is used when the caller does not specify a model. // SmolLM2 360M is the smallest available ai/ model and succeeds on // low-memory machines without a dedicated GPU. ModelDefault = ModelSmoLLM2 )
Known model IDs in Docker Hub's ai/ namespace.
Model IDs use the format ai/<name>:<tag>. Tags follow the pattern <size>-<quantization> (e.g. 7B-Q4_K_M). Using the bare name without a tag resolves to the recommended default quantization for that model family.
Models are served by llama.cpp via the defaultEngine backend. They are downloaded separately with `docker model pull ai/<name>`.
Variables ¶
This section is empty.
Functions ¶
func Available ¶
func Available(sharedTransport http.RoundTripper) bool
Available reports whether a Docker Model Runner server is reachable at DefaultBaseURL (http://localhost:12434).
It sends a GET request to the model list endpoint and returns true only when the response status is 200 OK. This makes the probe dual-purpose: it confirms both that the TCP port is open and that the API is operational.
The sharedTransport parameter allows callers to reuse an existing http.Transport (e.g. to honour proxy configuration or custom TLS settings). Pass nil to use http.DefaultTransport.
This function is called by provider/auto during auto-detection. The timeout ensures it does not block auto.New() on machines without Docker Desktop.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}