feat: add support for local AI models (Ollama, LM Studio)
Summary
Add support for local AI model providers (Ollama and LM Studio) in the OpenCode model selector.
Details
The model selector currently supports cloud providers (Anthropic, OpenAI, Google). Local model support via Ollama and LM Studio should be added as an option for users who want to run models locally.
Requirements
- Add Ollama models to the OpenCode model selector (e.g.,
ollama/llama3) - Add LM Studio models to the OpenCode model selector (e.g.,
lmstudio/default) - Add
OLLAMA_BASE_URLandLM_STUDIO_BASE_URLto the credential warnings system - Test with actual local model instances to verify connectivity
- Document configuration requirements (base URLs, model names)
Context
This was temporarily hidden from the UI in v0.2.4 to focus on cloud provider stability. The model entries and credential mappings were removed from TeamBuilderPage.tsx and should be re-added when local model support is ready.
Acceptance Criteria
- [ ] Ollama models appear in the OpenCode model selector under a "Local" group
- [ ] LM Studio models appear in the OpenCode model selector under a "Local" group
- [ ] Credential warnings show for missing
OLLAMA_BASE_URL/LM_STUDIO_BASE_URL - [ ] End-to-end test with a local Ollama instance confirms chat works
Implemented in commit 517130b. Ollama (llama3.3, qwen3, devstral) and LM Studio (default) models added to OpenCode selector with credential warnings for OLLAMA_BASE_URL and LM_STUDIO_BASE_URL.
Reverted in 51a41dc. Will revisit when local model infrastructure (Ollama deployment in the stack) is planned.
Ollama support fully implemented and tested in production. Includes: model provider constraint (Phase 1), Ollama container lifecycle with ref counting, model warm-up, KEEP_ALIVE=-1, think tag stripping, WebSocket keepalive for long inference times, and qwen3:4b/8b model options. Released in API 0.4.10 + Frontend 0.4.4.