feat(providers): add Chutes AI support - #667
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis change adds the Chutes provider with OpenAI-compatible request routing, live model discovery, environment-based configuration, factory registration, tests, and documentation. ChangesChutes Provider
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant ChutesProvider
participant OpenAICompatibleClient
participant ChutesAPI
Client->>ChutesProvider: Submit chat or Responses request
ChutesProvider->>OpenAICompatibleClient: Translate and forward request
OpenAICompatibleClient->>ChutesAPI: Send authenticated chat request
ChutesAPI-->>OpenAICompatibleClient: Return completion response or stream
OpenAICompatibleClient-->>ChutesProvider: Return normalized response
ChutesProvider-->>Client: Return response or stream
Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 |
0386a8f to
153ee15
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@config/config.example.yaml`:
- Around line 383-387: Update the chutes configuration example near the base_url
entry to explain when users should override the default, such as when targeting
a custom, self-hosted, or non-default endpoint. Preserve the existing default
URL documentation and use a concise YAML comment.
In `@internal/providers/chutes/chutes_test.go`:
- Around line 14-167: Extend the Chutes tests with coverage for
StreamChatCompletion and Passthrough, asserting each request uses the expected
base URL/path and Bearer authorization. Add a non-2xx upstream-response test for
ChatCompletion or Responses that verifies the provider returns an error. Keep
assertions focused on request translation and normalized responses, consistent
with the existing TestChatCompletion_UsesBearerAuthAndChatEndpoint and
TestResponses_TranslatesToChatCompletions patterns.
In `@internal/providers/chutes/models.go`:
- Around line 47-50: Update the ModelsResponse normalization around
result.Object to assign the OpenAI-compatible value "list" unconditionally,
removing the conditional fallback while preserving the existing response
construction.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: becd3889-513f-4e7c-a764-556884adc64a
📒 Files selected for processing (9)
config/config.example.yamldocs/advanced/configuration.mdxdocs/providers/overview.mdxinternal/providers/chutes/chutes.gointernal/providers/chutes/chutes_test.gointernal/providers/chutes/models.gointernal/providers/config_test.gorun/providers.gorun/providers_test.go
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
config/config.example.yaml (1)
16-16: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winAdd Chutes to the passthrough allowlist.
enabled_passthrough_providersis the explicit provider allowlist for/p/{provider}/...; Chutes exists inconfig/config.example.yaml, is marked passthrough-ready indocs/providers/overview.mdx, and implementscore.PassthroughProvider, but it is not on this list. Add"chutes"here and alignconfig/server.goand the default enable list with this change.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@config/config.example.yaml` at line 16, Add "chutes" to the enabled_passthrough_providers example allowlist, then update the corresponding default provider enable list in config/server.go so both configuration paths include Chutes consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/advanced/configuration.mdx`:
- Line 412: Add CHUTES_API_KEY to the Provider API Keys table, documenting it as
the key for the Chutes provider and noting that CHUTES_BASE_URL is optional.
Keep the existing configuration example consistent with the new table entry.
---
Outside diff comments:
In `@config/config.example.yaml`:
- Line 16: Add "chutes" to the enabled_passthrough_providers example allowlist,
then update the corresponding default provider enable list in config/server.go
so both configuration paths include Chutes consistently.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 323cd5ec-9061-4c83-962a-05bcf35b3b1e
📒 Files selected for processing (6)
config/config.example.yamldocs/advanced/configuration.mdxdocs/providers/overview.mdxinternal/providers/config_test.gorun/providers.gorun/providers_test.go
Confidence Score: 5/5No blocking failure remains. No accepted blocking findings remain after exercising the Chutes passthrough default and explicit opt-in paths.
What T-Rex did
Reviews (3): Last reviewed commit: "fix(chutes): require passthrough opt-in" | Re-trigger Greptile |
|
Addressed the updated Codecov report in a7c34ff. Added focused tests for the previously uncovered Chutes constructor, base-URL override, streaming Responses adapter, model-catalog error/filter paths, optional modalities, and partial pricing. Local package coverage is now 100% of production statements; the full Go test suite, race hook, lint, formatting, performance guard, and fix checks pass. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/providers/chutes/chutes_test.go`:
- Around line 238-239: Replace the gotBody map in the chat-completions test with
a local typed struct containing Model and Stream fields, using the request
payload’s expected value types; apply the same change to the additional gotBody
declaration around the later test case.
- Around line 30-46: Update the HTTP handlers in
internal/providers/chutes/chutes_test.go:30-46 and
internal/providers/chutes/chutes_test.go:240-270 to assert GET for ListModels
and POST for streaming Responses translation, respectively. Update the catalog
handler in internal/providers/chutes/models_test.go:13-42 to assert GET. Use
each request’s Method field and the corresponding net/http method constants
while preserving the existing path, response, and translation assertions.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 269d14f7-1abc-458d-8742-c6e00f3075e9
📒 Files selected for processing (2)
internal/providers/chutes/chutes_test.gointernal/providers/chutes/models_test.go
|
Following maintainer direction, a5a661d enables Chutes in the default passthrough allowlist. The runtime/config defaults, example YAML, passthrough documentation, and enabled-provider error output are aligned, with a server regression test proving that POST /p/chutes/chat/completions reaches Chutes under default settings. |
|
@coderabbitai review |
|
|
Follow-up to the earlier passthrough-default note: 9d421be restores Chutes passthrough to explicit opt-in after the verified model-less-route authorization finding. Chutes remains fully supported by the passthrough API, but operators must add |
Description
Validation
AI Generated (optional)
Implemented and validated with Codex.
Summary by CodeRabbit
New Features
CHUTES_API_KEYis available.Documentation