feat(providers): add first-class Qianfan provider support#922
Open
jimmyzhuu wants to merge 1 commit intokatanemo:mainfrom
Open
feat(providers): add first-class Qianfan provider support#922jimmyzhuu wants to merge 1 commit intokatanemo:mainfrom
jimmyzhuu wants to merge 1 commit intokatanemo:mainfrom
Conversation
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.
What changed
qianfanas a first-class OpenAI-compatible provider.qianfan/*in the CLI config generator and JSON schema.QIANFAN_API_KEYandhttps://qianfan.baidubce.com/v2.ProviderId::Qianfan/LlmProviderType::Qianfanwith parse, display, and round-trip coverage./v1/chat/completionsto Qianfan's/v2/chat/completionsupstream path.Why this change is needed
Qianfan supports OpenAI-compatible chat completions, but using it today requires users to configure a custom provider with both
base_urlandprovider_interface: openai.This makes Qianfan match the existing first-class provider flow used by other OpenAI-compatible providers: users can configure
qianfan/*directly, useQIANFAN_API_KEYin zero-config setups, and rely on Plano's validation and routing behavior.User impact
Users can configure Qianfan with:
or a specific model:
Plano routes OpenAI-compatible chat completion requests to
https://qianfan.baidubce.com/v2/chat/completions.Tests / validation
cd cli && uv run pytest -qcd crates && cargo fmt --all -- --checkcd crates && cargo test -p hermesllm test_qianfan --libcd crates && cargo test -p common test_llm_provider_type_qianfan_roundtrip --libgit diff --checkNotes for reviewers
baiduis accepted as a provider alias inProviderId, but the canonical config prefix isqianfan.