Concept from opencode:
opencode strictly decouples API connection configuration from the message payload structure. Protocols handle the wire format (openai-chat, anthropic-messages), while Providers act as thin facades for Base URLs and Auth headers.
How decafclaw could implement this:
decafclaw currently conflates connection setup and wire format inside each provider class (e.g., in src/decafclaw/llm/providers/openai_compat.py).
Proposed Implementation:
- Separate the "Wire Protocol" (formatting messages to Anthropic XML vs OpenAI JSON) from the "Connection Provider" (URL, Auth, Rate Limits).
- This separation allows
decafclaw to easily support numerous OpenAI-compatible APIs (Groq, Together, vLLM) by simply instantiating new provider facades that reuse the core openai_compat protocol logic.
Concept from opencode:
opencodestrictly decouples API connection configuration from the message payload structure. Protocols handle the wire format (openai-chat,anthropic-messages), while Providers act as thin facades for Base URLs and Auth headers.How
decafclawcould implement this:decafclawcurrently conflates connection setup and wire format inside each provider class (e.g., insrc/decafclaw/llm/providers/openai_compat.py).Proposed Implementation:
decafclawto easily support numerous OpenAI-compatible APIs (Groq, Together, vLLM) by simply instantiating new provider facades that reuse the coreopenai_compatprotocol logic.