openfang icon indicating copy to clipboard operation
openfang copied to clipboard

Feature Request: Support custom model providers (OpenAI-compatible endpoints)

Open kongwua opened this issue 9 months ago • 8 comments

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

  1. Enterprise deployments — internal model services behind VPN
  2. Research environments — quickly test new self-hosted models
  3. Migration path — easier transition from OpenClaw, LiteLLM, etc.

kongwua avatar Mar 01 '26 02:03 kongwua

I would like that too, in openfang init

vuthanhtrung2010 avatar Mar 01 '26 03:03 vuthanhtrung2010

Great Idea,strongly want that!

Alyle avatar Mar 01 '26 04:03 Alyle

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

  1. Enterprise deployments — internal model services behind VPN
  2. Research environments — quickly test new self-hosted models
  3. Migration path — easier transition from OpenClaw, LiteLLM, etc.

Rightpartners avatar Mar 01 '26 04:03 Rightpartners

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

  1. Enterprise deployments — internal model services behind VPN
  2. Research environments — quickly test new self-hosted models
  3. Migration path — easier transition from OpenClaw, LiteLLM, etc.

Rightpartners avatar Mar 01 '26 04:03 Rightpartners

Please, Implement this. It is needed for security and flexibility.

DaBlitzStein avatar Mar 02 '26 13:03 DaBlitzStein

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.

jaberjaber23 avatar Mar 02 '26 22:03 jaberjaber23

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.

jorgeih avatar Mar 10 '26 11:03 jorgeih

Yes, I agree with your comment @jorgeih

lyphilong avatar Mar 16 '26 14:03 lyphilong