agf-wiring-multi-llm-sdk

Solid

Use when wiring up or switching between China-domestic LLM providers (DeepSeek, Doubao/Volc Ark, Qwen/DashScope, MiniMax). Provides OpenAI-compatible adapter pattern, env-var contracts, fallback strategy, cost guardrails, and minimum verifications before declaring integration done.

AI & Automation 423 stars 11 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 88/100

Stars 20%
87
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Wiring Multi-LLM SDK (DeepSeek / Doubao / Qwen / MiniMax) Use this skill when: - You add a new LLM provider to `backend/app/agents/` or any backend module - You switch the default provider (e.g. DeepSeek → Doubao for cost reasons) - You wire fallback / retry logic between providers - You suspect a provider mismatch is the cause of a bug ## Decision: which SDK style? All four providers expose **OpenAI-compatible endpoints**. Default to the `openai` Python SDK with a custom `base_url` rather than each vendor's bespoke SDK — fewer dependencies, easier to swap, less drift. Bespoke SDK exceptions: - Doubao multimodal (image/video gen): use `volcengine-python-sdk` for Ark image API - MiniMax video / TTS: use `minimax` official SDK - Streaming nuance: confirm OAI-compat client handles vendor's stream chunk format Before wiring any SDK, pull its **current** docs via Context7 (`resolve-library-id` → `query-docs`) — all four vendors iterate fast and training-data memory of their APIs is likely stale. Context7 coverage of domestic SDKs varies; if a library isn't indexed, fall back to WebFetch on official docs. ## Env var contract (locked) All providers follow the same pattern. **Never hardcode keys.** Each is read from environment at module init; a missing key raises early. | Provider | Endpoint env | Key env | Default model env | |---|---|---|---| | DeepSeek | `DEEPSEEK_BASE_URL` (default `https://api.deepseek.com/v1`) | `DEEPSEEK_API_KEY` | `DEEPSEEK_MODEL` (e.g. `deepseek-...

Details

Author
pcliangx
Repository
pcliangx/AppGenesisForge
Created
3 months ago
Last Updated
1 weeks ago
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category