Skip to content

feat: Add Azure Foundry provider with OpenAI/Anthropic API mode selection#9029

Closed
TechPrototyper wants to merge 1 commit into
NousResearch:mainfrom
TechPrototyper:feature/azure-foundry-provider
Closed

feat: Add Azure Foundry provider with OpenAI/Anthropic API mode selection#9029
TechPrototyper wants to merge 1 commit into
NousResearch:mainfrom
TechPrototyper:feature/azure-foundry-provider

Conversation

@TechPrototyper

@TechPrototyper TechPrototyper commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Azure Foundry as a new provider, enabling users to connect Hermes Agent to Azure AI endpoints with flexible API format selection.

Why This Matters

  • Enterprise demand: Azure Foundry is increasingly used for deploying both OpenAI and Claude models in enterprise environments
  • Dual API support: Supports both OpenAI-style (/v1/chat/completions) AND Anthropic-style (/v1/messages) endpoints — users select the format during setup
  • Production-tested: Currently running this configuration successfully (you are reading output generated via Azure Foundry right now!)

Changes (236 lines, 6 files)

File Changes
hermes_cli/auth.py Provider registry entry
hermes_cli/config.py AZURE_FOUNDRY_API_KEY + AZURE_FOUNDRY_BASE_URL env vars
hermes_cli/main.py hermes model flow with endpoint/API-mode/key/model wizard
hermes_cli/models.py Provider entry (empty model list — user-provided)
hermes_cli/providers.py HermesOverlay with runtime transport selection
hermes_cli/runtime_provider.py Runtime resolution for both API modes

Usage

hermes model
# Select "Azure Foundry"
# Enter endpoint URL
# Choose API format (OpenAI or Anthropic style)
# Enter API key and model name

Testing

  • Manual testing with Claude via Azure Foundry (Anthropic-style)
  • Manual testing with GPT-4 via Azure Foundry (OpenAI-style)
  • Follows existing provider patterns in codebase

🙏 Request for quick review: I'd like to switch back to tracking main without maintaining local patches. Happy to address any feedback promptly!

…tion

Add support for Azure Foundry as a new inference provider. Azure Foundry
endpoints can use either OpenAI-style (/v1/chat/completions) or
Anthropic-style (/v1/messages) API formats.

Changes:
- Add azure-foundry to PROVIDER_REGISTRY (auth.py)
- Add azure-foundry overlay in HERMES_OVERLAYS (providers.py)
- Add empty model list for azure-foundry (models.py)
- Add _model_flow_azure_foundry() interactive setup (main.py)
- Add azure-foundry runtime resolution with api_mode support (runtime_provider.py)
- Add AZURE_FOUNDRY_API_KEY and AZURE_FOUNDRY_BASE_URL env vars (config.py)

Usage:
  hermes model -> More providers -> Azure Foundry

The setup wizard prompts for:
- Endpoint URL
- API format (OpenAI or Anthropic-style)
- API key
- Model name

Configuration is saved to config.yaml (model.provider, model.base_url,
model.api_mode, model.default) and ~/.hermes/.env (AZURE_FOUNDRY_API_KEY).
@teknium1

Copy link
Copy Markdown
Contributor

Merged via #15845 along with the other open Azure PRs as one consolidated salvage + an auto-detection feature on top (URL sniff + /models probe + Anthropic Messages fallback + context-length resolution).

Your commit was cherry-picked with authorship preserved (3a7653dd1 on main). Thanks @TechPrototyper — this landed because of your work.

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard comp/agent Core agent loop, run_agent.py, prompt builder labels Apr 26, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Superseded by #15845 which merged — consolidates fixes from #9029, #4599, #10086, and #8766.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants