feat: add Astraflow (ModelVerse) provider support#2183
Open
ucloudnb666 wants to merge 3 commits intostrands-agents:mainfrom
Open
feat: add Astraflow (ModelVerse) provider support#2183ucloudnb666 wants to merge 3 commits intostrands-agents:mainfrom
ucloudnb666 wants to merge 3 commits intostrands-agents: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.
Summary
This PR adds support for Astraflow (UCloud ModelVerse) as a model provider in Strands Agents.
Astraflow is UCloud's AI model aggregation platform that provides an OpenAI-compatible API supporting models such as DeepSeek, Claude, GPT-4, and more.
Two Regional Endpoints (registered as independent providers)
AstraflowModelhttps://api-us-ca.umodelverse.ai/v1ASTRAFLOW_API_KEYAstraflowCNModelhttps://api.modelverse.cn/v1ASTRAFLOW_CN_API_KEYChanges
src/strands/models/astraflow.py— New provider module withAstraflowModel(global) andAstraflowCNModel(China) classes, both built on top of the existingOpenAIModelwith pre-configuredbase_urlandapi_keydefaults.src/strands/models/__init__.py— Lazy-load entries forAstraflowModelandAstraflowCNModel.pyproject.toml— Newastraflowoptional dependency group (reuses theopenaipackage).Usage
Install with:
pip install "strands-agents[astraflow]"Set your API key:
Design Notes
AstraflowModelandAstraflowCNModelextendOpenAIModeldirectly, inheriting all OpenAI-compatible streaming, tool-use, and structured-output logic.base_urlandapi_keyare pre-configured viaclient_argsdefaults, so users only need to set the environment variable — no manual URL configuration required.SageMakerAIModel).