feat: add Astraflow provider support#3677
Open
ucloudnb666 wants to merge 1 commit into
Open
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.
Summary
Adds support for Astraflow (by UCloud / 优刻得), an OpenAI-compatible AI model aggregation platform supporting 200+ models.
Because Astraflow exposes an OpenAI-compatible API, integration requires only registering it as a
DefaultModelSuppliersentry — the existingelsebranch inLLMEndpoint.from_configalready routes unknown suppliers throughChatOpenAIwith the configuredbase_urlandapi_key, so no new SDK dependency is required.Endpoints
https://api-us-ca.umodelverse.ai/v1ASTRAFLOW_API_KEYhttps://api.modelverse.cn/v1ASTRAFLOW_CN_API_KEYThe env var names are auto-derived by the existing
normalize_to_env_variable_namehelper ("astraflow"→ASTRAFLOW_API_KEY,"astraflow_cn"→ASTRAFLOW_CN_API_KEY).Changes
core/quivr_core/rag/entities/config.py(single file, two locations)ASTRAFLOWandASTRAFLOW_CNto theDefaultModelSuppliersenum.LLMModelConfig._model_defaultsfor both suppliers so context-window / tokenizer resolution works out of the box.Usage
Notes
langchain_openai.ChatOpenAIclient via theelsebranch.Summary by cubic
Add Astraflow provider support (global and China) using the existing OpenAI-compatible path via
langchain_openai.ChatOpenAI. No new dependencies.ASTRAFLOWandASTRAFLOW_CNtoDefaultModelSuppliers.LLMModelConfig._model_defaultsforgpt-4o,gpt-4o-mini, andclaude-3-5-sonnet.https://api-us-ca.umodelverse.ai/v1andhttps://api.modelverse.cn/v1; env vars areASTRAFLOW_API_KEYandASTRAFLOW_CN_API_KEY.Written for commit 399ae8a. Summary will update on new commits.