Skip to content

fix: save API key to model config for custom endpoints (#4182) - #4202

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-bf538de7
Mar 31, 2026
Merged

fix: save API key to model config for custom endpoints (#4182)#4202
teknium1 merged 1 commit into
mainfrom
hermes/hermes-bf538de7

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Fixes #4182. Custom cloud endpoints (Together.ai, RunPod, Groq, etc.) lost their API key after #4165 removed OPENAI_API_KEY .env saves. Now saves model.api_key to config.yaml in all three custom endpoint code paths. Each endpoint carries its own key — no shared env var needed, supports unlimited custom endpoints.

Custom cloud endpoints (Together.ai, RunPod, Groq, etc.) lost their
API key after #4165 removed OPENAI_API_KEY .env saves.  The key was
only saved to the custom_providers list which is unreachable at
runtime for plain 'custom' provider resolution.

Save model.api_key to config.yaml alongside model.provider and
model.base_url in all three custom endpoint code paths:
- _model_flow_custom (new endpoint with model name)
- _model_flow_custom (new endpoint without model name)
- _model_flow_named_custom (switching to a saved endpoint)

The runtime resolver already reads model.api_key (runtime_provider.py
line 224-228), so the key is picked up automatically.  Each custom
endpoint carries its own key in config — no shared OPENAI_API_KEY
env var needed.
@teknium1
teknium1 merged commit 1bca6f3 into main Mar 31, 2026
4 of 5 checks passed
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.

1 participant