Using Codistry with Ollama
Connect Ollama for fully offline, privacy-first AI assistance.
What is Ollama?
Ollama is a lightweight CLI tool for running open-source LLMs locally. It exposes an OpenAI-compatible API, so Codistry can talk to it directly.
Complete Privacy
All processing stays on your machine. Nothing leaves your network.
Simple CLI
One command to pull and run any supported model.
Offline Ready
No internet required after initial model download.
Hardware Optimized
Automatic GPU acceleration on Apple Silicon, NVIDIA, and AMD.
Prerequisites
- Ollama installed (macOS, Linux, or Windows)
- Codistry VS Code extension installed
- At minimum 8 GB RAM (16 GB+ recommended for 7B+ models)
Step 1: Install Ollama
# macOS / Linux
curl -fsSL https://ollama.ai/install.sh | sh
# Or download from https://ollama.ai for Windows / macOS .dmgStep 2: Pull a Model
# Recommended for coding
ollama pull llama3
# Other popular options
ollama pull codellama
ollama pull mistral
ollama pull deepseek-coderRecommended Models
| Model | Size | Best for |
|---|---|---|
llama3 | ~4.7 GB | General-purpose, great balance |
codellama | ~3.8 GB | Code generation & explanation |
deepseek-coder | ~3.8 GB | Strong coding performance |
mistral | ~4.1 GB | Fast, efficient generalist |
llama3:70b | ~39 GB | Highest quality (needs 64 GB+ RAM) |
Step 3: Configure Codistry
Codistry can auto-detect models you've already pulled with Ollama. Open the Codistry sidebar, go to the Models tab, and use the Ollama one-click import to add a detected model without typing anything. If you prefer to add it manually, follow the steps below.
- Open the Codistry sidebar in VS Code
- Click the Settings gear icon
- Navigate to Models
- Add an OpenAI-Compatible Model:
- Display Name: Name of choice
- Model Name:
llama3(must match the name fromollama list) - Base URL:
http://localhost:11434/v1 - Max Tokens:Your model's context length
- Click Add Model, then Save Settings
Prefer editing settings.json directly? Add an entry to the adronite-agent.customModels array:
// settings.json
{
"adronite-agent.customModels": [
{
"id": "ollama-llama3",
"name": "Llama 3 (Ollama)",
"apiUrl": "http://localhost:11434/v1",
"maxTokens": 8192
}
]
}Step 4: Test the Connection
- Make sure Ollama is running (
ollama serveor it starts automatically) - Open the Codistry chat panel
- Select your Ollama model from the dropdown
- Send a test message
Troubleshooting
The model name in Codistry must exactly match the name in Ollama. Run ollama list to see installed models and use the exact name.
Problem: "Connection refused" error
Solution: Run `ollama serve` to start the server, or check if it's already running on port 11434.
Problem: Slow responses
Solution: Try a smaller model (3B-7B) or ensure GPU acceleration is enabled.
Problem: Streaming issues
Solution: Disable streaming for local models by adding "adronite-agent.streamingEnabled": { "custom-openai": false } to settings.json.
Next Steps
- See the Settings Reference for all custom model options
- Review Best Practices for effective AI assistance
- Check out the LM Studio Guide for an alternative local setup