Repository navigation
feat: add Cheaper Inference LLM provider - #132
aiapienthusiast wants to merge 1 commit into
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (10)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe change adds Cheaper Inference as an optional LLM provider. It supports configurable credentials, endpoint, and model settings. The default provider chain and CLI can use it, and setup guidance now documents its configuration. ChangesCheaper Inference provider
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~12 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant ProviderChain
participant CheaperInferenceProvider
participant Environment
participant OpenAiProvider
ProviderChain->>CheaperInferenceProvider: Construct optional provider
CheaperInferenceProvider->>Environment: Read key and setting variables
CheaperInferenceProvider->>OpenAiProvider: Create provider with resolved settings
Suggested reviewers: Merge Risk: ⚪ Minimal · up to This change adds an opt-in Cheaper Inference provider. The provider is used only when its API key is configured, and it is consistent with the existing providers. No outstanding issues block merging. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to The integration is opt-in, uses HTTPS by default, and preserves existing provider priority. However, endpoint overrides can send the new provider’s API key and request content over unencrypted HTTP. The risk is conditional on configuration, rather than an endpoint that ordinary API callers can directly choose. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 46.15% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 6 files. (4 skipped: 4 unsupported.)
✨ Finishing Touches🧪 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 |
This PR adds Cheaper Inference as an opt-in provider in the LLM chain.
It uses the same pattern as #116.
Cheaper Inference is an OpenAI-compatible LLM gateway.
One API key gives access to models from several labs.
Usage:
export CHEAPER_INFERENCE_API_KEY=your-key webclaw https://example.com --summarize --llm-provider cheaperinferenceThe provider joins the default chain only when the key is set.
It is added last, after OrcaRouter.
Details
Files:
crates/webclaw-llm/src/providers/cheaperinference.rs: provider that wrapsOpenAiProvider, with unit tests.crates/webclaw-llm/src/providers/mod.rs,crates/webclaw-llm/src/chain.rs: register the provider at the end of the chain.crates/webclaw-cli/src/main.rs:--llm-provider cheaperinferenceand error text.crates/webclaw-server/src/routes/extract.rs,summarize.rs: error text.README.md,README_zh-CN.md,env.example,CHANGELOG.md: env vars and changelog entry.Env vars:
CHEAPER_INFERENCE_API_KEY,CHEAPER_INFERENCE_BASE_URL(defaulthttps://api.cheaperinference.com/v1),CHEAPER_INFERENCE_MODEL(defaultgpt-5.4-mini).Tests:
cargo fmt --check --allpasses.cargo clippy -p webclaw-llm --all-targets -- -D warningspasses.cargo clippy -p webclaw-cli -p webclaw-server -- -D warningspasses.cargo test -p webclaw-llmpasses (65 passed).Live check:
gpt-5.4-minireturned a summary throughProviderChain::cloud_default()andsummarize(), with onlyCHEAPER_INFERENCE_API_KEYset.Summary by CodeRabbit
cheaperinferenceas an available CLI provider option.