Skip to content

feat(cli): add custom provider setup in init wizard#50

Open
mfzzf wants to merge 2 commits intoRightNow-AI:mainfrom
mfzzf:feat/add-custom-provider-config
Open

feat(cli): add custom provider setup in init wizard#50
mfzzf wants to merge 2 commits intoRightNow-AI:mainfrom
mfzzf:feat/add-custom-provider-config

Conversation

@mfzzf
Copy link

@mfzzf mfzzf commented Feb 27, 2026

Summary

This PR adds support for configuring a custom OpenAI-compatible provider in the TUI init wizard.

Key updates

  • Add Custom as a selectable provider in Step 3 of 8
  • Introduce a new Step 4 of 8 to configure:
    • Provider name
    • API key env var (auto-derived, editable)
    • Base URL
    • Default model
  • Reuse configured custom values in subsequent steps:
    • API key input prompt (Step 5 of 8) shows provider + env var
    • Model selection uses the custom model as default

Validation

  • Provider name and model cannot be empty
  • base_url must start with http:// or https://

UX (Final Style)

Step 3 of 8

OpenFang Init  3 of 8
────────────────────────────────────────────────────────────
  Choose your LLM provider:

▸   Groq          requires GROQ_API_KEY (free tier)
    Gemini        requires GEMINI_API_KEY (free tier)
    DeepSeek      requires DEEPSEEK_API_KEY (cheap)
    Anthropic     requires ANTHROPIC_API_KEY
    OpenAI        requires OPENAI_API_KEY
    OpenRouter    requires OPENROUTER_API_KEY
    Together      requires TOGETHER_API_KEY
    Mistral       requires MISTRAL_API_KEY
    Fireworks     requires FIREWORKS_API_KEY
○ Ollama        local, no key needed
○ LM Studio     local, no key needed
○ Custom        local, no key needed

Step 4 of 8

OpenFang Init  4 of 8
────────────────────────────────────────────────────────────
  Configure custom OpenAI-compatible provider:

  Provider: custom-openai
  API env:  CUSTOM_OPENAI_API_KEY  (API key entered next step)
  Base URL: http://localhost:8000/v1
  Model:    gpt-5.2
  Example base_url: http://localhost:8000/v1

Step 5 of 8

OpenFang Init  5 of 8
────────────────────────────────────────────────────────────
  Enter your Custom (custom-openai) API key:

  ▸ •••••••••••••••█

    Or set CUSTOM_OPENAI_API_KEY environment variable

Why

Users running self-hosted or third-party OpenAI-compatible endpoints need first-class setup support in openfang init without hacking provider defaults or env names manually.


Testing

  • Select Custom in provider list and verify navigation to Step 4
  • Verify field editing for provider/env/base_url/model
  • Validate empty provider/model error handling
  • Validate base URL scheme check (http:// / https://)
  • Verify Step 5 API key prompt reflects custom provider/env var

@mfzzf mfzzf mentioned this pull request Feb 27, 2026
@mfzzf
Copy link
Author

mfzzf commented Feb 27, 2026

@jaberjaber23 Hi! I’ve implemented first-class Custom Provider support in openfang init in this PR #50. When you have a moment, could you please take a look? Would really appreciate your feedback 🙏

@OptionalCoin
Copy link

Hope this is implemented because many of use use CLIProxyAPI/OmniRouter.

@Chivier
Copy link

Chivier commented Feb 28, 2026

Hope this is implemented because many of use use CLIProxyAPI/OmniRouter.

Agree, this feature is essential

@mfzzf mfzzf force-pushed the feat/add-custom-provider-config branch from 7614884 to fc1aa62 Compare February 28, 2026 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants