Feature Request: Support custom model providers (OpenAI-compatible endpoints)
Problem
Currently OpenFang only supports a fixed list of 27 built-in providers. This prevents users from:
- Using self-hosted models with custom endpoints (e.g.,
https://llm.company.internal/v1) - Connecting to experimental/niche providers not yet officially supported
- Migrating from OpenClaw which supports arbitrary OpenAI-compatible APIs
Proposed Solution
Add support for custom OpenAI-compatible endpoints via configuration:
# openfang.yaml
providers:
- name: "my-custom-llm"
type: custom
base_url: "https://llm.internal.company.com/v1"
api_key: "${CUSTOM_API_KEY}" # or env var reference
models:
- id: "gpt-custom"
context_window: 128000
supports_vision: true
supports_tools: true
Alternative: Generic OpenAI Provider
A simpler approach could be adding a generic openai-compatible provider that accepts any base URL:
openfang provider add openai-compatible \
--name "internal-llm" \
--base-url "https://llm.internal.company.com/v1" \
--api-key "$API_KEY"
Use Cases
- Enterprise deployments — internal model services behind VPN
- Research environments — quickly test new self-hosted models
- Migration path — easier transition from OpenClaw, LiteLLM, etc.
I would like that too, in openfang init
Great Idea,strongly want that!
Problem
Currently OpenFang only supports a fixed list of 27 built-in providers. This prevents users from:
- Using self-hosted models with custom endpoints (e.g.,
https://llm.company.internal/v1)- Connecting to experimental/niche providers not yet officially supported
- Migrating from OpenClaw which supports arbitrary OpenAI-compatible APIs
Proposed Solution
Add support for custom OpenAI-compatible endpoints via configuration:
# openfang.yaml providers: - name: "my-custom-llm" type: custom base_url: "https://llm.internal.company.com/v1" api_key: "${CUSTOM_API_KEY}" # or env var reference models: - id: "gpt-custom" context_window: 128000 supports_vision: true supports_tools: trueAlternative: Generic OpenAI Provider
A simpler approach could be adding a generic
openai-compatibleprovider that accepts any base URL:openfang provider add openai-compatible \ --name "internal-llm" \ --base-url "https://llm.internal.company.com/v1" \ --api-key "$API_KEY"Use Cases
- Enterprise deployments — internal model services behind VPN
- Research environments — quickly test new self-hosted models
- Migration path — easier transition from OpenClaw, LiteLLM, etc.
Problem
Currently OpenFang only supports a fixed list of 27 built-in providers. This prevents users from:
- Using self-hosted models with custom endpoints (e.g.,
https://llm.company.internal/v1)- Connecting to experimental/niche providers not yet officially supported
- Migrating from OpenClaw which supports arbitrary OpenAI-compatible APIs
Proposed Solution
Add support for custom OpenAI-compatible endpoints via configuration:
# openfang.yaml providers: - name: "my-custom-llm" type: custom base_url: "https://llm.internal.company.com/v1" api_key: "${CUSTOM_API_KEY}" # or env var reference models: - id: "gpt-custom" context_window: 128000 supports_vision: true supports_tools: trueAlternative: Generic OpenAI Provider
A simpler approach could be adding a generic
openai-compatibleprovider that accepts any base URL:openfang provider add openai-compatible \ --name "internal-llm" \ --base-url "https://llm.internal.company.com/v1" \ --api-key "$API_KEY"Use Cases
- Enterprise deployments — internal model services behind VPN
- Research environments — quickly test new self-hosted models
- Migration path — easier transition from OpenClaw, LiteLLM, etc.
Please, Implement this. It is needed for security and flexibility.
Already supported since v0.3.0. You can use any OpenAI-compatible endpoint by setting provider_urls in config.toml or base_url in agent.toml. Example:
[provider_urls] my-custom-llm = "https://llm.internal.company.com/v1"
Then set provider = "my-custom-llm" in your agent config. The system uses the OpenAI-compatible driver for any provider not in the built-in list.
OpenClaw's onboard already includes the option to choose a Custom provider/model (openai compatible). The lack of this option in OpenFang significantly worsens the user experience for those who want to use a local model from the start.
Yes, I agree with your comment @jorgeih