메뉴
HN
Hacker News 32일 전

클로드·커서에 적용하는 스마트 AI 모델 라우터

IMP
8/10
핵심 요약

Weave가 각 요청에 맞는 최적의 AI 모델을 자동으로 선택해 주는 프록시 라우터를 공개했습니다. 개발자들은 이제 단일 엔드포인트만 연결하면 클로드 코드(Claude Code), 커서(Cursor), 코덱스(Codex) 등에서 Anthropic, OpenAI, 오픈소스 모델까지 원활하게 사용할 수 있습니다. 자체 호스팅도 지원하며 API 키는 안전하게 암호화되어 보안성과 확장성을 모두 챙긴 것이 특징입니다.

번역된 본문

하나의 엔드포인트로 모든 모델을 사용하세요. 항상 최적의 모델을 선택합니다. Anthropic, OpenAI, Gemini를 위한 간편 교체형 프록시(Drop-in proxy)로, 단순한 프롬프트 추측이 아닌 기기 내장형 경량 임베더를 사용하여 모든 요청에 가장 적합한 모델을 선택합니다.

🥇 RouterArena 리더보드 1위 — Acc-Cost Arena 76.09. Robinhood, PostHog, Reducto 및 수백 개 기업이 사랑하는 1위 엔지니어링 인텔리전스 플랫폼 Weave에서 제작했습니다.

주요 기능 Claude Code, Codex, Cursor 또는 자체 앱을 localhost:8080으로 연결하기만 하면 됩니다. 이 라우터는 다음을 지원합니다:

🎯 요청별 라우팅. 'Avengers-Pro 2'에서 파생된 클러스터 채점기를 통해 매 턴마다 활성화된 제공자 중 가장 적합한 모델을 선택합니다. 🔌 모든 API 호환. Anthropic Messages, OpenAI Chat Completions, Gemini 네이티브 형식을 모두 지원합니다. 스트리밍, 도구(Tools), 비전(Vision) 등 모든 기능을 완벽히 지원합니다. 🧠 오픈소스 모델 지원. OpenRouter(또는 OpenAI 호환 엔드포인트)를 통해 DeepSeek, Kimi, GLM, Qwen, Llama, Mistral 등을 인식하고 사용할 수 있습니다. 🔒 기본 BYOK(Bring Your Own Key). 제공자의 API 키는 사용자의 기기 내에 남아 저장 시 암호화됩니다. 📊 관측 가능성(Observable). OTLP 트레이스를 기본 제공합니다. Weave 대시보드(http://localhost:8080/ui/dashboard)에서 확인하거나 Honeycomb, Datadog, Grafana 등에 연동할 수 있습니다.

30초 퀵스타트 가장 빠른 방법은 단 하나의 명령어로 호스팅된 Weave Router를 Claude Code, Codex 또는 opencode에 연결하는 것입니다. 별도의 클론, Docker, Postgres 설치가 필요 없습니다.

npx @workweave/router

끝입니다. 설치 프로그램이 도구(Claude Code, Codex, opencode)를 묻고, 범위(사용자 vs 프로젝트)를 안내하며, 라우터 키를 가져와서 올바른 구성 파일을 자동으로 설정해 줍니다.

기타 옵션: npx @workweave/router --claude # 선택기를 건너뛰고 Claude Code 바로 연결 npx @workweave/router --codex # 선택기를 건너뛰고 OpenAI Codex CLI 바로 연결 npx @workweave/router --opencode # 선택기를 건너뛰고 opencode 바로 연결 npx @workweave/router --scope project # 저장소별 설정 (settings.json, .codex/, opencode.json 커밋) npx @workweave/router --local # localhost:8080 자체 호스팅 npx @workweave/router --base-url https://router.acme.internal npx @workweave/router@0.1.0 # 특정 버전 고정

Node 18 이상이 필요합니다(Claude Code 및 opencode 경로에는 jq도 필요함). 전체 플래그 참조는 install/npm/README.md를 확인하세요.

또는: 전체 스택 자체 호스팅 자체 기기에서 라우터(및 대시보드)를 실행하려면 다음을 따르세요:

1. 제공자 키를 입력합니다. OpenRouter를 기본 베이스라인으로 권장합니다.

echo " OPENROUTER_API_KEY=sk-or-v1-... " >> .env.local

2. :8080 포트에서 Postgres와 라우터를 부팅하고 rk_ 키를 시딩합니다.

make full-setup

라우터는 http://localhost:8080에서, 대시보드는 http://localhost:8080/ui/ (비밀번호: admin)에서 실행되며, rk_... 키는 로그에 출력됩니다.

Anthropic처럼 호출하기

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"}]} '

...또는 OpenAI처럼 호출하기

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

프록시 없이 라우팅 결정만 미리 보기

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

도구에 연동하기 Claude Code. make install-cc를 실행하여 Claude Code를 로컬 자체 호스팅 라우터에 연결합니다(make full-setup이 끝나면 자동으로 호출됨). 호스팅된 라우터의 경우 위의 npx @workweave/router 명령어를 사용하세요.

Codex (OpenAI CLI). npx @workweave/router --codex는 관리형 [model_providers.weave] 블록으로 ~/.codex/config.toml(또는 --scope project일 경우 /.codex/config.toml)을 패치하고 model_provider = "weave"로 설정합니다. Codex의 기존 OPENAI_API_KEY는 플랜 기반 통과(Passthrough)를 위해 api.openai.com으로 전달되며, 라우터 키는 X-Weave-Router-Key HTTP 헤더에 담겨 전송됩니다. 재설치나 --uninstall --codex는 나머지 Codex 구성을 건드리지 않고 관리 블록만 다시 작성하거나 제거합니다.

opencode. npx @workweave/router --opencode는 ~/.config/opencode/opencode.json(또는 --scope project일 경우 /opencode.json)에 provider.weave 항목을 병합합니다. 이는 라우터의 /v1 엔드포인트를 향하도록 구성된 opencode의 번들링된 @ai-sdk/anthropic 제공자를 사용합니다. 이 라우터는 Anthropic Me(essages API)와 호환됩니다.

원문 보기
원문 보기 (영어)
One endpoint. Every model. Always the right one. A drop-in proxy for Anthropic, OpenAI, and Gemini that picks the best model for every request: using a tiny on-box embedder, not a vibes-based prompt. 🥇 #1 on the RouterArena leaderboard 1 — Acc-Cost Arena 76.09 . Built by Weave : The #1 engineering intelligence platform, loved by Robinhood, PostHog, Reducto, and hundreds of others. What it does Point Claude Code, Codex, Cursor, or your own app at localhost:8080 . The router: 🎯 Routes per request. A cluster scorer derived from Avengers-Pro 2 picks the right model from your enabled providers, every turn. 🔌 Speaks everyone's API. Anthropic Messages, OpenAI Chat Completions, Gemini native. Streaming, tools, vision, the works. 🧠 Knows OSS too. DeepSeek, Kimi, GLM, Qwen, Llama, Mistral via OpenRouter (or any OpenAI-compatible endpoint). 🔒 BYOK by default. Provider keys stay on your box, encrypted at rest. 📊 Observable. OTLP traces out of the box. See your dashboard in the Weave dashboard ( http://localhost:8080/ui/dashboard ) or drop in Honeycomb, Datadog, Grafana, whatever. 30-second quickstart The fastest way: point Claude Code, Codex, or opencode at the hosted Weave Router with one command. No clone, no Docker, no Postgres. npx @workweave/router That's it. The installer asks which tool (Claude Code, Codex, or opencode), walks you through scope (user vs. project), grabs a router key, and wires the right config file. Other flavors: npx @workweave/router --claude # skip the picker, Claude Code npx @workweave/router --codex # skip the picker, OpenAI Codex CLI npx @workweave/router --opencode # skip the picker, opencode npx @workweave/router --scope project # per-repo, commits settings.json (or .codex/ / opencode.json) npx @workweave/router --local # self-hosted localhost:8080 npx @workweave/router --base-url https://router.acme.internal npx @workweave/router@0.1.0 # pin a version Requires Node ≥ 18 (Claude Code and opencode paths also need jq ). Full flag reference: install/npm/README.md . Or: self-host the whole stack If you want the router (and dashboard) running on your own box: # 1. Drop a provider key in. OpenRouter is the recommended baseline. echo " OPENROUTER_API_KEY=sk-or-v1-... " >> .env.local # 2. Boot Postgres + router on :8080 and seed an rk_ key. make full-setup The router is up at http://localhost:8080 , the dashboard at http://localhost:8080/ui/ (password: admin ), and your rk_... key prints in the logs. # Call it like Anthropic 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"}]} ' # ...or like OpenAI curl -sS http://localhost:8080/v1/chat/completions \ -H " Authorization: Bearer rk_... " \ -d ' {"model":"gpt-4o-mini", "messages":[{"role":"user","content":"hi"}]} ' # Peek at the routing decision without proxying curl -sS http://localhost:8080/v1/route -H " Authorization: Bearer rk_... " -d ' ... ' Wire it into your tools Claude Code. Run make install-cc to wire Claude Code at the local self-hosted router (it's also invoked automatically at the end of make full-setup ). For the hosted router, use npx @workweave/router above. Codex (OpenAI CLI). npx @workweave/router --codex patches ~/.codex/config.toml (or <repo>/.codex/config.toml with --scope project ) with a managed [model_providers.weave] block and sets model_provider = "weave" . Codex's existing OPENAI_API_KEY flows through to api.openai.com for the plan-based passthrough; the router key rides in an X-Weave-Router-Key HTTP header. Re-install and --uninstall --codex rewrite/remove only the managed block, leaving the rest of your Codex config untouched. opencode. npx @workweave/router --opencode merges a provider.weave entry into ~/.config/opencode/opencode.json (or <repo>/opencode.json with --scope project ). It uses opencode's bundled @ai-sdk/anthropic provider pointed at the router's /v1 endpoint — the router speaks the Anthropic Messages API natively, so opencode works unmodified. The router key and identity headers ride alongside the provider config; re-install rewrites only the managed block and --uninstall --opencode strips it. Cursor (early beta, performance may not be the best). Settings → Models → Override OpenAI Base URL → http://localhost:8080/v1 , paste rk_... as the API key. Switching on/off. After installing, npx @workweave/router off --claude (or --codex / --opencode ) routes that client straight to its provider again without discarding the router config; on flips it back, and status reports which way it's pointing. Claude Code also gets /router-off , /router-on , and /router-status slash commands. Cursor toggles via the same Settings → Models override above. See install/README.md . Two keys, don't mix them up: sk-or-... / sk-ant-... / sk-... = your upstream provider key. Lives in .env.local . rk_... = your router key. Clients send this as a Bearer token. Endpoints Endpoint Format POST /v1/messages Anthropic Messages, routed POST /v1/chat/completions OpenAI Chat Completions, routed POST /v1beta/models/:action Gemini generateContent , routed POST /v1/route Returns the decision, no upstream call GET /v1/models · POST /v1/messages/count_tokens Anthropic passthrough GET /health · GET /validate liveness + key check Deeper docs 📐 Configuration reference : every env var, BYOK encryption, OTel knobs, cluster routing. 🛠️ Contributing : layering rules, hot-reload dev, migrations, tests, the whole engineering loop. 🏗️ Architecture : package layout, import contracts, recipes for adding endpoints / providers / strategies. Roadmap Token-aware rate limiting (Redis sliding window per installation) Sub-installations for tenant hierarchies Speculative dispatch + hedging for tail latency Footnotes Lu, Y., Liu, R., Yuan, J., Cui, X., Zhang, S., Liu, H., & Xing, J. RouterArena: An Open Platform for Comprehensive Comparison of LLM Routers. arXiv:2510.00202, 2025. https://arxiv.org/abs/2510.00202 ↩ Zhang, Y. et al. Beyond GPT-5: Making LLMs Cheaper and Better via Performance–Efficiency Optimized Routing (Avengers-Pro). arXiv:2508.12631, 2025. https://arxiv.org/abs/2508.12631 ↩