feat: add OpenAI provider support#10
Open
rililive wants to merge 6 commits into
Open
Conversation
Adds OpenAI as a fourth model provider alongside Anthropic, Gemini, and Ollama. Includes the OpenAI provider implementation, 7 models in the catalog with verified June 2026 pricing, and automatic provider inference when OPENAI_API_KEY is the only key present. - src/providers/openaiFormat.ts: extracted shared OpenAI wire-format helpers (message translation, SSE parsing) used by both Ollama and the new OpenAI provider - src/providers/openai.ts: OpenAIProvider streaming over /v1/chat/completions; uses max_completion_tokens for o-series compat - Provider + config wired end-to-end: OPENAI_API_KEY, TINY_CODE_OPENAI_URL, openaiBaseUrl for Azure/proxy overrides, escalateTo support - Catalog: o3, gpt-4.1, o4-mini, gpt-4o, gpt-4.1-mini, gpt-4o-mini, gpt-4.1-nano with pricing and coding scores https://claude.ai/code/session_01TwQBmEkVM2JcZQYqV4jsZJ
…nai-models-support-hvac49 # Conflicts: # .env.example # src/config/load.ts # src/models/catalog.ts # src/providers/index.ts # src/providers/ollama.ts # src/providers/types.ts # tests/config/load.test.ts
…penAiCompatibleProvider
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds OpenAI as a fourth model provider alongside Anthropic, Gemini, and
Ollama. Includes the OpenAI provider implementation, 7 models in the
catalog with verified June 2026 pricing, and automatic provider inference
when OPENAI_API_KEY is the only key present.
helpers (message translation, SSE parsing) used by both Ollama and
the new OpenAI provider
/v1/chat/completions; uses max_completion_tokens for o-series compat
openaiBaseUrl for Azure/proxy overrides, escalateTo support
gpt-4.1-nano with pricing and coding scores
https://claude.ai/code/session_01TwQBmEkVM2JcZQYqV4jsZJ