Providers API
Theproviders module integrates with runtime model providers (Ollama, llama.cpp, MLX) for detecting installed models and pulling new ones.
Core Trait
ModelProvider
Trait for runtime providers:
name()- Human-readable provider nameis_available()- Whether provider service is reachableinstalled_models()- Set of installed model names (lowercase)start_pull()- Begin downloading a model (returns handle for progress polling)
Ollama Provider
OllamaProvider
Integrates with Ollama daemon:
OLLAMA_HOST environment variable, defaults to http://localhost:11434.
Example:
Pulling Models
detect_with_installed()
Single-pass detection (avoids duplicate API calls):
(available, installed_models)
Example:
has_remote_tag()
Checks if model exists in Ollama registry:
llama.cpp Provider
LlamaCppProvider
Downloads GGUF files directly from HuggingFace:
- Models directory:
~/.cache/llmfit/models(or$LLMFIT_MODELS_DIR) - Detects
llama-cliandllama-serverin PATH
Searching HuggingFace
Listing Repo Files
Selecting Best Quantization
- Q8_0 (best)
- Q6_K
- Q5_K_M
- Q4_K_M
- Q3_K_M
- Q2_K (smallest)
Downloading GGUF Files
MLX Provider
MlxProvider
Integrates with Apple MLX framework:
- MLX server URL:
http://localhost:8080(or$MLX_LM_HOST) - Scans
~/.cache/huggingface/hub/for mlx-community models - Checks for
mlx_lmPython package viapython3 -c "import mlx_lm"
Pulling MLX Models
Uses HuggingFace CLI to download from mlx-community:hf CLI:
