Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
polaris
command
|
|
|
examples
|
|
|
go/chat
command
Command chat is a runnable example: a single chat completion through a Polaris gateway using the Go SDK.
|
Command chat is a runnable example: a single chat completion through a Polaris gateway using the Go SDK. |
|
go/embeddings
command
Command embeddings is a runnable example: request an embedding vector through a Polaris gateway using the Go SDK.
|
Command embeddings is a runnable example: request an embedding vector through a Polaris gateway using the Go SDK. |
|
go/stream
command
Command stream is a runnable example: a streaming chat completion through a Polaris gateway, printing tokens as they arrive over SSE.
|
Command stream is a runnable example: a streaming chat completion through a Polaris gateway, printing tokens as they arrive over SSE. |
|
internal
|
|
|
apierror
Package apierror defines Polaris's OpenAI-compatible error type and the provider-error translation helpers.
|
Package apierror defines Polaris's OpenAI-compatible error type and the provider-error translation helpers. |
|
console
Package console optionally serves the Polaris admin console (web/console) from the gateway binary.
|
Package console optionally serves the Polaris admin console (web/console) from the gateway binary. |
|
files
Package files resolves Polaris file references into a form a provider can consume (provider handle, URL, or inline bytes), materializing files into provider Files APIs on demand.
|
Package files resolves Polaris file references into a form a provider can consume (provider handle, URL, or inline bytes), materializing files into provider Files APIs on demand. |
|
gateway/drain
Package drain tracks live WebSocket streams so a graceful shutdown can send close frames and wait for them to finish, and exposes a draining flag the readiness probe consults so load balancers stop sending new traffic first.
|
Package drain tracks live WebSocket streams so a graceful shutdown can send close frames and wait for them to finish, and exposes a draining flag the readiness probe consults so load balancers stop sending new traffic first. |
|
gateway/handler
Package handler implements the gateway's HTTP handlers: it translates HTTP requests into modality operations, dispatches them through the provider registry, and renders OpenAI-compatible responses and SSE streams.
|
Package handler implements the gateway's HTTP handlers: it translates HTTP requests into modality operations, dispatches them through the provider registry, and renders OpenAI-compatible responses and SSE streams. |
|
gateway/httputil
Package httputil holds the gin-coupled HTTP glue for the gateway layer.
|
Package httputil holds the gin-coupled HTTP glue for the gateway layer. |
|
gateway/middleware
Package middleware holds the Gin middleware chain: recovery, request IDs, tracing, runtime snapshot injection, body limits, CORS, logging, metrics, authentication, rate limiting, budgets, and load shedding.
|
Package middleware holds the Gin middleware chain: recovery, request IDs, tracing, runtime snapshot injection, body limits, CORS, logging, metrics, authentication, rate limiting, budgets, and load shedding. |
|
gateway/runtime
Package runtime holds the hot-reloadable configuration Snapshot (Holder) and the Reloader that atomically swaps it, plus the mapping from application config onto the process-lifetime reliability manager's tunables.
|
Package runtime holds the hot-reloadable configuration Snapshot (Holder) and the Reloader that atomically swaps it, plus the mapping from application config onto the process-lifetime reliability manager's tunables. |
|
guardrails
Package guardrails is Polaris's content-safety policy engine.
|
Package guardrails is Polaris's content-safety policy engine. |
|
mcp
Package mcp implements a stateless, streamable-HTTP Model Context Protocol server and upstream client.
|
Package mcp implements a stateless, streamable-HTTP Model Context Protocol server and upstream client. |
|
obs
Package obs provides Polaris's neutral observability primitives — tracing span helpers, the OTLP tracer bootstrap, and the provider HTTP RoundTripper that emits client spans.
|
Package obs provides Polaris's neutral observability primitives — tracing span helpers, the OTLP tracer bootstrap, and the provider HTTP RoundTripper that emits client spans. |
|
provider/core
Package core holds small, dependency-light helpers shared across provider adapters, the provider registry, and the verification tooling.
|
Package core holds small, dependency-light helpers shared across provider adapters, the provider registry, and the verification tooling. |
|
reliability
Package reliability provides Polaris's process-lifetime resilience state: per-provider health scoring (EWMA latency + sliding error-rate window), circuit breaking, load shedding (concurrency caps), and retry budgets.
|
Package reliability provides Polaris's process-lifetime resilience state: per-provider health scoring (EWMA latency + sliding error-rate window), circuit breaking, load shedding (concurrency caps), and retry budgets. |
|
routing
Package routing orders provider candidates for a request according to a per-route strategy (static, round-robin, weighted, least-latency, cost-optimized, adaptive), consuming live provider health from the reliability manager.
|
Package routing orders provider candidates for a request according to a per-route strategy (static, round-robin, weighted, least-latency, cost-optimized, adaptive), consuming live provider health from the reliability manager. |
|
semcache
Package semcache is Polaris's embedding semantic cache.
|
Package semcache is Polaris's embedding semantic cache. |
|
store
Package store defines Polaris's persistence contract (the Store interface and its role interfaces), the data models, the never-block async request/audit loggers, and small in-memory helpers such as the generic TTL cache.
|
Package store defines Polaris's persistence contract (the Store interface and its role interfaces), the data models, the never-block async request/audit loggers, and small in-memory helpers such as the generic TTL cache. |
|
store/postgres
Package postgres implements the store.Store persistence contract on PostgreSQL via pgx v5.
|
Package postgres implements the store.Store persistence contract on PostgreSQL via pgx v5. |
|
store/sqlite
Package sqlite implements the store.Store persistence contract on a pure-Go SQLite database (modernc.org/sqlite, no CGo).
|
Package sqlite implements the store.Store persistence contract on a pure-Go SQLite database (modernc.org/sqlite, no CGo). |
|
transport
Package transport is Polaris's single outbound HTTP core.
|
Package transport is Polaris's single outbound HTTP core. |
|
pkg
|
|
|
client
Package client is the official Go SDK for the Polaris AI gateway.
|
Package client is the official Go SDK for the Polaris AI gateway. |
|
securitycheck
command
|
|
|
tests
|
|
Click to show internal directories.
Click to hide internal directories.