Configuration
Every field in meted.config.json, and every environment override.
meted.config.json lives at the root of your project and is meant to be
committed. apiKeyEnv holds the name of the environment variable your
provider key lives in, never the key.
{
"$schema": "https://meted.dev/schema/v0.1.json",
"version": 1,
"mode": "observe",
"provider": {
"id": "openai",
"baseUrl": "https://api.openai.com/v1",
"apiKeyEnv": "OPENAI_API_KEY",
"headers": {},
},
"gateway": {
"host": "127.0.0.1",
"port": 8787,
"requestTimeoutMs": 120000,
"responseHeaders": true,
},
"engine": {
"module": null,
"wasm": null,
"exportName": null,
"timeoutMs": 250,
"options": {},
},
"policy": {},
"cloudflare": {
"workerName": "meted-gateway",
"accountId": null,
"routes": [],
"compatibilityDate": "2025-01-01",
},
}
A broken configuration never stops a running gateway. Unreadable fields fall back to their defaults and are reported as warnings.
mode
observe | conservative | balanced | aggressive. Default observe. See
Policies.
provider
| Field | Default | |
|---|---|---|
id | openai | Adapter id |
baseUrl | OpenAI | Upstream base URL |
apiKeyEnv | OPENAI_API_KEY | Name of the variable holding the key |
headers | {} | Extra headers forwarded upstream. Non-secret only |
gateway
| Field | Default | |
|---|---|---|
host | 127.0.0.1 | Bind address |
port | 8787 | Port |
requestTimeoutMs | 120000 | Upstream timeout. Streams are exempt once started |
responseHeaders | true | Add x-meted-* headers |
engine
| Field | Default | |
|---|---|---|
module | null | Package name or path exporting an engine |
wasm | null | Path to a WASM engine |
exportName | null | Named export to use |
timeoutMs | 250 | Past this, the engine counts as failed |
options | {} | Passed to the engine factory |
policy
Overrides for the current mode. Every field is optional.
| Field | |
|---|---|
ceilingMultiplier | Multiplier on the engine's ceiling |
floorTokens | The applied ceiling is never lower than this |
minConfidence | Below this, forward unchanged |
lengthHint | Append a length hint to the prompt |
{
"mode": "balanced",
"policy": { "minConfidence": 0.7 },
}
cloudflare
Used by meted deploy.
| Field | Default | |
|---|---|---|
workerName | meted-gateway | Worker name |
accountId | null | Written into wrangler.toml when set |
routes | [] | Route patterns for the Worker |
compatibilityDate | 2025-01-01 | Workers compatibility date |
Environment overrides
Environment variables win over the file, so one committed config can behave differently per deployment.
| Variable | Overrides |
|---|---|
METED_MODE | mode |
METED_HOST, METED_PORT | gateway.host, gateway.port |
METED_PROVIDER_BASE_URL | provider.baseUrl |
METED_PROVIDER_API_KEY_ENV | provider.apiKeyEnv |
METED_ENGINE_MODULE | engine.module |
METED_ENGINE_WASM | engine.wasm |
METED_DEBUG | Print stack traces on CLI errors |
Discovery
Meted walks up from the working directory looking for meted.config.json, so
commands work from anywhere inside a project. With no config file, defaults are
used and the CLI prints No meted.config.json here. Using defaults.