mirror of
https://github.com/Twigpine/zero.git
synced 2026-11-11 18:00:54 -10:00
providers
Remove OPENAI_API_KEY as an OpenGateway credential fallback so the gateway only looks for OPENGATEWAY_API_KEY. Add a provider catalog guard test that verifies each built-in provider only advertises credential env vars owned by that provider.
zero
To install dependencies:
bun install
To run:
bun run dev
To list built-in provider catalog entries:
bun run src/index.ts providers catalog
Provider catalog
Provider, gateway, and local endpoint catalog entries live in
src/providers/catalog/definitions. Global model metadata lives in
src/providers/catalog/models.
Top-level providers are services that self-publish model families, such as OpenAI with GPT/o-series, Anthropic with Claude/Opus, Google with Gemini, and DeepSeek with DeepSeek models. Gateways should usually reference those global models instead of redefining them.
Minimal gateway example:
id = "my-gateway"
name = "My Gateway"
kind = "gateway"
description = "OpenAI-compatible gateway"
category = "aggregating"
baseURL = "https://api.example.com/v1"
defaultModel = "vendor/model-name"
apiKeyRequired = true
credentialEnvVars = ["MY_GATEWAY_API_KEY"]
costCurrency = "USD"
[setup]
requiresAuth = true
authMode = "api-key"
[transportConfig]
kind = "openai-compatible"
maxTokensField = "max_completion_tokens"
removeBodyFields = ["store", "stream_options"]
authHeader.name = "authorization"
authHeader.scheme = "bearer"
headers.X-Trace-Source = "zero"
headers.X-Tenant = "$MY_GATEWAY_TENANT"
[catalog]
source = "hybrid"
discoveryCacheTtl = "1h"
discoveryRefreshMode = "manual"
discovery.kind = "openai-compatible"
discovery.requiresAuth = true
discovery.path = "/models"
[[catalog.models]]
globalModelId = "gpt-4o"
apiName = "openai/gpt-4o"
contextWindow = 32000
maxOutputTokens = 4096
cost.inputPerMillion = 2.50
cost.outputPerMillion = 10.00
[[catalog.models]]
globalModelId = "claude-sonnet-4"
apiName = "anthropic/claude-sonnet-4"
contextWindow = 200000
maxOutputTokens = 64000
cost.inputPerMillion = 3.00
cost.outputPerMillion = 15.00
Detailed docs:
This project was created using bun init in bun v1.3.11. Bun is a fast all-in-one JavaScript runtime.
Description
The coding agent that answers to you, your model, your machine, your rules.
Readme
MIT
51 MiB
0 Stars
1 Watchers
0 Forks