agent_crew icon indicating copy to clipboard operation
agent_crew copied to clipboard

feat: add support for local AI models (Ollama, LM Studio)

Open sre-helmcode opened this issue 8 months ago • 3 comments

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_URL and LM_STUDIO_BASE_URL to 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

sre-helmcode avatar Mar 03 '26 16:03 sre-helmcode

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.

sre-helmcode avatar Mar 12 '26 18:03 sre-helmcode

Reverted in 51a41dc. Will revisit when local model infrastructure (Ollama deployment in the stack) is planned.

sre-helmcode avatar Mar 13 '26 10:03 sre-helmcode

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.

sre-helmcode avatar Mar 24 '26 12:03 sre-helmcode