openfang icon indicating copy to clipboard operation
openfang copied to clipboard

Feature: Ability to add custom provider/gatway (LiteLLM, Bifrost)

Open 9M6 opened this issue 9 months ago • 3 comments

Needed ability to add more custom providers or add AI gateway

9M6 avatar Mar 02 '26 01:03 9M6

its urgent

tiggerhat avatar Mar 02 '26 03:03 tiggerhat

Already supported since v0.3.0 via the provider_urls config section and per-agent base_url. Add a [provider_urls] section to config.toml to set custom base URLs for any provider. You can also set base_url directly in individual agent.toml files. Any OpenAI-compatible gateway (LiteLLM, Bifrost, etc.) works by pointing the provider URL to your gateway endpoint.

jaberjaber23 avatar Mar 02 '26 22:03 jaberjaber23

I tried like this but it's not working, I get: {"error":"No API key configured. Remote access denied. Configure api_key in ~/.openfang/config.toml"}

api_listen = "0.0.0.0:4200" # HTTP API bind address (use 0.0.0.0 for public)

[provider_urls] litellm = "http://172.17.0.1:4000/v1"

[routing] simple_model = "gpt-4.1" medium_model = "gpt-4.1" complex_model = "gpt-5" simple_threshold = 100 complex_threshold = 500

[default_model] provider = "litellm"
model = "gpt-4.1"
api_key_env = "LITELLM_API_KEY" api_key = "sk-......"

YOZZOPANOZZO avatar Mar 03 '26 00:03 YOZZOPANOZZO