Skip to content

feat(llm): add OrcaRouter as a named LLM provider - #6687

Open
Marc-oss-hub wants to merge 1 commit into
koala73:mainfrom
Marc-oss-hub:main
Open

feat(llm): add OrcaRouter as a named LLM provider#6687
Marc-oss-hub wants to merge 1 commit into
koala73:mainfrom
Marc-oss-hub:main

Conversation

@Marc-oss-hub

Copy link
Copy Markdown

Summary

Adds OrcaRouter as a named LLM provider across the server LLM client and the client-side summarization chain, mirroring how OpenRouter is wired today.

OrcaRouter is an OpenAI-compatible model routing gateway that exposes 150+ provider-scoped models (e.g. deepseek/deepseek-v4-flash, openai/gpt-4o-mini, anthropic/claude-opus-4.8) behind a single endpoint and API key. It also runs gateway-level, zero-trust security for AI agents on the same endpoint — screening every prompt/response and governing every tool call on a default-deny basis, with no application code changes.

Because the provider is a thin base-URL + key swap, users who set ORCAROUTER_API_KEY get a fully named provider in the existing chain; users who don't are completely unaffected (the provider is skipped, exactly like Groq/OpenRouter are today when their key is absent).

Type of change

  • New feature

Affected areas

  • AI Insights / World Brief
  • Config / Settings
  • Other: server-side LLM client + scripts LLM chain

What this changes

  • server/_shared/llm.ts: adds orcarouter to the LlmProviderName union and getProviderCredentials() (base URL https://api.orcarouter.ai/v1/chat/completions, auth via ORCAROUTER_API_KEY, default model deepseek/deepseek-v4-flash). Registered in PROVIDER_SET as an optional provider so LLM_TOOL_PROVIDER=orcarouter, LLM_REASONING_PROVIDER=orcarouter and the FORECAST_LLM_*_PROVIDER_ORDER envs accept it — but it is deliberately not added to the default PROVIDER_CHAIN, so default routing (including the China-hosted-provider exclusion from feat(llm): never serve OpenRouter inference from China-hosted providers #4993) is unchanged unless the user opts in.
  • server/_shared/llm-health.ts: warms the health cache for api.orcarouter.ai when ORCAROUTER_API_KEY is set.
  • server/worldmonitor/news/v1/summarize-article.ts: adds orcarouter to the provider skipReasons map.
  • scripts/lib/llm-chain.cjs: adds an orcarouter entry to LLM_PROVIDERS (inert without the key).
  • src/services/summarization.ts: adds an OrcaRouter entry to the client API_PROVIDERS chain, right after OpenRouter.
  • src/services/summarization-outcome.ts: extends AttemptedSummarizationProvider with 'orcarouter'.
  • src/services/runtime-config.ts: adds ORCAROUTER_API_KEY to RuntimeSecretKey and an aiOrcaRouter feature to RuntimeFeatureId / RUNTIME_FEATURES.
  • src/services/settings-constants.ts: adds the OrcaRouter sign-up URL, human label, and the aiOrcaRouter feature to the AI settings category.
  • src/services/desktop-readiness.ts: counts aiOrcaRouter among the key-backed AI features and the summaries readiness check.
  • .env.example + README.md: document ORCAROUTER_API_KEY and the provider.
  • tests/: provider credential + chain coverage for orcarouter.

How to use it

  1. Get a key at https://www.orcarouter.ai (keys start with sk-orca-).
  2. Set ORCAROUTER_API_KEY in your environment or the settings vault.
  3. Either leave it as an available fallback in the summarization chain, or pin it explicitly: LLM_TOOL_PROVIDER=orcarouter, LLM_REASONING_PROVIDER=orcarouter, or FORECAST_LLM_COMBINED_PROVIDER_ORDER=orcarouter.

Verification

  • npm run typecheck — clean
  • Targeted tests for the LLM client / summarization chain — pass
  • L3 live check against https://api.orcarouter.ai/v1/chat/completions with a real key: 200 + valid completion.

I'm an engineer on the OrcaRouter team.

Adds OrcaRouter (https://www.orcarouter.ai) as a first-class named
provider across the shared LLM client and the client-side
summarization chain, mirroring the existing OpenRouter wiring:

- server/_shared/llm.ts: 'orcarouter' in the LlmProviderName union and
  getProviderCredentials (base URL https://api.orcarouter.ai/v1/chat/completions,
  ORCAROUTER_API_KEY, default deepseek/deepseek-v4-flash). Registered in
  PROVIDER_SET as an optional provider so LLM_TOOL_PROVIDER /
  LLM_REASONING_PROVIDER / FORECAST_LLM_*_PROVIDER_ORDER accept it, but
  deliberately NOT added to the default PROVIDER_CHAIN — default routing
  (China-hosted-provider exclusion koala73#4993, DeepSeek-V4-Flash pin koala73#4944)
  is unchanged unless the user opts in.
- server/_shared/llm-health.ts: warm the health cache for the gateway.
- server/worldmonitor/news/v1/summarize-article.ts: orcarouter skip reason.
- scripts/lib/llm-chain.cjs: orcarouter entry in LLM_PROVIDERS.
- src/services: aiOrcaRouter feature + ORCAROUTER_API_KEY secret in
  runtime-config, settings-constants (signup URL / label / AI category),
  summarization-outcome union, summarization API_PROVIDERS chain slot
  (opt-in: no-op without the server key), desktop-readiness.
- .env.example + README: document ORCAROUTER_API_KEY.
- tests: provider credential + chain coverage for orcarouter.

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 14, 2026

Copy link
Copy Markdown

@Marc-oss-hub is attempting to deploy a commit to the World Monitor Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the trust:caution Brin: contributor trust score caution label Aug 14, 2026

@koala73 koala73 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review (not ready to merge yet)

GitHub reports CONFLICTING against current main (LLM / forecast provider tables have moved). Please rebase.

Implementation direction looks right once it applies cleanly: OrcaRouter is opt-in (ORCAROUTER_API_KEY), not in the default PROVIDER_CHAIN, so it does not bypass the OpenRouter China-provider exclusion. User-Agent is still applied at the callLlm fetch site like the other named providers.

After rebase, re-run tests/shared-llm.test.mts and any forecast-provider table tests that now include extra named providers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

trust:caution Brin: contributor trust score caution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants