Documentation
¶
Overview ¶
Package graycode-router provides LLM provider clients and configuration.
The Version variable is sourced from the VERSION file at the repo root and propagated to sub-packages at init time.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Version = strings.TrimSpace(versionFile)
Version of the graycode-router library. Single source of truth: VERSION file.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package catalog defines graycode-router's model catalog: the versioned set of known providers and their model entries, the bootstrap (built-in) catalog, and helpers to compile and query catalog data (e.g.
|
Package catalog defines graycode-router's model catalog: the versioned set of known providers and their model entries, the bootstrap (built-in) catalog, and helpers to compile and query catalog data (e.g. |
|
concentrate
Package concentrate holds shared constants and pricing-cache helpers for the Concentrate AI Responses API gateway (https://concentrate.ai).
|
Package concentrate holds shared constants and pricing-cache helpers for the Concentrate AI Responses API gateway (https://concentrate.ai). |
|
opencodego
Package opencodego holds shared constants and helpers for the OpenCode Go gateway (https://opencode.ai/docs/go/).
|
Package opencodego holds shared constants and helpers for the OpenCode Go gateway (https://opencode.ai/docs/go/). |
|
opengateway
Package opengateway holds shared constants for the OpenGateway inference gateway (https://gitlawb.com/opengateway), an OpenAI-compatible endpoint that routes requests across providers (MiMo, Gemini, MiniMax, Qwen, Kimi, GLM, etc.) and returns the live model catalog with inline pricing from GET /v1/models.
|
Package opengateway holds shared constants for the OpenGateway inference gateway (https://gitlawb.com/opengateway), an OpenAI-compatible endpoint that routes requests across providers (MiMo, Gemini, MiniMax, Qwen, Kimi, GLM, etc.) and returns the live model catalog with inline pricing from GET /v1/models. |
|
xiaomi
Package xiaomi resolves Xiaomi MiMo API base URLs for pay-as-you-go and Token Plan.
|
Package xiaomi resolves Xiaomi MiMo API base URLs for pay-as-you-go and Token Plan. |
|
zai
Package zai resolves Z.AI (Zhipu GLM) API base URLs for General (pay-as-you-go) and Coding Plan subscriptions across International vs China regions.
|
Package zai resolves Z.AI (Zhipu GLM) API base URLs for General (pay-as-you-go) and Coding Plan subscriptions across International vs China regions. |
|
Package client provides LLM provider clients for Anthropic, OpenAI, and OpenAI-compatible APIs with streaming, retry, and provider detection.
|
Package client provides LLM provider clients for Anthropic, OpenAI, and OpenAI-compatible APIs with streaming, retry, and provider detection. |
|
core
Package core holds the provider contract and the data types shared by every layer of the graycode-router client: adapters, middleware, caching, embeddings, and the client facade itself.
|
Package core holds the provider contract and the data types shared by every layer of the graycode-router client: adapters, middleware, caching, embeddings, and the client facade itself. |
|
Package codeagent provides intelligent retry and fallback strategies tailored to code agent workloads.
|
Package codeagent provides intelligent retry and fallback strategies tailored to code agent workloads. |
|
Package config holds graycode-router's provider configuration model and accessors for the active provider/model selection (ActiveProvider, ActiveModel, SetActiveProvider, SetProviderModel) used to route requests.
|
Package config holds graycode-router's provider configuration model and accessors for the active provider/model selection (ActiveProvider, ActiveModel, SetActiveProvider, SetProviderModel) used to route requests. |
|
Package credentials manages provider API-key storage for graycode-router, combining an OS keychain and an env-file store (CombinedStore) and providing import of env-file and deprecated keychain credentials into the current scheme.
|
Package credentials manages provider API-key storage for graycode-router, combining an OS keychain and an env-file store (CombinedStore) and providing import of env-file and deprecated keychain credentials into the current scheme. |
|
Package engine is the stable, host-facing GraycodeRouter API.
|
Package engine is the stable, host-facing GraycodeRouter API. |
|
examples
|
|
|
basic
command
Example: basic chat with graycode-router.
|
Example: basic chat with graycode-router. |
|
multi-provider
command
Example: multi-provider fallback chain.
|
Example: multi-provider fallback chain. |
|
streaming
command
Example: streaming chat with auto-continuation.
|
Example: streaming chat with auto-continuation. |
|
Package graph defines the portable graph vocabulary shared across hawk-eco.
|
Package graph defines the portable graph vocabulary shared across hawk-eco. |
|
internal
|
|
|
api
Package api implements graycode-router's internal HTTP API server (Server) and its configuration, including the reranker interface used to score results.
|
Package api implements graycode-router's internal HTTP API server (Server) and its configuration, including the reranker interface used to score results. |
|
cache
Pluggable distributed cache backend interface.
|
Pluggable distributed cache backend interface. |
|
grpc
Package grpc holds a dependency-free skeleton for an graycode-router gRPC API.
|
Package grpc holds a dependency-free skeleton for an graycode-router gRPC API. |
|
health
Package graycode-router (internal/health) provides provider health-check tracking — the HealthState type and helpers that record and report provider liveness.
|
Package graycode-router (internal/health) provides provider health-check tracking — the HealthState type and helpers that record and report provider liveness. |
|
httputil
Package httputil provides shared HTTP server primitives used across graycode-router's API surfaces.
|
Package httputil provides shared HTTP server primitives used across graycode-router's API surfaces. |
|
observability
Audit log sink for LLM calls.
|
Audit log sink for LLM calls. |
|
probehttp
Package probehttp contains shared helpers for the graycode-router credential-probe and catalog-probe call sites.
|
Package probehttp contains shared helpers for the graycode-router credential-probe and catalog-probe call sites. |
|
shrink
Package shrink compresses LLM tool descriptions before they are sent to the provider.
|
Package shrink compresses LLM tool descriptions before they are sent to the provider. |
|
Package llm is the canonical provider port contract for the hawk ecosystem.
|
Package llm is the canonical provider port contract for the hawk ecosystem. |
|
Package graph provides graph-based execution graph implementation for graycode-router.
|
Package graph provides graph-based execution graph implementation for graycode-router. |
|
Package router contains graycode-router's request-routing building blocks: a CircuitBreaker for failing providers and a ToolFilter for constraining the tools exposed to a given request.
|
Package router contains graycode-router's request-routing building blocks: a CircuitBreaker for failing providers and a ToolFilter for constraining the tools exposed to a given request. |
|
Package runtime is the **recommended entry point** for host applications (e.g.
|
Package runtime is the **recommended entry point** for host applications (e.g. |
|
Package setup wires catalog-backed deployment routing for hawk and graycode-router CLIs.
|
Package setup wires catalog-backed deployment routing for hawk and graycode-router CLIs. |
|
Package storage provides graycode-router's persistence layer: virtual keys and an SQLite-backed budget store (BudgetStore / SQLiteStore) for tracking usage and spend limits.
|
Package storage provides graycode-router's persistence layer: virtual keys and an SQLite-backed budget store (BudgetStore / SQLiteStore) for tracking usage and spend limits. |
|
Package types holds graycode-router's shared data types — message/content blocks and related request/response shapes — plus small cross-cutting helpers such as retry backoff (BackoffDelay, CryptoRandDuration).
|
Package types holds graycode-router's shared data types — message/content blocks and related request/response shapes — plus small cross-cutting helpers such as retry backoff (BackoffDelay, CryptoRandDuration). |
|
Package verify provides a data-driven conformance harness that certifies a provider behaves correctly before it is relied on in the catalog.
|
Package verify provides a data-driven conformance harness that certifies a provider behaves correctly before it is relied on in the catalog. |
Click to show internal directories.
Click to hide internal directories.