Skip to content

ollama-layer

Recipe card from the charly-ollama plugin (Images — the deployable catalog).

Property Value
Dependencies cuda, supervisord
Ports 11434
Volumes models -> ~/.ollama
Aliases ollama -> ollama
Service ollama (supervisord)
Install files task:
Variable Value
OLLAMA_HOST 0.0.0.0
OLLAMA_MODELS ~/.ollama/models

Service Environment (injected into other containers)

Section titled “Service Environment (injected into other containers)”
Variable Template Value Resolved Example
OLLAMA_HOST http://{{.ContainerName}}:11434 http://charly-ollama:11434

Pod-aware: same-container consumers receive http://localhost:11434, cross-container consumers receive http://charly-ollama:11434. When charly config ollama runs, OLLAMA_HOST is automatically injected into the global charly.yml env. Use charly config ollama --update-all to propagate to already-deployed services immediately.

See /charly-image:layer for env_provide field docs and /charly-core:charly-config for --update-all.

charly.yml
ollama:
candy:
- ollama
Terminal window
charly alias install ollama # install host 'ollama' command
ollama run llama3 # uses the alias

The env_provide mechanism makes OLLAMA_HOST available to all containers. The hermes candy auto-detects this variable and configures itself to use local Ollama as its LLM provider (highest priority in the auto-detection chain: OLLAMA_HOST > OLLAMA_API_KEY > OPENROUTER_API_KEY). See /charly-hermes:hermes for details on the auto-provider-configuration.

The candy ships its acceptance steps in its plan:, baked into the ai.opencharly.description OCI label (see /charly-check:check for the full schema). Each step is one inline Op — a probe is a check: step — and its context: list gates where it runs:

  • context: [build] (run under charly check box):
    • ollama-binary/usr/bin/ollama exists
  • context: [deploy] (run under charly check live against a live service; uses ${HOST_PORT:11434} / ${CONTAINER_IP} so deploy-time port remapping works unchanged):
    • ollama-tags-apiGET http://${CONTAINER_IP}:${HOST_PORT:11434}/api/tags returns 200
    • ollama-versionollama --version stdout matches ^ollama version

Use when the user asks about:

  • Ollama setup or model management
  • LLM serving or inference
  • Port 11434 configuration
  • Ollama model storage volume
  • The ollama host alias