feat(provider): add Nexforce Router - #3498
Open
fernandovitti wants to merge 1 commit into
Open
Conversation
Contributor
|
@fernandovitti is attempting to deploy a commit to the Different AI Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Value proposition
This PR adds Nexforce Router — Latin America's largest AI inference router — so OpenWork users get one API key that reaches Anthropic, OpenAI, Google, DeepSeek, Moonshot, Zhipu, and Cloudflare Workers AI, with automatic fallback and per-key cost control.
OpenWork already supports any OpenAI-compatible provider via config (base URL + key). Nexforce Router is exactly that shape, so the integration is a turnkey catalog entry: point OpenWork at
https://router.nexforce.ai/v1, drop in yourNEXFORCE_API_KEY, and every routed model appears in the model picker — includingnexforce/smart-route, which lets the router pick an equivalent model per request while preserving required capabilities.Regional differentiator
Nexforce Router is built for Latin America. Billing and compliance are handled locally for each country in the region: invoicing, taxes, and payment infrastructure are managed in-country, so teams get compliant, locally-issued invoices without the FX and foreign-procurement friction of paying an overseas provider. Cost control is per API key — fallback chains, rate limits, and spend caps configured per key, with
X-Nexforce-Requested-Model/X-Nexforce-Served-Modelresponse headers disclosing exactly which model answered and what it cost.What changed
packages/docs/cloud/share-with-your-team/custom-llm-provider.mdx— new "Functional example: Nexforce Router" section with a ready-to-paste provider definition (mirrors the existing Infron gateway example).packages/docs/start-here/connect-your-stack/add-a-custom-llm.mdx— desktop config example for solo use:nexforceprovider block with@ai-sdk/openai-compatible, base URL, andNEXFORCE_API_KEY.apps/app/src/react-app/design-system/provider-logo-src.ts— brand logo catalog entry so the Nexforce Router mark resolves in the model picker instead of falling back to a monogram.How to configure
Set the env var:
export NEXFORCE_API_KEY=nfc_...Then add the provider to your workspace
opencode.json:{ "provider": { "nexforce": { "npm": "@ai-sdk/openai-compatible", "name": "Nexforce Router", "options": { "baseURL": "https://router.nexforce.ai/v1", "apiKey": "{env:NEXFORCE_API_KEY}" }, "models": { "nexforce/smart-route": { "name": "Nexforce Smart Route" }, "anthropic/claude-sonnet-4-6": { "name": "Claude Sonnet 4.6" }, "deepseek/deepseek-v4-flash": { "name": "DeepSeek V4 Flash" } } } } }Grab a key at https://marketplace.nexforce.ai/workspace/ai-gateway/ai-gateway-keys
Verification done
/v1/modelslisting:GET https://router.nexforce.ai/v1/models(public, no key) returned the full catalog (139 models across Anthropic, OpenAI, Google, DeepSeek, Moonshot, Zhipu, and Cloudflare Workers AI).deepseek/deepseek-v4-flash: HTTP 200 with a real completion, confirmingX-Nexforce-Requested-Model: deepseek/deepseek-v4-flashandX-Nexforce-Served-Model: deepseek-v4-flashtransparency headers.finish_reason: tool_callswith valid arguments, confirming agentic/tool-calling support.opencode.jsoncontaining the documentednexforceprovider block, the real OpenCode engine listed all six configured Nexforce models (opencode models).pnpm --filter @openwork/app typecheckpasses.apps/appunit tests usebun test, andbunis not available in this environment, so theprovider-icontest could not be executed here; the one-line logo-map change is covered by app typecheck. Docs changes carry no test harness. Please runpnpm --filter @openwork/app testin CI.