gateway: add inference provider abstraction with MiniMax path - #68
Open
octo-patch wants to merge 1 commit into
Open
gateway: add inference provider abstraction with MiniMax path#68octo-patch wants to merge 1 commit into
octo-patch wants to merge 1 commit into
Conversation
Introduce a provider registry so the managed-agent client can route to an Anthropic-compatible endpoint. Adds MiniMax (MiniMax-M3, global_en/cn_zh regional base URLs) alongside the existing default provider, selected via INFERENCE_PROVIDER/PROVIDER_REGION. Default behaviour is unchanged.
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.
Reason: The gateway hard-wires a single bare inference client and model, so there is no abstraction to route the agent through the MiniMax provider.
What changed
gateway/src/providers.ts: a small inference-provider registry. Each entry declares its default model, API-key environment variable, and any regional Anthropic-compatible base URLs. The existing default provider and MiniMax are registered.gateway/src/config.ts: resolve the provider fromINFERENCE_PROVIDER(default preserves today's behaviour) andPROVIDER_REGION, and expose the resolved base URL, API-key env name, and a provider-aware default forAGENT_MODEL. Warns when the selected provider's API key is missing.gateway/src/cma.ts: build the shared client with the resolved base URL and API key so the same@anthropic-ai/sdkclient reaches the selected provider's endpoint. When no override is set the client behaves exactly as before.gateway/.env.example: documentINFERENCE_PROVIDER,PROVIDER_REGION, andMINIMAX_API_KEY.MiniMax exposes an Anthropic-compatible endpoint, so it is reached through the existing client by overriding
baseURL— no second SDK is added. Selectingminimaxdefaults the model toMiniMax-M3and targetshttps://api.minimax.io/anthropic(global) orhttps://api.minimaxi.com/anthropic(cn_zh).Checks
npm cinpm run typecheck(tsc --noEmit) — passesminimaxresolves toMiniMax-M3with the global endpoint,cn_zhresolves to the regional endpoint, and unknown provider/region values fall back with a warning.