Experiments with Crush and Ollama + Qwen 3 Coder
I found Crush as a recommendation for my AI Agents. Figured it was time to
spin it up. Installation was straightforward via Homebrew with a brew install charmbracelet/tap/crush . Crush
uses a configuration file at ~/.config/crush/crush.json on MacOS systems. To configure Ollama as the inference
runtime with qwen3-coder:30b, you would use something like this:
{
"$schema": "https://charm.land/crush.json",
"providers": {
"ollama": {
"name": "Ollama",
"base_url": "http://localhost:11434/v1/",
"type": "openai",
"models": [
{
"name": "Qwen 3 8B",
"id": "qwen3:8b-ctx-40960",
"context_window": 40960
}
]
}
},
"options": {
"disable_metrics": true
}
}
qwen3:8b-ctx-40960
Unforunately Ollama does not support the mechanism Crush uses to pass in the context window size. This results in
strange and unstable behavior from the LLM. To fix this we have ot quickly whip up a derrived model using the following,
which I shoved into qwen-3-8b-ctx-fix.Modelfile:
FROM qwen3:8b
PARAMETER num_ctx 40960
Then run ollama create qwen3:8b-ctx-40960 -f qwen-3-8b-ctx-fix.Modelfile to create the model with the correct
parameters.
gopls
Each project will require a Language Server Protocol (LSP) configured for the target languages.
Go provides a builtin service gopls to achieve this. Relative the project I created
.crush.json with the following contents:
{
"$schema": "https://charm.land/crush.json",
"lsp": {
"go": {
"command": "gopls"
}
}
}
Verifying usage
To verify Go integration, I used pgcqrs as the source. Asking the following prompt:
Let's write a summary for an AI agent to be able to generate a client able to create and recall records from a PGCQRS using
the client API. Let's write the documentation in `docs/clients.md`
This worked reasonably well, consuming about 8GBs of RAM while working. Took approximately 2 minutes to analyze the
file and create a somewhat reasonable first pass. I also attempted to use qwen2.5-coder:7b-instruct failed to work.