IBEX Harness
DocsBenchmarksBlogChangelogRoadmap
GitHub
IBEX Harness

Documentation

Architecture Decision RecordsADR-0002: Repository foundation bootstrapADR-0003: Branch protection and merge policyADR-0004: Protobuf and code generation policyADR-0005: Postgres migration strategyADR-0006: Auth protobuf contract (`ibex.auth.v1`)ADR-0007: Auth token validation implementationADR-0008: Security scanning and CI quality gatesADR-0009: Permission bitmap layoutADR-0010: Cryptography policyADR-0011: Proxy auth gRPC client and middlewareADR-0012: Proxy request normalization (OpenAI chat)ADR-0013: Proxy input validation and stable error envelopeADR-0014: Core domain migration sequencingADR-0015: Proxy rate limit skeleton (Phase 1)ADR-0016: Proxy agent identity verification (Phase 1)ADR-0017: Request ID and trace context strategy (Phase 1)ADR-0018: Graceful shutdown contract (Phase 1)ADR-0019: OpenTelemetry provider configuration (Phase 1)ADR-0020: Shared package boundaries — `packages/config` and `packages/apierror`ADR-0021: Prometheus Metric Catalog (Phase 1)ADR-0022: Health check contract (Phase 1)ADR-0023: Docs site architecture (Phase 1.5)ADR-0024: Benchmark data publishing modelADR-0025: LLM provider abstractionADR-0026: OpenAI client designADR-0027: Streaming dual-write strategyADR-0028: Auth cache designADR-0029: Token revocation propagation via Redis pub/subADR-0030: Directive versioning strategyADR-0031: System prompt injection strategyADR-0032: Session data model and retentionADR-0033: ClickHouse llm_traces schema and retentionADR-0034: Proxy overhead performance measurement methodologyADR-0035: Chat Idempotency-Key Redis dedupeADR-0038: Context assembly service design and gRPC contractADR-0039: Proxy Postgres ownership for session and directive storesADR-0040: Anthropic provider adapterADR-0041: Model capability registryADR-0042: Self-hosted OpenAI-compatible LLM adapterADR-0043: Tokenizer registry architectureADR-0044: Non-streaming response pipelineADR-0045: Streaming response transformationADR-0046: Embedder interface and profile registryADR-0047: Memory temporal validity foundationADR-0048: Memory multi-label categoriesADR-0049: Memory relationship graph readinessADR-0050: MCP server skeleton (transport, auth, audit)ADR-0051: Local LGTM observability stack (Phase 2.5 exit pull-forward)ADR-0052: Memory schema v2 expand (HNSW, quality columns)ADR-0053: Vector store abstraction and composite scoring v2
ADRs›ADR-0042: Self-hosted OpenAI-compatible LLM adapter
ADRs

ADR-0042: Self-hosted OpenAI-compatible LLM adapter

Architecture decision record 0042 — second Provider for self-hosted OpenAI-compatible backends (vLLM-first), shared client, readiness probe, and circuit breaker.

ADR-0042: Self-hosted OpenAI-compatible LLM adapter

  • Status: Accepted
  • Date: 2026-08-21
  • Authors: IBEX Harness team
  • Milestone: 2.5.G1.M3 Self-hosted LLM adapter

Context

Air-gapped and GPU-local deployments need the proxy to talk to OpenAI-compatible inference servers (vLLM, TGI, Ollama, llama.cpp) without overloading hosted OPENAI_BASE_URL. Hosted OpenAI and self-hosted backends differ in auth (optional bearer), readiness (model load can take minutes), and failure modes (queue-full 503 vs breaker-open).

Capability overlays already require ExtraModels metadata (ADR-0041). Self-hosted model IDs participate in that same overlay contract using the openai vendor family (wire dialect), while the runtime adapter name is distinct.

Decision

1) Second Provider: openaicompatible

Register a separate provider.Provider named openaicompatible when IBEX_SELFHOSTED_ENABLED=true. Do not steal OPENAI_BASE_URL from the hosted OpenAI client.

Shared HTTP/chat/SSE logic lives in packages/provider/openaicompatible. Hosted OpenAI (packages/provider/openai) is a thin wrapper with curated built-ins and always-on Bearer auth.

2) Config surface

VariableRole
IBEX_SELFHOSTED_ENABLEDFail-closed gate
IBEX_SELFHOSTED_BASE_URLMust be http(s), no userinfo, path ending in /v1
IBEX_SELFHOSTED_MODELSComma-separated allowlist (required when enabled)
IBEX_SELFHOSTED_API_KEYOptional bearer (omit Authorization when empty)
IBEX_SELFHOSTED_READY_TIMEOUT / IBEX_SELFHOSTED_READY_POLLBootstrap probe budget
IBEX_PROVIDER_CIRCUIT_BREAKER_FAILURES / …_COOLDOWN_SECONDSBreaker defaults for self-hosted

Live mode may start with only self-hosted (no cloud keys). Mock mode ignores self-hosted registration.

3) Overlays use openai vendor family

IBEX_SELFHOSTED_MODELS IDs are active ExtraModels keyed as provider: "openai" for overlay validation (wire dialect). Runtime routing still resolves through the openaicompatible adapter's SupportedModels().

tokenizer_family: unknown is acceptable until 2.5.G2.M1.

4) Bootstrap readiness + advisory /ready

Before registry registration, poll GET {base}/models until 2xx or timeout (fail-closed at boot). After registration, /ready exposes an advisory selfhosted_llm checker so temporary GPU saturation does not fail critical readiness.

5) Circuit breaker outside retries

packages/circuitbreaker wraps each Complete (retries happen inside one breaker attempt). Distinct client-facing details:

  • HTTP 503 from upstream → queue_full reason → “Self-hosted LLM backend queue is full”
  • Breaker open → circuit_open reason → “Self-hosted LLM circuit breaker is open”

Both map to PROVIDER_UNAVAILABLE (HTTP 503) without leaking upstream bodies or keys.

6) SSRF exception

Self-hosted BaseURL may target private/loopback hosts only when explicitly enabled. Hosted OpenAI BaseURL policy is unchanged. See SECURITY.md §8.3.

Consequences

Positive: Air-gapped deployments work without cloud keys; hosted OpenAI path stays behavior-preserving; operators get distinct queue vs breaker signals.

Negative / follow-ups: Tokenizer accuracy for open-weight models waits on G2.M1; multi-backend self-hosted pools are out of scope.

Was this page helpful?

Edit on GitHub

Last updated on

PreviousADR-0041: Model capability registryNextADR-0043: Tokenizer registry architecture

On this page

  • Context
  • Decision
  • 1) Second Provider: openaicompatible
  • 2) Config surface
  • 3) Overlays use openai vendor family
  • 4) Bootstrap readiness + advisory /ready
  • 5) Circuit breaker outside retries
  • 6) SSRF exception
  • Consequences
0%