Lambda Symbolics

Run a local model with Ollama

Use a model that supports tool calls if you want Autolith to read files or run commands.

  1. Start ollama serve if Ollama is not running. Download the model in another terminal:

    Shell
    ollama pull qwen3:8b
  2. Add this form to ${XDG_CONFIG_HOME:-~/.config}/autolith/init.lisp:

    Common Lisp
    (register-openai-compatible-provider
     :name                         "local-ollama"
     :endpoint                     "http://127.0.0.1:11434/v1/chat/completions"
     :models                       '("qwen3:8b")
     :api-key-environment-variable "AUTOLITH_OLLAMA_KEY"
     :stream-usage-p               nil)
  3. Set a nonempty key and start Autolith. Local Ollama ignores the key, so you can use ollama as the value.

    Shell
    export AUTOLITH_OLLAMA_KEY=ollama
    autolith models | grep -Fx 'local-ollama/qwen3:8b'
    autolith --provider local-ollama --model qwen3:8b
  4. Send a short prompt to check that the reply streams. Ask Autolith to list the files in the current directory to check tool calls.

Troubleshoot Ollama

  • Unknown model. Run ollama list and copy the exact ID into :models.
  • Rejected stream options. Set :stream-usage-p nil as shown above.
  • Context limit is too small. Raise the limit on the server first. Then set :models to a list such as '((:name "qwen3:8b" :context-window 32768)), using the limit you set on the server.