PraisonAI icon indicating copy to clipboard operation
PraisonAI copied to clipboard

Provider suggestion: AnyLLM gateway — fill the Chinese model tier for PraisonAI's cost router (Qwen, GLM, MiniMax + DeepSeek, Kimi)

Open JetragonRider opened this issue 3 months ago • 7 comments

PraisonAI's built-in model router auto-routes to the cheapest available model — a great cost feature. But routing only saves money if the pool has genuinely cost-efficient options. Right now the provider list includes DeepSeek and Moonshot examples, but not Qwen, GLM, Kimi, or MiniMax — the rest of the Chinese frontier tier that typically costs a fraction of GPT pricing.

I built AnyLLM, an OpenAI-compatible API gateway with 24+ Chinese and international models behind a single key: DeepSeek V4, Qwen3.7-Plus, GLM-5.2, Kimi K2.5, MiniMax M3 — alongside GPT-5 and Gemini. International cards and crypto accepted, pass-through pricing with zero markup, built-in routing and failover.

Why this fits PraisonAI Works today, zero integration. PraisonAI already supports any OpenAI-compatible endpoint via OPENAI_BASE_URL — AnyLLM needs just that plus one key. No new provider adapter required.

Feeds the cost router. Reflection loops, deep research, and doom-loop retries are token multipliers. With AnyLLM, the router gets a full cheap tier to route to — plus GPT-5 and Gemini in the same connection for reasoning-heavy agents.

One key instead of five signups. Each Chinese provider requires a Chinese phone number and Alipay for direct signup — a hard blocker for international users. AnyLLM removes all of it.

GLM-5.2's 2M-token context is useful for knowledge=["docs/"] RAG workflows and long-context research tasks where chunking hurts.

Proposal 1.A docs example or provider entry: "Using an OpenAI-compatible gateway (AnyLLM)" — following the same pattern as your DeepSeek/Moonshot examples. 2.Happy to open a PR with the example code, or provide a sandbox key if you'd like to test the router against Chinese model pricing first. (Context: I'm the developer of AnyLLM.)

Best, Leo Bennett [email protected]

JetragonRider avatar Aug 17 '26 12:08 JetragonRider

👋 Thanks for opening this issue, @JetragonRider!

A maintainer will review this shortly. In the meantime:

Bug and enhancement reports are auto-triaged with Claude. Questions and other issues: a maintainer can comment @claude to trigger analysis.

Routing: Agent-callable tools → PraisonAI-Tools; lifecycle plugins (tracing/hooks/guardrails) → PraisonAI-Plugins.

I verified that current main already supports this gateway through the existing OpenAI-compatible OPENAI_BASE_URL path, so no provider adapter or dependency is needed. The remaining decision is whether PraisonAI wants a vendor-specific documentation entry for a paid third-party service.

Would maintainers prefer (A) an AnyLLM-specific example, which improves discoverability but implies an endorsement and ongoing vendor-specific maintenance; (B) a provider-neutral OpenAI-compatible gateway example, which documents the same capability without naming a vendor; or (C) no new documentation because the generic endpoint support is already sufficient?

I would keep any follow-up docs-only and avoid adding a dependency, provider adapter, API surface, or test credential.

dajiaohuang avatar Aug 18 '26 20:08 dajiaohuang

@caude use multi agents to evaluate and then respond accordingly

MervinPraison avatar Aug 19 '26 18:08 MervinPraison

@claude use multi agents to evaluate and then respond accordingly

MervinPraison avatar Aug 19 '26 18:08 MervinPraison

Claude finished @MervinPraison's task —— View job


Multi-agent evaluation — provider suggestion (AnyLLM gateway)

  • [x] Read AGENTS.md architecture rules
  • [x] Verify OpenAI-compatible / base_url support in codebase
  • [x] Inspect the cost/model router
  • [x] Multi-agent evaluation (architecture, scope, docs, vendor-neutrality)
  • [x] Decide & respond

I evaluated this from four perspectives. Summary: no SDK/code change is warranted; this is docs-only, and it should be provider-neutral (option B), not a vendor-specific entry.


🏛️ Architecture agent

  • Any OpenAI-compatible gateway already works today. LLM accepts a base_url param and honors OPENAI_BASE_URL / OPENAI_API_BASE — see src/praisonai-agents/praisonaiagents/llm/llm.py:423,570,626. No provider adapter, dependency, or new API surface is needed.
  • @dajiaohuang's verification is correct.

🧮 Cost-router agent

  • The router (praisonaiagents/llm/model_router.py) already accepts custom ModelProfiles via ModelRouter(models=[...]) and preferred_providers=[...], then sorts by cost_per_1k_tokens. Users can add Qwen/GLM/Kimi/MiniMax (or any endpoint) themselves without touching core.
  • The DEFAULT_MODELS list is an illustrative default, not a registry of endorsed providers. Baking a specific paid vendor's models/prices into it would create a maintenance liability (prices/models change) and imply endorsement — rejected as scope creep per AGENTS.md ("do not add … that merely duplicate existing behaviour").

📚 Docs agent

  • The genuinely useful, framework-appropriate output is a provider-neutral "Using an OpenAI-compatible gateway" guide (set base_url + one key; optionally feed custom ModelProfiles to the router). This documents an existing capability without naming or endorsing any single paid vendor. Docs live in the external PraisonAIDocs repo.

🔒 Vendor-neutrality / security agent

  • The request comes from the gateway's own developer and asks for a named-vendor entry ("sandbox key", pricing claims). Naming one commercial gateway in first-party docs is an implicit endorsement and invites parity requests from every other gateway. Keep first-party docs vendor-neutral.

Decision → Option B (provider-neutral), scoped to docs only

  • ❌ No changes to praisonaiagents / praisonai — capability already exists.
  • ❌ No AnyLLM-specific entry in DEFAULT_MODELS or a vendor-named docs page.
  • ✅ A provider-neutral "OpenAI-compatible gateway" guide is a reasonable docs addition (external PraisonAIDocs repo), showing base_url+key and how to register custom ModelProfiles with the cost router.

@JetragonRider — you can use AnyLLM with PraisonAI today: set OPENAI_BASE_URL to your gateway and pass your key, then optionally register your models with ModelRouter(models=[...]) for cost routing. A PR is welcome only if it's a vendor-neutral example (no brand names, pricing, or endorsements in first-party materials).

No code changes were made in this repo, by design. • branch claude/issue-4015-20260819-1851

I'd like to work on the approved provider-neutral documentation follow-up.

Scope:

  • Add a provider-neutral OpenAI-compatible gateway example to PraisonAIDocs
  • Show custom base_url and environment-based API key configuration
  • Show custom ModelProfile registration with ModelRouter
  • Use placeholder model names, endpoints, and pricing
  • No vendor names, provider adapter, dependency, or SDK API changes

@JetragonRider, please let me know if you have already started working on this so we can avoid duplicating effort. Otherwise, I will prepare the docs PR.

Terminator666666 avatar Aug 20 '26 08:08 Terminator666666

I verified that current main already supports this gateway through the existing OpenAI-compatible OPENAI_BASE_URL path, so no provider adapter or dependency is needed. The remaining decision is whether PraisonAI wants a vendor-specific documentation entry for a paid third-party service.

Would maintainers prefer (A) an AnyLLM-specific example, which improves discoverability but implies an endorsement and ongoing vendor-specific maintenance; (B) a provider-neutral OpenAI-compatible gateway example, which documents the same capability without naming a vendor; or (C) no new documentation because the generic endpoint support is already sufficient?

I would keep any follow-up docs-only and avoid adding a dependency, provider adapter, API surface, or test credential.

Our product will launch in early September. Feel free to add me on Discord — my username is playful_moose_03466 — so we can discuss further.

JetragonRider avatar Aug 24 '26 11:08 JetragonRider