embabel-agent icon indicating copy to clipboard operation
embabel-agent copied to clipboard

Provider suggestion: AnyLLM gateway — one key for the Chinese models Embabel already supports (Z.ai, MiniMax, DeepSeek, DashScope)

Open JetragonRider opened this issue 3 months ago • 24 comments

Embabel already integrates the major Chinese providers — Z.ai (GLM-5.2), MiniMax, DeepSeek, DashScope — which puts it ahead of most JVM frameworks. The catch is signup: each of those providers requires a Chinese phone number and Alipay for direct registration, and the Spring/JVM community is largely enterprise developers outside China. There's a gap between "the framework supports the provider" and "the user can actually get a key".

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 Embabel Same wire protocol you already speak. Embabel talks to DeepSeek, Mistral, Gemini, and Atlas Cloud over the OpenAI-compatible protocol — AnyLLM needs nothing new: a base URL and one key, following the exact same pattern. Aligns with the new BYOK credential factory. #1942 just added CredentialLlmServiceFactory for per-user keys — AnyLLM slots in as one more credential-backed option that covers the entire Chinese tier plus GPT-5 and Gemini under a single connection. GOAP replanning is token-heavy. Dynamic replanning after every action means many LLM calls per goal. Chinese models at pass-through pricing make long autonomous runs affordable — and Embabel's action-scoped model choice lets developers assign cost-efficient models to simple actions, frontier models to reasoning-heavy ones. One signup instead of four. Z.ai + MiniMax + DeepSeek + DashScope = four registrations with phone/Alipay barriers each. AnyLLM collapses them into one, and adds Kimi and GPT-5/Gemini in the same key. Proposal A short docs section: "Using an OpenAI-compatible gateway (AnyLLM)" — showing the environment-variable config for JVM users. Happy to open a PR, or provide a sandbox key for the team to test.

(Context: I'm the developer of AnyLLM.)

Best, Leo Bennett [email protected]

JetragonRider avatar Aug 18 '26 12:08 JetragonRider

@JetragonRider - Hello Leo, thank you for contributing.
Is this correct URL: https://apps.microsoft.com/detail/9ns6bx73pw1c?hl=en-US&gl=US

Planning to use com/embabel/agent/openai/OpenAiCompatibleModelFactory.kt?

Re: " One signup instead of four. Z.ai + MiniMax + DeepSeek + DashScope = four registrations with phone/Alipay barriers each. AnyLLM collapses them into one, and adds Kimi and GPT-5/Gemini in the same key." - how would developer differentiate providers? Thanks

igordayen avatar Aug 18 '26 19:08 igordayen

@JetragonRider - could you please update, thank you

igordayen avatar Aug 19 '26 15:08 igordayen

@JetragonRider - Hello Leo, could you please update? Thank you

igordayen avatar Aug 20 '26 14:08 igordayen

@JetragonRider - Hello, could you please provide an update on the inquiry? Would you be ready to deliver for the upcoming release 1.5.2? thank you

igordayen avatar Aug 22 '26 15:08 igordayen

@JetragonRider - Hello, could you please provide an update on the inquiry? Would you be ready to deliver for the upcoming release 1.5.2? thank you

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

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 - I tried to send a message, but you may not be subscribed to the Embabel Discord channels. Here is my Discord ID: igordayen. thank you

igordayen avatar Aug 24 '26 16:08 igordayen

@JetragonRider - tentatively, assigning milestone 1.5.3, as 1.5.2 starting tomorrow. Please connect with me (igordayen) on Discord. Thanks

igordayen avatar Aug 24 '26 17:08 igordayen

@JetragonRider - How are you? Could you please provide an update on your product status so we can plan the release accordingly? Thank you

igordayen avatar Sep 05 '26 00:09 igordayen

@JetragonRider - How are you? Are you still planning to work on this issue? it is scheduled for the current release. Thank you

igordayen avatar Sep 16 '26 13:09 igordayen

Same pain point here for JVM teams outside China: framework support ≠ key access when each upstream wants a mainland phone / Alipay path.

Another option in the same OpenAI-compatible shape (base URL + one key) is PowerTokens — unified access to Qwen / GLM / MiniMax / DeepSeek-class models without a mainland China account. Docs: https://docs.powertokens.ai/?utm_source=github&utm_medium=issue&utm_campaign=embabel-agent&utm_content=1947

Happy to help if useful for BYOK credential factory testing.

PowerTokens avatar Sep 18 '26 05:09 PowerTokens

Same pain point here for JVM teams outside China: framework support ≠ key access when each upstream wants a mainland phone / Alipay path.

Another option in the same OpenAI-compatible shape (base URL + one key) is PowerTokens — unified access to Qwen / GLM / MiniMax / DeepSeek-class models without a mainland China account. Docs: https://docs.powertokens.ai/?utm_source=github&utm_medium=issue&utm_campaign=embabel-agent&utm_content=1947

Happy to help if useful for BYOK credential factory testing.

PowerTokens avatar Sep 18 '26 06:09 PowerTokens

@PowerTokens @JetragonRider

Appears to have drastically different approaches:

AnyLLM (both the Mozilla.ai and PyPI versions) is an open-source Python library you install and run in your own code. It gives you one interface to call OpenAI, Anthropic, Ollama, HuggingFace, etc., and you supply your own API keys directly to those providers (or run local models via Ollama/llama.cpp with no key at all). There's no separate billing — you pay each provider directly, or nothing if running locally.

PowerTokens, by contrast, is a hosted platform, not a library: it gives you a unified API for generative AI applications, letting you call chat, image, video, and audio models from one platform, then manage credits, API keys, request logs, and usage stats from a dashboard. You don't hold provider-specific API keys — you fund a PowerTokens account with credits and PowerTokens deducts credits based on model usage when you call api.powertokens.ai. It supports sign-in via Google, GitHub, or email, and accepts credit card or PayPal for adding credits.

Thanks

igordayen avatar Sep 18 '26 14:09 igordayen

@JetragonRider - not able to reach you on Discord. Please advise whether you would like to descope from release 1.5.3. Thank you

igordayen avatar Sep 19 '26 00:09 igordayen

Two quick notes, then something the team can verify in two minutes.

The framing you arrived at is right: Embabel already speaks the OpenAI-compatible wire protocol, and #1942 put CredentialLlmServiceFactory into starter-byok, so adding another provider is a config entry rather than an integration project. The barrier sits upstream — Z.ai, MiniMax, DeepSeek and DashScope each require a mainland phone number and Alipay to register, and the Spring/JVM audience is largely outside China.

TideLink (https://tidelink.xyz/?cid=github-embabel) is an OpenAI-compatible gateway for the Chinese frontier models — GLM, Qwen, DeepSeek, Hunyuan, Doubao — behind one key. Two properties matter for this audience specifically:

1. A permanent free tier, no card required. glm-4.7-flash and glm-4.6v-flash are free indefinitely. A developer can wire Embabel to the gateway and run a full GOAP replanning loop end-to-end before deciding to pay anything. There is no trial clock to race.

2. BYOK at a flat 7.5% platform fee. Teams that already hold upstream credentials bring them and pay the platform fee rather than retail token rates. This is relevant because GOAP replanning is token-heavy by design — the cost concern raised earlier in this thread.

Payments are international cards (Dodo) or USDT; no mainland payment rail is involved.

Live key, verifiable immediately:

Base URL: https://tidelink.xyz/v1
API key:  sk_845e11c0ebdca7e2fa554152fe68449f
Model:    glm-4.7-flash

That key works right now for the free-tier models. Two honest caveats: it is limited to 5 requests/minute (the real limit every free-tier account gets — not an artificial sandbox cap), and it cannot reach paid models until an email is verified, which is by design. If a paid-tier evaluation would help, say so and I will issue a key with credit on it.

What I will deliver, not just propose:

  • A docs section — "Using an OpenAI-compatible gateway (TideLink)" — with the environment-variable configuration for JVM users, following the existing provider pattern.
  • The PR itself, opened against starter-byok/docs, with replies in this thread.
  • Work to whatever milestone you assign.

On scale, plainly: TideLink is a small independent service, not a corporate vendor. What I can commit to is response time and a PR that actually lands.

Context: I maintain TideLink — https://github.com/tidelink88/tidelink-opensource

— TideLink · [email protected]

tidelink88 avatar Sep 20 '26 05:09 tidelink88

@tidelink88 - thank you.

Summarizing architectural choices:

  • Use the existing OpenAI-compatible Factory

    • TideLink is just another baseUrl + apiKey + modelName.
    • No new Embabel abstraction.
    • This is the simplest answer if TideLink behaves like OpenAI.
    • Example: same factory, different URL.
  • Add a new OpenAI-compatible Factory instance/config

    • Still uses the same OpenAI-compatible mechanism.
    • But TideLink can have its own named configuration/profile.
    • Useful if users want tidelink as a named provider.
  • Make Embabel gateway-aware

    • Embabel recognizes that some OpenAI-compatible endpoints are gateways, not model providers.
    • It can pass gateway-useful metadata: agent name, process ID, tenant, user, role, trace ID.
    • Good for Agentgateway, LiteLLM, TideLink, OpenRouter, etc.
    • This should be generic, not TideLink-specific.
    • See https://aaif.io/projects/agentgateway
  • Put TideLink behind another gateway

    • Embabel talks to Agentgateway or an enterprise gateway.
    • That gateway uses TideLink as one upstream backend.
    • Best for production governance: routing, budgets, observability, failover, policies.

Perhaps explore how to Open AI Compatible Factory can model https://aaif.io/projects/agentgateway — would be, in my opinion, an architecturally appealing direction.

This would include task you suggested above:

"A docs section — "Using an OpenAI-compatible gateway (TideLink)" — with the environment-variable configuration for JVM users, following the existing provider pattern. ".

I would track it as a separate issue.

Link: https://github.com/embabel/embabel-agent/discussions/2026

Thanks

igordayen avatar Sep 20 '26 15:09 igordayen

@igordayen Thanks — your AnyLLM vs PowerTokens framing is right.

AnyLLM (library) = run in-process / self-host, you still bring provider keys (or local models).
PowerTokens (hosted gateway) = one OpenAI-compatible baseUrl + one key + modelName, aimed at teams that need China-origin model families without each upstream’s mainland signup path.

That maps cleanly onto the simplest option in your summary: reuse the existing OpenAI-compatible Factory / BYOK credential path — same wire protocol Embabel already speaks; no new abstraction required. The remaining gap is still “framework supports the protocol ≠ overseas users can actually obtain the upstream keys.”

Docs if useful for a smoke test: https://docs.powertokens.ai/?utm_source=github&utm_medium=issue&utm_campaign=embabel-agent&utm_content=1947

Happy to answer any JVM/BYOK wiring questions while you sort the gateway-docs track.

PowerTokens avatar Sep 21 '26 03:09 PowerTokens

@igordayen thanks — that's a clear map, and option 1 is exactly right: no new Embabel abstraction, TideLink is just another baseUrl + apiKey + modelName.

Here's the env-var shape for the docs section, following the existing OpenAI-compatible provider pattern:

OPENAI_BASE_URL=https://tidelink.xyz/v1
OPENAI_API_KEY=<your TideLink key>
# model id, e.g. deepseek-v4.1-flash  (or glm-4.7-flash / qwen-plus)

That is the whole integration — same Factory, different URL. No Embabel-side change.

Three points that might be worth a line in the write-up, all verifiable:

  • Why it exists: signup is email-only — no +86 phone number, no mainland real-name/ID. Several of the upstreams this routes (Z.ai, DashScope/Qwen, MiniMax, DeepSeek) require exactly that at their own signup, which is the real wall for developers outside mainland China.
  • No silent substitution: if a model id isn't available on the selected upstream you get an explicit error, not a quiet downgrade to some other model. So "what you configure is what you call" holds.
  • Optional: for users on Claude Code / Cline / opencode we also expose an Anthropic-compatible /v1/messages path — that one runs against your own Anthropic key (we handle routing/billing), so it's a separate story from the Chinese-model routing.

On option 3 (gateway-aware): no objection at all. If Embabel wants to pass gateway-useful metadata (agent name, trace id, tenant), we're happy to carry it through once that shape settles — and generic is the right call, since a TideLink-specific special case would be worse for everyone.

If it's easier, I'm glad to open the docs PR myself following the existing provider directory — but that's your call, and either way the env-var block above is the entire config.

Thanks again for the quick turnaround.

tidelink88 avatar Sep 21 '26 05:09 tidelink88

One correction to my own note above, because accuracy matters more than polish if any of it goes in the docs:

I said model ids are never silently substituted. That holds for paid models, but it isn't quite right for the free tier. glm-4.7-flash is the intended current-generation free model (200K context, officially free), but when the upstream free pool is saturated the gateway falls back to a stable free model (glm-4-flash) instead of erroring — so a free-tier caller can receive the fallback.

The honest phrasing is: paid model ids are exact; on the free tier, the model field in the response tells you which upstream model actually served the request. A reader can verify that in a single call, so that is the version worth writing down.

Everything else in my note stands. Sorry for the noise — I'd rather correct it than have you document something a reader can falsify in thirty seconds.

tidelink88 avatar Sep 21 '26 06:09 tidelink88

@PowerTokens - thank you. Could you please: outline the artifacts involved as part of the design, including capturing rate limits and retry options. Upon reviewing the design (please include package structure as needed), the next step would be to create a new issue and retire the existing one as "inactive".

Thank you

igordayen avatar Sep 22 '26 15:09 igordayen

@PowerTokens - thank you. Could you please: outline the artifacts involved as part of the design, including capturing rate limits and retry options. Upon reviewing the design (please include package structure as needed), the next step would be to create a new issue and retire the existing one as "inactive".

Thank you

@igordayen Thanks — happy to outline a minimal design that fits Embabel’s existing OpenAI-compatible Factory / BYOK path (no new abstraction required).

Goal Let Embabel users call China-origin model families through PowerTokens with baseUrl + apiKey + modelName. Same wire protocol Embabel already speaks.

Suggested config shape

# host (docs / OpenAPI)
baseUrl: https://api.powertokens.ai

# OpenAI-compatible Factory / SDK / BYOK (append /chat/completions)
# https://api.powertokens.ai/v1

apiKey:  <POWERTOKENS_API_KEY>
model:   MiniMax-M3 | qwen3-max | glm-5.2 | deepseek-v4-flash | …  # from live catalog
  • Auth: Authorization: Bearer <apiKey>
  • Chat path: POST /v1/chat/completions
  • Model ids: from the live catalog — avoid hardcoding retired ids
  • If the Factory already appends /v1, use the host only; if it appends /chat/completions, use https://api.powertokens.ai/v1

Rate limits & retry Reuse Embabel’s existing OpenAI-compatible retry/backoff. HTTP 429 may mean throttle or exhausted Credits (insufficient_user_quota) — do not retry the latter. Honor Retry-After when present. Dashboard controls are key-level Credits caps (optional daily/weekly/monthly reset, UTC), not a separate RPM/TPM API.

Package / module structure

  • MVP: no new module. Reuse OpenAiCompatibleModelFactory / BYOK credential factory.
  • Docs-only: a PowerTokens section on the existing OpenAI-compatible / gateway page.
  • Later named preset (optional): config key powertokens → same factory, default host https://api.powertokens.ai. Still no separate HTTP client.

Smoke test

  1. Create a key → POST /v1/chat/completions with one catalog text model (e.g. MiniMax-M3).
  2. Confirm the model in the response matches the catalog id.
  3. Bad key → 401.
  4. Empty-credits / capped key → 429 insufficient_user_quota and no endless retry.

Happy to provide a sandbox key if you want to run this against starter-byok.

Non-goals for this issue

  • Embedding PowerTokens billing UI into Embabel
  • Per-upstream SDKs (Z.ai / DashScope / etc.)
  • Gateway-aware metadata beyond standard OpenAI-compatible headers (follow-up)

References

  • Docs: https://docs.powertokens.ai/?utm_source=github&utm_medium=issue&utm_campaign=embabel-agent&utm_content=1947
  • API call guide: https://docs.powertokens.ai/en/guides/api-key-and-model-call?utm_source=github&utm_medium=issue&utm_campaign=embabel-agent&utm_content=1947
  • Model catalog: https://www.powertokens.ai/en/models?utm_source=github&utm_medium=issue&utm_campaign=embabel-agent&utm_content=1947

If this outline looks right, we’ll wait for the new issue and refine the acceptance criteria there.

PowerTokens avatar Sep 23 '26 09:09 PowerTokens