[codex] Add OpenAI-compatible LLM providers#563
Conversation
Greptile SummaryThis PR introduces a shared
Confidence Score: 5/5All five providers are thin wrappers around a well-tested shared factory; no logic errors or API contract violations detected. The shared factory correctly handles URL normalization, auth headers, error-body extraction, and env validation. All default model IDs were cross-checked against official provider documentation and are confirmed valid. The package structure mirrors the existing openrouter provider. The change is purely additive with no modifications to existing code paths. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Caller] --> B[Provider Package\ne.g. groqProvider]
B --> C[createOpenAICompatibleProvider\nshared factory]
C --> D{Operation}
D --> E[chat\nPOST /chat/completions]
D --> F[listModels\nGET /models]
D --> G[validateEnv\ncheck API key + URL]
D --> H[healthcheck\nvalidateEnv only]
E --> I{res.ok?}
F --> I
I -->|Yes| J[parseContent / sort IDs]
I -->|No| K[readErrorDetail\nres.text → JSON.parse → message]
K --> L[AgentProviderRequestError\ndisplayName + op + status + message]
J --> M[Return result]
subgraph Providers
P1[groq]
P2[deepseek]
P3[mistral]
P4[xai]
P5[cerebras]
end
Providers --> C
Reviews (2): Last reviewed commit: "Add OpenAI-compatible LLM providers" | Re-trigger Greptile |
314f332 to
f512d8c
Compare
f512d8c to
2f1f403
Compare
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
2 similar comments
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
Summary
Why
This fills the requested OpenAI-compatible LLM adapter set for Groq, DeepSeek, Mistral, xAI, and Cerebras while keeping provider-specific packages small and consistent with existing agent-provider package structure.
Validation
tsc -p packages/agent-providers/shared/tsconfig.json --noEmittsc -p packages/agent-providers/groq/tsconfig.json --noEmittsc -p packages/agent-providers/deepseek/tsconfig.json --noEmittsc -p packages/agent-providers/mistral/tsconfig.json --noEmittsc -p packages/agent-providers/xai/tsconfig.json --noEmittsc -p packages/agent-providers/cerebras/tsconfig.json --noEmitspawn EPERM; TypeScript package checks above passed.