Skip to content

feat: add Astraflow provider support#3677

Open
ucloudnb666 wants to merge 1 commit into
QuivrHQ:mainfrom
ucloudnb666:feat/astraflow-1778319999
Open

feat: add Astraflow provider support#3677
ucloudnb666 wants to merge 1 commit into
QuivrHQ:mainfrom
ucloudnb666:feat/astraflow-1778319999

Conversation

@ucloudnb666

@ucloudnb666 ucloudnb666 commented May 9, 2026

Copy link
Copy Markdown

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 DefaultModelSuppliers entry — the existing else branch in LLMEndpoint.from_config already routes unknown suppliers through ChatOpenAI with the configured base_url and api_key, so no new SDK dependency is required.

Endpoints

Endpoint Base URL Env var
Global (US/CA) https://api-us-ca.umodelverse.ai/v1 ASTRAFLOW_API_KEY
China https://api.modelverse.cn/v1 ASTRAFLOW_CN_API_KEY

The env var names are auto-derived by the existing normalize_to_env_variable_name helper ("astraflow"ASTRAFLOW_API_KEY, "astraflow_cn"ASTRAFLOW_CN_API_KEY).

Changes

core/quivr_core/rag/entities/config.py (single file, two locations)

  1. Add ASTRAFLOW and ASTRAFLOW_CN to the DefaultModelSuppliers enum.
  2. Add representative model configs in LLMModelConfig._model_defaults for both suppliers so context-window / tokenizer resolution works out of the box.

Usage

import os
from quivr_core.rag.entities.config import LLMEndpointConfig, DefaultModelSuppliers

os.environ["ASTRAFLOW_API_KEY"] = "<your-key>"

# Global (US/CA) endpoint
config = LLMEndpointConfig(
    supplier=DefaultModelSuppliers.ASTRAFLOW,
    model="gpt-4o",
    llm_base_url="https://api-us-ca.umodelverse.ai/v1",
)

# China endpoint
os.environ["ASTRAFLOW_CN_API_KEY"] = "<your-cn-key>"
config_cn = LLMEndpointConfig(
    supplier=DefaultModelSuppliers.ASTRAFLOW_CN,
    model="gpt-4o",
    llm_base_url="https://api.modelverse.cn/v1",
)

Notes

  • Zero new dependencies — reuses the existing langchain_openai.ChatOpenAI client via the else branch.
  • Minimal surface area: one file changed.

Summary by cubic

Add Astraflow provider support (global and China) using the existing OpenAI-compatible path via langchain_openai.ChatOpenAI. No new dependencies.

  • New Features
    • Added ASTRAFLOW and ASTRAFLOW_CN to DefaultModelSuppliers.
    • Added defaults in LLMModelConfig._model_defaults for gpt-4o, gpt-4o-mini, and claude-3-5-sonnet.
    • Supports https://api-us-ca.umodelverse.ai/v1 and https://api.modelverse.cn/v1; env vars are ASTRAFLOW_API_KEY and ASTRAFLOW_CN_API_KEY.

Written for commit 399ae8a. Summary will update on new commits.

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. area: backend Related to backend functionality or under the /backend directory labels May 9, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@ucloudnb666 ucloudnb666 changed the title Add Astraflow provider support feat: add Astraflow provider support May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: backend Related to backend functionality or under the /backend directory size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant