█

AI/TLDR

मुझे पिलाएं कॉफ़ी
मुझे एक कॉफ़ी पिलाएँ

Weave Router

हर request के लिए सही model चुनने वाला एक ही endpoint

Gateways & RoutingOpen core
ताज़ा
router-v0.2.24
अपडेट किया गया
24 सित॰ 2026
भाषा
Go
लाइसेंस
Apache-2.0 (from router-v0.2.24; earlier releases shipped under the Elastic License 2.0)
कवरेज
1 story
$npx @weave-os/router

नया क्या है

router-v0.2.2424 सित॰ 2026

The router moved from the Elastic License 2.0 to the Apache License 2.0, starting with router-v0.2.24 (npm @weave-os/router and @workweave/router 0.2.24). Earlier tags and packages keep the licenses they shipped with.

ताज़ा खबरें

संक्षेप में

Weave Router क्या है?

Weave Router हर request के लिए सही model चुनने वाला एक ही endpoint. यह Evaluation & Production Ops टूल्स की Gateways & Routing श्रेणी में आता है; ओपन सोर्स है, Go में लिखा गया है और Apache-2.0 (from router-v0.2.24; earlier releases shipped under the Elastic License 2.0) लाइसेंस के तहत है।

अपडेट किया गया Markdown वर्शन ↗

सारांश

Weave Router एक drop-in proxy है जो Anthropic Messages, OpenAI Chat Completions और Gemini native APIs को समझता है, जिसमें streaming, tools और vision भी शामिल हैं। आप Claude Code, Codex, opencode, pi, Cursor या अपने application को provider की जगह इसकी ओर point करते हैं, और यह हर अलग request पर तय करता है कि कौन सा model जवाब देगा, न कि पूरे session के लिए एक ही model चुनने देता है।

यह फ़ैसला एक cluster scorer लेता है, जो Avengers-Pro routing paper से लिया गया है और उसी box पर in-process ONNX embedder के रूप में चलता है, किसी दूसरे model से अंदाज़ा लगवाकर नहीं। प्रोजेक्ट की शब्दावली में यह per turn नहीं, per action रूटिंग करता है, इसलिए एक ही agent run में routine steps के लिए सस्ता model और कठिन steps के लिए frontier model, दोनों इस्तेमाल हो सकते हैं। Hosted providers के अलावा यह OpenRouter या किसी भी OpenAI-compatible endpoint के ज़रिए DeepSeek, Kimi, GLM, Qwen, Llama और Mistral जैसे open-weight models तक पहुँच सकता है। एक वैकल्पिक HMM policy sidecar router के साथ-साथ दूसरी strategy के रूप में चल सकता है।

Self-hosted deployment में router, scorer, Postgres और आपकी provider keys, सब आपकी machine पर रहते हैं, और BYOK keys storage में at rest encrypted रहती हैं; prompts router से सीधे configured provider तक जाते हैं, Weave तक कभी नहीं। Router OTLP traces emit करता है, bundled dashboard में routing decisions दिखाता है, और हर request के लिए per-request cost headers लौटाता है। Weave एक hosted router भी चलाता है, जिसे npm installer डिफ़ॉल्ट रूप से point करता है। यह code Workweave ने router-v0.2.24 release line (September 2026) से शुरू होकर Apache License 2.0 के तहत प्रकाशित किया है; उससे पहले के tags अपने साथ आए Elastic License 2.0 को ही रखते हैं।

यह क्या करता है

  • Avengers-Pro से लिए गए on-box cluster scorer द्वारा per-action रूटिंग, प्रॉम्प्ट-आधारित heuristic पर नहीं
  • Anthropic Messages, OpenAI Chat Completions और Gemini native को सपोर्ट करता है, streaming, tools और vision के साथ
  • OpenRouter या किसी भी OpenAI-compatible endpoint के ज़रिए open-weight models — DeepSeek, Kimi, GLM, Qwen, Llama, Mistral — तक पहुँचता है
  • डिफ़ॉल्ट रूप से Bring-your-own-key: provider keys आपकी machine पर रहती हैं और at rest encrypted होती हैं
  • /v1/route endpoint जो upstream को call किए बिना routing decision लौटाता है, साथ में per-session cost और savings, और raw routing decisions का NDJSON export
  • OTLP traces पहले से चालू हैं, जिन्हें built-in dashboard में देखा जा सकता है या Honeycomb, Datadog या Grafana में export किया जा सकता है
  • npm installer, जो Claude Code, Codex CLI, opencode या pi को user या project scope पर set up करता है, और terminal से on/off/status switches व model enable/disable की सुविधा देता है

शुरू करें

npm installer सबसे तेज़ तरीका है: बिना flags के यह hosted setup page खोलता है, और flags से client, scope या self-hosted router चुना जाता है। Self-hosting में router और dashboard आपकी अपनी machine पर boot होते हैं।

अपने agent को wire up करें

Node 18 या उससे नया version ज़रूरी है (Claude Code, opencode और pi के रास्तों के लिए jq भी चाहिए)। अकेला command hosted setup page खोलता है; flags सीधे terminal से install करते हैं। Project scope settings file को repo में commit करता है, और --local localhost:8080 पर चल रहे self-hosted router को target करता है।

bashbash
npx @weave-os/router
npx @weave-os/router --claude
npx @weave-os/router --codex
npx @weave-os/router --scope project
npx @weave-os/router --local

या stack को खुद self-host करें

किसी provider key को .env.local में डालें — OpenRouter की सिफ़ारिश बेसलाइन के रूप में है — और dashboard password सेट करें (उसके बिना inference तो चलता है, पर dashboard administration बंद रहता है)। फिर port 8080 पर Postgres और router चालू करें; setup एक rk_ router key बनाता है और उसे logs में प्रिंट करता है।

bashbash
echo "OPENROUTER_API_KEY=sk-or-v1-..." >> .env.local
echo "ROUTER_ADMIN_PASSWORD=replace-with-a-strong-password" >> .env.local
make full-setup

उसे अपने सामान्य provider की तरह call करें

वही endpoint Anthropic-shaped और OpenAI-shaped, दोनों तरह के requests का जवाब देता है; उसके पीछे model router चुनता है। Clients rk_ key को Bearer token के रूप में भेजते हैं — आपकी upstream provider key .env.local में ही रहती है।

bashbash
curl -sS http://localhost:8080/v1/messages \
  -H "Authorization: Bearer rk_..." \
  -d '{"model":"claude-sonnet-4-5","max_tokens":256,
       "messages":[{"role":"user","content":"hi"}]}'

curl -sS http://localhost:8080/v1/chat/completions \
  -H "Authorization: Bearer rk_..." \
  -d '{"model":"gpt-4o-mini",
       "messages":[{"role":"user","content":"hi"}]}'

Routing को जाँचें और toggle करें

Proxy किए बिना कोई routing decision देखें, http://localhost:8080/ui/ पर dashboard में traffic देखें, और router config खोए बिना किसी client को उसके सामान्य provider पर वापस ले जाएँ।

bashbash
curl -sS http://localhost:8080/v1/route -H "Authorization: Bearer rk_..." -d '...'

npx @weave-os/router off --claude
npx @weave-os/router status --claude
npx @weave-os/router models --claude

कमांड और कोड प्रोजेक्ट के अपने दस्तावेज़ों से लिए गए हैं — हमेशा जांचें आधिकारिक repo ताज़ा जानकारी के लिए।

कब इस्तेमाल करें

  • Routine steps को सस्ते model और सिर्फ़ कठिन steps को frontier model पर भेजकर agentic coding session की लागत घटाएँ
  • किसी team को एक ही endpoint दें जो कई providers के सामने खड़ा हो, ताकि model चुनाव हर developer की setting न होकर server-side policy बने
  • Application code बदले बिना एक ही API के पीछे hosted और open-weight models दोनों मिलाएँ
  • Bundled dashboard, analytics export या किसी मौजूदा OTLP backend से देखें कि किस request का जवाब किस model ने दिया, और किस लागत पर

वर्शन इतिहास

Every verified update to Weave Router that AI/TLDR tracked, newest first — each links to our coverage and the official changeset.

  1. 24 सित॰ 2026router-v0.2.24

    The router moved from the Elastic License 2.0 to the Apache License 2.0, starting with router-v0.2.24 (npm @weave-os/router and @workweave/router 0.2.24). Earlier tags and packages keep the licenses they shipped with.

  2. 27 जून 2026

    Weave open-sourced the router: a proxy for Claude Code, Codex and Cursor that scores each prompt with an on-box embedder and forwards it to the best model across Anthropic, OpenAI, Gemini and OpenRouter providers. The repository has since moved from workweave/router to weave-os/router, and the npm package from @workweave/router to @weave-os/router (the old name stays as a compatibility alias).

How Weave Router compares

Weave Router alongside other open-source gateways & routing tools AI/TLDR tracks, ranked by GitHub stars.

टूलस्टारयह क्या करता है
OmniRoute★ 91.8kसैकड़ों प्रोवाइडर को एक OpenAI-compatible endpoint के पीछे लाने वाला लोकल-फ़र्स्ट AI gateway
Free Claude Code★ 75.9kClaude Code और नौ अन्य एजेंट CLI को मुफ़्त, पेड या लोकल मॉडल प्रोवाइडर से जोड़ें
LiteLLM★ 64.4kएक OpenAI-compatible API के ज़रिए 100+ LLM प्रोवाइडर को कॉल करें
magpie★ 44.8kएक लोकल गेटवे और मेन्यू बार ऐप, जो हर coding agent के लिए कोई भी मॉडल चुनने देता है
Kong Gateway★ 44.4kAPI गेटवे जो आपके LLM और MCP ट्रैफ़िक को भी संभालता है
9Router★ 33.1kकोडिंग CLI के लिए लोकल राउटर, जिसमें quota ट्रैकिंग, tiered fallback और token compression शामिल है
Experiential★ 20.6kहोस्टेड, BYOK, लोकल और कस्टम मॉडल्स के लिए एक OpenAI-compatible control plane
Weave Router★ 5.7kहर request के लिए सही model चुनने वाला एक ही endpoint