Overview
CodeFrame should be a delivery harness, not an Anthropic-specific tool. The agent execution layer should accept any LLM — Anthropic, OpenAI, Ollama, Qwen-Coder, GLM, Deepseek, vLLM, LM Studio, or any OpenAI-compatible endpoint — chosen by the user at runtime.
Current State
The right abstraction already exists:
LLMProvider ABC in codeframe/adapters/llm/base.py with complete() / stream(), Purpose enum, and env var overrides
AnthropicProvider implements it correctly
- ReactAgent uses it correctly — never imports
anthropic directly
The gap is in the worker agents and CLI plumbing:
worker_agent.py, backend_worker_agent.py, frontend_worker_agent.py, test_worker_agent.py all hardcode AsyncAnthropic() directly
streaming_chat.py is wired to anthropic.AsyncAnthropic().messages.stream()
- No
--llm-provider / --llm-model CLI flags
get_provider() factory only supports "anthropic" and "mock"
Architecture
Because OpenAI's API is now an industry standard (Ollama, vLLM, LM Studio, Qwen, GLM, Deepseek all expose OpenAI-compatible endpoints), two adapters cover the entire ecosystem:
codeframe/adapters/llm/
├── base.py ✅ LLMProvider ABC, Purpose enum, ModelSelector
├── anthropic.py ✅ Anthropic implementation
├── openai.py ❌ OpenAI-compatible (covers OpenAI + any base_url override)
└── mock.py ✅ Test mock
Runtime selection:
cf work start <task> --execute --llm-provider openai --llm-model qwen2.5-coder:7b
cf work start <task> --execute --llm-provider openai --llm-model gpt-4o
cf work start <task> --execute # default: anthropic, claude-sonnet-4-5
Subissues (implement in order)
Acceptance Criteria
Overview
CodeFrame should be a delivery harness, not an Anthropic-specific tool. The agent execution layer should accept any LLM — Anthropic, OpenAI, Ollama, Qwen-Coder, GLM, Deepseek, vLLM, LM Studio, or any OpenAI-compatible endpoint — chosen by the user at runtime.
Current State
The right abstraction already exists:
LLMProviderABC incodeframe/adapters/llm/base.pywithcomplete()/stream(),Purposeenum, and env var overridesAnthropicProviderimplements it correctlyanthropicdirectlyThe gap is in the worker agents and CLI plumbing:
worker_agent.py,backend_worker_agent.py,frontend_worker_agent.py,test_worker_agent.pyall hardcodeAsyncAnthropic()directlystreaming_chat.pyis wired toanthropic.AsyncAnthropic().messages.stream()--llm-provider/--llm-modelCLI flagsget_provider()factory only supports"anthropic"and"mock"Architecture
Because OpenAI's API is now an industry standard (Ollama, vLLM, LM Studio, Qwen, GLM, Deepseek all expose OpenAI-compatible endpoints), two adapters cover the entire ecosystem:
Runtime selection:
Subissues (implement in order)
adapters/llm/openai.py)get_provider()+ModelSelector)--llm-providerand--llm-modelworker_agent.pyto useLLMProviderabstractionbackend_worker_agent.py,frontend_worker_agent.py,test_worker_agent.pystreaming_chat.py)llm:block in.codeframe/config.yaml)Acceptance Criteria
cf work start <task> --execute --llm-provider openai --llm-model gpt-4oworks end-to-endOPENAI_BASE_URL=http://localhost:11434/v1routes to local OllamaLLMProviderabstraction, notAsyncAnthropicdirectly