Connect Midnight Coder to Ollama
Make sure the Ollama service is running and has at least one model available. Midnight Coder accepts an ip:port value or a full HTTP URL in its provider configuration flow.
/provider_conf 127.0.0.1:11434
/model
The provider flow probes the endpoint and checks both /api/tags and /v1/models. It stores the provider and model it detects. Start a new chat after saving the provider so the session uses that configuration consistently.
Enable Ollama smart context
Different local models support different context windows. Midnight Coder's smart context option reads the active model window and sends the corresponding num_ctx value to Ollama.
/smartcontext true
Disable it with /smartcontext false. You can also persist the setting in configuration:
ollama_smart_context = true
This reduces manual context tuning, but memory use still depends on the selected model, quantization, and available hardware.
Choose a local coding model
Use /model to select from models exposed by the server. Model choice should match the task and machine: larger models can improve reasoning, while smaller quantized models generally start faster and require less RAM or VRAM.
- Confirm the model appears in Ollama before opening the provider flow.
- Use a context size your hardware can sustain during long coding sessions.
- Start with repository exploration before asking a new model to make broad edits.
- Keep sandbox and approval settings appropriate for the workspace.
Ollama coding agent FAQ
Does a local provider keep everything private?
It keeps model inference on the provider host you configured. Other tools, integrations, or network-enabled commands can still communicate externally, so review sandbox, approval, and network settings for your environment.
Which endpoint does Midnight Coder use?
The setup flow probes /api/tags and /v1/models, allowing it to recognize Ollama-style and OpenAI-compatible model listings.
How do I control a long conversation?
Use /context, /compact, and /mini-model. See the complete AI context management guide.
Primary sources: Midnight Coder README and Ollama source repository.
Connect Ollama to Midnight Coder
Install the CLI, probe your provider endpoint, and select a model it exposes.
Explore Midnight CoderInstall