fusionAIze Gate is configured through config.yaml plus environment variables loaded from .env.
- Main runtime config:
config.yaml - Environment template:
../.env.example - Provider starter snippets:
./examples
Use this for the SQLite metrics database. The default service path is:
/var/lib/faigate/faigate.db
For local non-root runs, point it somewhere writable outside the repo checkout:
export FAIGATE_DB_PATH="$HOME/.local/state/faigate/faigate.db"The stock config references these variables directly:
DEEPSEEK_API_KEYGEMINI_API_KEYOPENROUTER_API_KEYOPENAI_API_KEY
Optional base URL overrides in .env.example:
DEEPSEEK_BASE_URLGEMINI_BASE_URLOPENROUTER_BASE_URLOPENAI_BASE_URL
Additional optional provider entries in config.yaml reference further env vars when you uncomment them.
Examples in docs/examples also cover optional provider API keys such as:
KILOCODE_API_KEYBLACKBOX_API_KEY
ClawRouter / BlockRun is different: its current public path is wallet-/x402-oriented rather than a normal API-key field, so it is better treated as a separate integration model instead of another *_API_KEY example.
config.yaml exposes explicit security controls for the request surface:
security.response_headerssecurity.cache_controlsecurity.max_json_body_bytessecurity.max_upload_bytessecurity.max_header_value_chars
These settings drive the bounded JSON, upload, and routing-header behavior that ships in v0.9.0+.
provider_catalog_check controls a curated drift/freshness check for known providers.
enabledwarn_on_untrackedwarn_on_model_driftwarn_on_unofficial_sourceswarn_on_volatile_offersmax_catalog_age_days
This does not rewrite config.yaml automatically. It powers:
faigate-doctorfaigate-onboarding-reportGET /api/provider-catalog
The catalog now carries a little more structure than just one recommended model:
provider_typesuch asdirect,aggregator, orwallet-routerauth_modessuch asapi_key,byok, orwallet_x402offer_tracksuch asdirect,free,byok, ormarketplaceevidence_levelto distinguish fully official guidance from mixed/community-supported entriesofficial_source_urlplus optional watchlist sources for faster re-review
The intent is still simple: if a configured provider drifts away from the curated model recommendation, sits on a volatile free-tier track, or relies on less-than-fully-official guidance, operators get a visible warning before the setup silently rots.
Provider-discovery links can also be layered onto the catalog without touching config.yaml.
Pattern:
export FAIGATE_PROVIDER_LINK_OPENROUTER_FALLBACK_URL="https://go.example.com/openrouter"
export FAIGATE_PROVIDER_LINK_KILOCODE_URL="https://go.example.com/kilo"These env vars are operator-controlled full URLs. They are intended for disclosed signup or discovery links and keep link configuration out of normal client config. If unset, the catalog falls back to the provider's official signup or landing URL.
The guardrail is strict:
- recommendation ranking does not use provider-link metadata as an input
- operator-configured discovery links are only shown after a recommendation or candidate row already exists
- CLI and API output should disclose that a shown link is informational only
The first CLI surfaces for this are the existing operator helpers:
faigate-onboarding-reportfaigate-doctorfaigate-provider-discovery
They show the resolved link together with the link-neutral policy state, so later browser or control-center work can build on the same rule set.
The compact discovery helper can also filter those links without changing the catalog itself:
./scripts/faigate-provider-discovery --offer-track free
./scripts/faigate-provider-discovery --json --link-source operator_override --disclosed-only
curl -fsS 'http://127.0.0.1:8090/api/provider-discovery?offer_track=byok'For fast-moving offers, the current preferred review inputs are:
- official provider docs first
- OpenRouter BYOK and provider-routing docs
- Kilo gateway docs
- BlockRun / ClawRouter docs for wallet-routed traffic
- community watchlists such as
free-llm-api-resourcesonly as secondary signals
The config wizard can use this catalog metadata during first setup and later updates:
./scripts/faigate-config-wizard --help
./scripts/faigate-config-wizard --purpose general --client generic --list-candidates
./scripts/faigate-config-wizard --current-config config.yaml --purpose general --client generic
./scripts/faigate-config-wizard --purpose free --client n8n \
--select kilocode,blackbox-free,gemini-flash-lite > config.yaml
./scripts/faigate-config-wizard --current-config config.yaml --merge-existing \
--select openrouter-fallback --write config.yaml
./scripts/faigate-config-wizard --current-config config.yaml --purpose free --client n8n \
--apply recommended_add,recommended_replace,recommended_mode_changes \
--select kilocode,openrouter-fallback --select-profiles n8n --write config.yaml
./scripts/faigate-config-wizard --current-config config.yaml --purpose free --client n8n \
--apply recommended_add,recommended_replace,recommended_mode_changes \
--select kilocode,openrouter-fallback --select-profiles n8n --dry-run-summary
./scripts/faigate-config-wizard --current-config config.yaml --purpose free --client n8n \
--apply recommended_add,recommended_replace,recommended_mode_changes \
--select kilocode,openrouter-fallback --select-profiles n8n \
--write config.yaml --write-backup --backup-suffix .before-wizardThat gives operators one purpose-aware candidate list, config-aware update suggestions (recommended_add, recommended_replace, recommended_keep, recommended_mode_changes), the ability to pick multiple providers at once, and a safer merge path for incremental catalog-driven updates.
If you want the shortest reminder of the whole flow, run:
./scripts/faigate-config-wizard --helpEach provider entry can include:
contractbackendbase_urlapi_keymodelmax_tokenscontext_windowtierlimitscachecapabilitiestimeoutpricingimagelane
The comments in config.yaml are the source of truth for the current schema.
v1.8.0 starts the lane foundation for adaptive orchestration.
The intent is to separate:
- the canonical model lane Gate wants for a task
- the execution route used to reach it
Current lane fields are:
familynamecanonical_modelroute_typeclusterbenchmark_clusterquality_tierreasoning_strengthcontext_strengthtool_strengthsame_model_groupdegrade_to
Example:
providers:
anthropic-claude:
backend: anthropic-compat
base_url: ${ANTHROPIC_BASE_URL:-https://api.anthropic.com/v1}
api_key: ${ANTHROPIC_API_KEY}
model: claude-opus-4-6
lane:
family: anthropic
name: quality
canonical_model: anthropic/opus-4.6
route_type: direct
cluster: elite-reasoning
benchmark_cluster: quality-coding
quality_tier: premium
reasoning_strength: high
context_strength: high
tool_strength: medium
same_model_group: anthropic/opus-4.6
degrade_to:
- anthropic/sonnet-4.6
- openai/gpt-4oThis does not mean the full adaptive routing line already ships. It means the runtime, wizard, and provider catalog can now carry the vocabulary needed for:
- same-lane aggregator fallback
- cluster-aware degradation
- benchmark-aware scoring
- richer dashboard explanations later
If OpenClaw is one of the main clients, these settings give the cleanest fit:
- keep provider ids readable and stable because
GET /v1/modelsexposes them directly to OpenClaw - enable
client_profiles.presets: ["openclaw"] - keep
autoin the fallback path so OpenClaw can stay on one stable primary model id - use
contract: local-workerfor local chat workers - use
contract: image-providerplusimagemetadata for image-capable backends
That gives OpenClaw one provider entry, one primary model id, and optional explicit aliases without mirroring every upstream directly in the OpenClaw config.
Default contract for normal chat-capable providers.
Use this for network-local OpenAI-compatible workers.
Runtime rules:
- backend must be
openai-compat base_urlmust point to localhost or private network spacetierdefaults tolocal- capabilities are normalized to
local=true,cloud=false,network_zone=local
Use this for providers that can serve POST /v1/images/generations and optionally POST /v1/images/edits.
Useful image metadata:
max_outputsmax_side_pxsupported_sizespolicy_tags
If OpenClaw should route image traffic through fusionAIze Gate, pair this with:
imageModel.primary: "faigate/auto"for automatic image-provider selection- or
imageModel.primary: "faigate/<provider-id>"for one fixed image backend
fusionAIze Gate supports two lightweight extension seams:
routing_modes- virtual model ids such as
auto,eco,premium,free, or custom names - can be global defaults or reused by multiple clients
- virtual model ids such as
client_profiles- caller-aware defaults for OpenClaw, n8n, CLI tools, and custom apps
- can set
routing_modeper client before any profile-specific provider hints are applied - only apply when policy/static/heuristic routing did not already make a stronger decision
request_hooks- bounded pre-routing hint injection
- can fail closed depending on
request_hooks.on_error
For optional Claude-Code-/Anthropic-bridge routing refinement, you can load the community hook shipped in this repo:
request_hooks:
enabled: true
community_hooks_dir: "./hooks/community"
hooks:
- claude-code-routerThe hook stays optional and only adds routing hints for bridge traffic. It does
not perform protocol translation. By default it treats Anthropic bridge traffic
as coding-default, and it also understands bridge metadata such as
claude_code_profile: premium or claude_code_profile: fast.
The Anthropic bridge is an optional additional API surface inside Gate. It does not replace the OpenAI-compatible surface and it does not add a second routing stack.
Relevant config blocks:
api_surfacesanthropic_bridge- optional
request_hookswhen you want Claude-Code-specific routing hints
Minimal example:
api_surfaces:
anthropic_messages: true
anthropic_bridge:
enabled: true
allow_claude_code_hints: true
model_aliases:
claude-code: auto
claude-code-fast: eco
claude-code-premium: premiumWhat this means:
api_surfaces.anthropic_messages- exposes
POST /v1/messagesandPOST /v1/messages/count_tokens
- exposes
anthropic_bridge.enabled- enables request parsing, canonical mapping, and response remapping
anthropic_bridge.model_aliases- lets you keep stable Claude-facing model ids while Gate routes internally
anthropic_bridge.allow_claude_code_hints- preserves bridge metadata for optional request hooks such as
claude-code-router
- preserves bridge metadata for optional request hooks such as
Recommended operational pattern:
- use stable logical aliases like
claude-code,claude-code-fast, andclaude-code-premium - keep direct Anthropic routes, Anthropic-capable aggregators, and local workers all probeable
- be careful with aggregator routes that may still use a BYOK Anthropic key from the same quota domain
- prefer health checks and fallback ordering over assuming every Anthropic-shaped route is independent
- when two routes can burn the same upstream quota, give them the same
transport.quota_group - set
transport.billing_mode: byokon routes where wallet or aggregator billing may still collapse to your own upstream key - only set
transport.quota_isolated: truewhen you are confident that route is operationally independent
For the end-to-end flow and local smoke example, see Anthropic Bridge.
Use the onboarding docs and starter examples when introducing a new client instead of hand-authoring these sections from scratch.
fusionAIze Gate v2.0.0 introduces deeper shell parity between the CLI and dashboard, plus safe config workflows and local worker auto‑discovery.
The faigate-stats CLI now integrates with the dashboard through filter‑preserving deep‑links:
# Generate dashboard URL with current filters
faigate-stats --link --view routes --provider deepseek-chat
# Copy URL to clipboard (macOS/Linux/Windows)
faigate-stats --link --view routes --provider deepseek-chat --copy
# Get CLI command suggestions based on metrics analysis
faigate-stats --suggestAll CLI commands (overview, recent, daily, trends) now show matching dashboard links. Filter arguments work across commands:
--provider– filter by provider id (e.g.,deepseek-chat,gemini-flash)--modality– filter by modality (chat,image,code)--client-profile– filter by client profile (opencode,n8n,openclaw)--client-tag– filter by client tag--layer– filter by routing layer (policy,profile,static,heuristic)--success– filter by success (true/false)
The new faigate-config CLI provides safe config management with preview, diff, and backup:
# Preview config changes before applying
faigate-config preview --provider xai --provider zai
# Show detailed diff between config versions
faigate-config diff config.yaml config.new.yaml
# Apply changes with backup and confirmation
faigate-config apply config.new.yaml --backup --confirm
# Validate config syntax and structure
faigate-config validate config.yamlAutomatically detect local AI workers and generate configuration snippets:
# Scan for local workers (Ollama, vLLM, LM Studio, LiteLLM)
faigate-config discover
# JSON output for automation
faigate-config discover --json
# Skip port scanning, only check Grid integration
faigate-config discover --no-scanThe discovery command checks:
- Ollama (localhost:11434)
- vLLM (localhost:8000)
- LM Studio (localhost:1234)
- LiteLLM proxy (localhost:4000)
- Grid integration (if available)
For each detected worker, it suggests a ready‑to‑copy provider block for config.yaml.
The provider catalog now includes 43 curated entries covering all LLM AI Router custom endpoints:
# View available providers
faigate-stats --link --view catalog
# Check provider metadata and recommended models
faigate-stats --provider xai --linkNew providers include:
- xAI / Grok, Z.AI / GLM, Mistral, Groq, HuggingFace Inference
- Moonshot AI / Kimi, MiniMax, Volcano Engine / Doubao, BytePlus
- Qwen, OpenAI Codex, OpenCode Zen, Cerebras, GitHub Copilot
- Synthetic, Kimi Coding, Vercel AI Gateway
- KiloCode model‑level lanes:
kilo‑auto/frontier,/balanced,/free
For a first local config, let fusionAIze Gate suggest one from the API keys already present in your env file:
./scripts/faigate-config-wizard --help
./scripts/faigate-config-wizard --purpose general > config.yamlSupported starting purposes:
generalcodingqualityfree
The generated config includes:
- detected provider blocks
- a fallback chain
- stock routing modes
- model shortcuts
- client profile defaults for OpenClaw, n8n, CLI, and
opencode
Operational update behavior is also configured in config.yaml.
Important blocks:
update_check- release channel
- refresh interval
auto_update- enable/disable
- rollout ring
- release age guard
- maintenance window
- provider scope
- post-update verification
See Operations for the helper and schedule side of the same feature set.
The repo ships ready-to-copy examples under docs/examples:
- OpenClaw client config
- n8n HTTP Request node example
- CLI environment starter
- cloud provider starter YAML
- local-worker starter YAML
- image-provider starter YAML
- Kilo Gateway starter YAML
- BLACKBOX AI starter YAML
- matching provider
.envexamples
Use these before rolling out a new provider or client:
./scripts/faigate-provider-catalog --refresh
./scripts/faigate-doctor
./scripts/faigate-doctor --refresh-catalog
./scripts/faigate-provider-probe --refresh-catalog
./scripts/faigate-onboarding-report
./scripts/faigate-onboarding-validateThese helpers catch missing env placeholders, rollout blockers, provider capability gaps, and profile issues before live traffic hits the gateway.
Gate can mirror selected provider source pages into the local DB and refresh them conservatively on startup.
provider_source_refresh:
enabled: true
on_startup: true
timeout_seconds: 10.0
interval_seconds: 21600
providers:
- anthropic
- blackbox
- deepseek
- google
- kilo
- openaiNotes:
- startup refresh is best-effort and should not block the service if docs are unavailable
interval_secondscontrols the conservative background refresh loop after startup- source snapshots live in the same local DB as metrics
- for providers with a usable local
modelsendpoint, Gate also mirrors key-specific model visibility per configured route and compares that against the global source snapshot - local billing overlays such as subscription or quota windows belong in the local account profile layer, not in the global provider snapshot