์ฝ˜ํ…์ธ ๋กœ ์ด๋™

์–ธ์–ด ์„ ํƒ

ํ˜„์žฌ ์–ธ์–ด: ํ•œ๊ตญ์–ด

Self-Hosted OpenAI-Compatible Entry

When enabled, OmniRouteโ€™s existing /v1/chat/completions (and the OpenAI-compatible contract it serves) becomes a self-hosted gateway: one OpenAI-compatible request in, auto-routed to the provider of your choice through the provider adapters, with a standard OpenAI error shape out. Client code does not change.

This is the D4 (ๆŽฅๅ…ฅๅณ็”จ) differentiator from the RIC-697 design: the same /v1 path the OpenAI SDK already targets, backed by your own providers instead of a single vendored catalog.

Set either env var (see .env.example for both):

  • OMNIROUTE_SELF_HOSTED_PROVIDERS โ€” inline YAML document (runtime-only, not logged).
  • OMNIROUTE_SELF_HOSTED_PROVIDERS_FILE โ€” path to a YAML file.
providers.yaml
providers:
- id: local
kind: openai # openai | anthropic | local
baseUrl: http://127.0.0.1:11434/v1
model: llama3
# apiKey: sk-... # optional, runtime-only
- id: claude
kind: anthropic
baseUrl: http://127.0.0.1:8080
model: claude-sonnet

When either var is set, the unified entry is active for every request to /v1/chat/completions. Config present but unparseable returns 500 (it never silently falls through to cloud routing). When neither is set, the route behaves exactly as before.

Precedence (deterministic, no predictive model):

  1. x-omniroute-provider: <id> header โ€” exact provider id.
  2. model prefix: provider/model (slash) or provider::model (double colon).
  3. First configured provider.

The routing prefix is stripped before forwarding โ€” upstream receives the bare model (claude-sonnet, not claude/claude-sonnet).

ํ„ฐ๋ฏธ๋„ ์ฐฝ
# via header
curl http://localhost:20128/v1/chat/completions \
-H "x-omniroute-provider: claude" \
-H "content-type: application/json" \
-d '{"model":"claude-sonnet","messages":[{"role":"user","content":"hi"}]}'
# or via model prefix
curl ... -d '{"model":"claude/claude-sonnet","messages":[...]}'

Optional OMNIROUTE_SELF_HOSTED_API_KEY. When set, requests must carry Authorization: Bearer <key>. Unset = open route (loopback / trusted network), mirroring how OmniRouteโ€™s existing local providers work. The D5 quota/quota-่‡ชๆฒป key system is expected to take over this header.

  • Upstream non-2xx body is normalized through parseUpstreamError + buildErrorBody into the standard OpenAI error shape (Hard Rule #12 โ€” never raw upstream text).
  • Network-level failures (connection refused / DNS / TLS) return a normalized 502 with error.message: "Upstream provider unreachable: โ€ฆ".
  • Credential / session headers echoed upstream are stripped from every response.

tests/unit/self-hosted-entry.test.ts covers provider selection, model-prefix forwarding, header hygiene, auth, upstream-error normalization, SSE streaming passthrough, and the fall-through / misconfig paths โ€” all over real HTTP against a local upstream.

  • Self-hosted models bypass the cloud-only retirement / alias machinery by design: the divert happens before those cloud checks, so ids like local/llama3 never trip cloud-peer 410s or alias rewrites.
  • Deterministic routing strategies (fallback / cooldown / cost / latency / blacklist) are M2โ€™s scope (RIC-740) and inject into the gateway layer here. Configure them with a strategy: block โ€” see DETERMINISTIC_ROUTING.md.

undefined (a58000c7685f)

HagiCode

HagiCode๋Š” ์—์ด์ „ํŠธ ์ฝ”๋”ฉ ์ž‘์—… ๊ณต๊ฐ„์ž…๋‹ˆ๋‹ค. ํ’๋ถ€ํ•˜๊ณ  ํŽธ๋ฆฌํ•œ UI ์ƒํ˜ธ์ž‘์šฉ์œผ๋กœ ๊ณ„ํš ์ˆ˜๋ฆฝ, ์—์ด์ „ํŠธ ์‹คํ–‰, ํ”„๋กœ์ ํŠธ ์ž‘์—…์„ ์‰ฝ๊ฒŒ ์‹œ์ž‘ํ•˜๊ณ  ๋”ฐ๋ผ๊ฐ€๋ฉฐ ๊ฐœ๋ฐœ์„ ๋” ํฅ๋ฏธ๋กœ์šด ๊ฒฝํ—˜์œผ๋กœ ๋งŒ๋“ญ๋‹ˆ๋‹ค.

ํ’๋ถ€ํ•˜๊ณ  ํŽธ๋ฆฌํ•œ UI ์ƒํ˜ธ์ž‘์šฉ์œผ๋กœ ๊ณ„ํš๋ถ€ํ„ฐ ํ”„๋กœ์ ํŠธ ์ž‘์—…๊นŒ์ง€ ์‰ฝ๊ฒŒ ๋”ฐ๋ผ๊ฐˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

HagiCode ๋ฐฉ๋ฌธ๋ฌธ์„œ ์ฝ๊ธฐ
  • ์Šค๋งˆํŠธOpenSpec ์›Œํฌํ”Œ๋กœ๋Š” ์˜๋„๋ฅผ ์ œ์•ˆ, ์„ค๊ณ„, ์ž‘์—…์„ ๊ฑฐ์ณ ๋ฐฐํฌ๊นŒ์ง€ ์ด์–ด์ง€๋Š” ์‹คํ–‰ ๊ฐ€๋Šฅํ•œ ๊ฒฝ๋กœ๋กœ ๋ฐ”๊ฟ‰๋‹ˆ๋‹ค.
  • ํšจ์œจ์ ๋‹ค์ค‘ ์—์ด์ „ํŠธ ์‹คํ–‰์œผ๋กœ ์กฐ์‚ฌ, ๊ตฌํ˜„, ๊ฒ€ํ† ๋ฅผ ๋ณ‘๋ ฌ๋กœ ์ง„ํ–‰ํ•˜๋ฉฐ ์—ฌ๋Ÿฌ ์ €์žฅ์†Œ์™€ ์ต์ˆ™ํ•œ Agent CLI๋ฅผ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค.
  • ํฅ๋ฏธ๋กœ์šดํ’๋ถ€ํ•˜๊ณ  ํŽธ๋ฆฌํ•œ UI ์ƒํ˜ธ์ž‘์šฉ์œผ๋กœ ๊ณ„ํš ์ˆ˜๋ฆฝ, ์—์ด์ „ํŠธ ์‹คํ–‰, ํ”„๋กœ์ ํŠธ ์ž‘์—…์„ ์‰ฝ๊ฒŒ ์‹œ์ž‘ํ•˜๊ณ  ๋”ฐ๋ผ๊ฐˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Windows์šฉ ๋‹ค์šด๋กœ๋“œ

Microsoft Store์—์„œ ๋ฐ›๊ธฐ๋ชจ๋“  ๋‹ค์šด๋กœ๋“œ

์•„์ด๋””์–ด๋ฅผ ์‹ค์ œ๋กœ ๋ฐฐํฌ๋˜๋Š” ์†Œํ”„ํŠธ์›จ์–ด๋กœ.

HagiCode๋Š” ์—์ด์ „ํŠธ ์ฝ”๋”ฉ ์ž‘์—… ๊ณต๊ฐ„์ž…๋‹ˆ๋‹ค. OpenSpec ์›Œํฌํ”Œ๋กœ๋กœ ๋ณ€๊ฒฝ์„ ๊ณ„ํšํ•˜๊ณ , ๋‹ค์ค‘ ์—์ด์ „ํŠธ ์‹คํ–‰์œผ๋กœ ์ง„ํ–‰ํ•˜๋ฉฐ, Hero Scenario๋กœ ๊ธด ์ž‘์—…์˜ ์ง„ํ–‰ ์ƒํ™ฉ์„ ํ•œ๋ˆˆ์— ๋ณด์—ฌ ์•„์ด๋””์–ด๋ฅผ ์‹ค์ œ๋กœ ๋ฐฐํฌ๋˜๋Š” ์†Œํ”„ํŠธ์›จ์–ด๋กœ ๋งŒ๋“ญ๋‹ˆ๋‹ค.

์Šค๋งˆํŠธ
OpenSpec ์›Œํฌํ”Œ๋กœ๋Š” ์˜๋„๋ฅผ ์ œ์•ˆ๋ถ€ํ„ฐ ๋ฐฐํฌ๊นŒ์ง€ ์ด์–ด์ง€๋Š” ์‹คํ–‰ ๊ฐ€๋Šฅํ•œ ๊ฒฝ๋กœ๋กœ ๋ฐ”๊ฟ‰๋‹ˆ๋‹ค.
ํšจ์œจ์ 
๋‹ค์ค‘ ์—์ด์ „ํŠธ ์‹คํ–‰์œผ๋กœ ์กฐ์‚ฌ, ๊ตฌํ˜„, ๊ฒ€ํ† ๋ฅผ ๋ณ‘๋ ฌ๋กœ ์ง„ํ–‰ํ•ฉ๋‹ˆ๋‹ค.
์ฆ๊ฑฐ์šด
ํŽธ๋ฆฌํ•œ UI ์ƒํ˜ธ์ž‘์šฉ์œผ๋กœ ๊ณ„ํš, ์—์ด์ „ํŠธ ์‹คํ–‰, ํ”„๋กœ์ ํŠธ ์ž‘์—…์„ ์‰ฝ๊ฒŒ ๋”ฐ๋ผ๊ฐˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.