d daedalus

Ollama

Ollama

Connect the builder to a local LLM through Ollama to resolve dependencies the static detector cannot figure out on its own.

When to use Ollama

The static detection pipeline (detect.rs / pkgmgr.rs) handles the common cases: well-known runtimes, standard package managers, and clean ELF binaries. Some projects are messier:

  • a custom or vendored runtime the detector does not recognize
  • an unusual monorepo layout with cross-package imports
  • a dependency pinned to a commit, a private registry, or a runtime-specific flag
  • a wrapper script that hides the real entrypoint

In those cases, point daedalus at a local model instead of guessing by hand.

Configuration

The configuration is read through the standard layered config system: command line first, then environment variables, then daedalus.toml, then ~/.daedalus/config.toml. Ollama runs a local inference server, so no cloud account is required.

# daedalus.toml (local) — lowest priority, filled only if env is absent
[ai]
provider = "ollama"
base_url = "http://localhost:11434"
model = "qwen2.5-coder:14b"

[secrets]
ai_token = "local-key"

The same keys can be overridden with DAEDALUS_AI_* environment variables (higher priority, 12-factor style):

export DAEDALUS_AI_PROVIDER=ollama
export DAEDALUS_AI_BASE_URL=http://localhost:11434
export DAEDALUS_AI_MODEL=qwen2.5-coder:14b
export DAEDALUS_AI_TOKEN=local-key
Layer Key Purpose
env DAEDALUS_AI_PROVIDER / ai.provider Selects the ollama provider
env DAEDALUS_AI_BASE_URL / ai.base_url Base URL of the Ollama server
env DAEDALUS_AI_MODEL / ai.model Model id used for proposals
secret DAEDALUS_AI_TOKEN / secrets.ai_token Optional bearer token, kept out of committed config

The token is resolved through daedalus's own secret store, and detect_secret_keys warns any time a raw TOKEN/API_KEY-shaped value would be baked into an artifact. Keep it in [secrets] or a .env passed with --env-file, never hardcoded in TOML.

Build with AI assistance

export DAEDALUS_AI_PROVIDER=ollama
cd ./my-app
daedalus build --ai-assist

The builder sends the detected runtime, package manager, and entrypoint, and asks the model to propose the missing or ambiguous dependencies before the rootfs is assembled. Whatever the model proposes is still verified against what actually resolves on disk.

Privacy

Because the model runs locally, your code and its dependency graph never leave the machine. Prefer Ollama for air-gapped build lanes and proprietary source trees.

Troubleshooting

  • Connection refused — confirm ollama serve is running and DAEDALUS_AI_BASE_URL is reachable.
  • Slow proposals — pick a smaller model such as qwen2.5-coder:7b.
  • No output — check that ai.model is a name Ollama actually has (ollama list).