llama-stack-mirror/docs/source/providers/inference
Ashwin Bharambe 68a2dfbad7
feat(ollama): periodically refresh models (#2805)
For self-hosted providers like Ollama (or vLLM), the backing server is
running a set of models. That server should be treated as the source of
truth and the Stack registry should just be a cache for those models. Of
course, in production environments, you may not want this (because you
know what model you are running statically) hence there's a config
boolean to control this behavior.

_This is part of a series of PRs aimed at removing the requirement of
needing to set `INFERENCE_MODEL` env variables for running Llama Stack
server._

## Test Plan

Copy and modify the starter.yaml template / config and enable
`refresh_models: true, refresh_models_interval: 10` for the ollama
provider. Then, run:

```
LLAMA_STACK_LOGGING=all=debug \
  ENABLE_OLLAMA=ollama uv run llama stack run --image-type venv /tmp/starter.yaml
```

See a gargantuan amount of logs, but verify that the provider is
periodically refreshing models. Stop and prune a model from ollama
server, restart the server. Verify that the model goes away when I call
`uv run llama-stack-client models list`
2025-07-18 12:20:36 -07:00
..
index.md docs: auto generated documentation for providers (#2543) 2025-06-30 15:13:20 +02:00
inline_meta-reference.md docs: auto generated documentation for providers (#2543) 2025-06-30 15:13:20 +02:00
inline_sentence-transformers.md docs: auto generated documentation for providers (#2543) 2025-06-30 15:13:20 +02:00
inline_vllm.md docs: auto generated documentation for providers (#2543) 2025-06-30 15:13:20 +02:00
remote_anthropic.md docs: auto generated documentation for providers (#2543) 2025-06-30 15:13:20 +02:00
remote_bedrock.md docs: auto generated documentation for providers (#2543) 2025-06-30 15:13:20 +02:00
remote_cerebras-openai-compat.md docs: auto generated documentation for providers (#2543) 2025-06-30 15:13:20 +02:00
remote_cerebras.md docs: auto generated documentation for providers (#2543) 2025-06-30 15:13:20 +02:00
remote_databricks.md docs: auto generated documentation for providers (#2543) 2025-06-30 15:13:20 +02:00
remote_fireworks-openai-compat.md docs: auto generated documentation for providers (#2543) 2025-06-30 15:13:20 +02:00
remote_fireworks.md docs: auto generated documentation for providers (#2543) 2025-06-30 15:13:20 +02:00
remote_gemini.md docs: auto generated documentation for providers (#2543) 2025-06-30 15:13:20 +02:00
remote_groq-openai-compat.md docs: auto generated documentation for providers (#2543) 2025-06-30 15:13:20 +02:00
remote_groq.md docs: auto generated documentation for providers (#2543) 2025-06-30 15:13:20 +02:00
remote_hf_endpoint.md docs: auto generated documentation for providers (#2543) 2025-06-30 15:13:20 +02:00
remote_hf_serverless.md docs: auto generated documentation for providers (#2543) 2025-06-30 15:13:20 +02:00
remote_llama-openai-compat.md docs: auto generated documentation for providers (#2543) 2025-06-30 15:13:20 +02:00
remote_nvidia.md fix: allow default empty vars for conditionals (#2570) 2025-07-01 14:42:05 +02:00
remote_ollama.md feat(ollama): periodically refresh models (#2805) 2025-07-18 12:20:36 -07:00
remote_openai.md docs: auto generated documentation for providers (#2543) 2025-06-30 15:13:20 +02:00
remote_passthrough.md docs: auto generated documentation for providers (#2543) 2025-06-30 15:13:20 +02:00
remote_runpod.md feat: consolidate most distros into "starter" (#2516) 2025-07-04 15:58:03 +02:00
remote_sambanova-openai-compat.md docs: auto generated documentation for providers (#2543) 2025-06-30 15:13:20 +02:00
remote_sambanova.md docs: auto generated documentation for providers (#2543) 2025-06-30 15:13:20 +02:00
remote_tgi.md docs: auto generated documentation for providers (#2543) 2025-06-30 15:13:20 +02:00
remote_together-openai-compat.md docs: auto generated documentation for providers (#2543) 2025-06-30 15:13:20 +02:00
remote_together.md feat: consolidate most distros into "starter" (#2516) 2025-07-04 15:58:03 +02:00
remote_vllm.md docs: auto generated documentation for providers (#2543) 2025-06-30 15:13:20 +02:00
remote_watsonx.md fix: allow default empty vars for conditionals (#2570) 2025-07-01 14:42:05 +02:00