fix(gateway): handle deepinfra in streaming transform - #2663
Conversation
DeepInfra uses the OpenAI-compatible /chat/completions endpoint but was missing from the provider switch in transform-streaming-to-openai, so every streamed chunk fell through to the default case and logged 'Unknown provider using OpenAI fallback'. Add it to the OpenAI-compatible case list. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe PR adds the ChangesDeepInfra streaming provider integration
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
Streaming requests routed to DeepInfra logged a warning on every chunk:
DeepInfra uses the OpenAI-compatible
/chat/completionsendpoint, butdeepinfrawas missing from the providerswitchintransform-streaming-to-openai.ts. Every streamed chunk fell through to thedefaultcase, which still works (it applies the same OpenAI transform) but emits a noisy warning per chunk.Fix
Add
deepinfrato the OpenAI-compatible case list alongside the other OpenAI-compatible providers (together-ai,inference.net, etc.), so chunks are handled explicitly and the warning is no longer logged.🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes