Skip to content

feat: multi-provider LLM support (v4.0)#2

Merged
machinelearnear merged 10 commits intomainfrom
feature/v4-multi-provider-llm
Mar 11, 2026
Merged

feat: multi-provider LLM support (v4.0)#2
machinelearnear merged 10 commits intomainfrom
feature/v4-multi-provider-llm

Conversation

@machinelearnear
Copy link
Copy Markdown
Contributor

@machinelearnear machinelearnear commented Mar 11, 2026

Summary

  • Multi-provider LLM support via a single env var (SIMULADORES_PROVIDER_PROFILE) — agents use logical roles (capable, fast) resolved to provider-specific models at deployment time
  • Five provider profiles: Anthropic Vertex AI (default), OpenRouter, LiteLLM proxy, hospital-airgapped (vLLM + Ollama), local-ollama (dev)
  • Provider-aware infrastructure: client factory with gateway switching, cache adapter for cross-provider compatibility, mem0 memory config for air-gapped deployments
  • LiteLLM/vLLM/Ollama configs for self-hosted and air-gapped hospital environments
  • Multi-provider eval suite via promptfoo with X-Provider-Profile header support
  • Documentation updated: README, ARCHITECTURE, VISION, DATA_FLOW, PROVIDERS.md, CLAUDE.md all reflect v4.0

Key files

Area Files
Provider config core/provider_config.py, config/providers/*.toml
Client factory llm/client_factory.py
Cache adapter prompt/cache_adapter.py
Agent migration agents/base.py, agents/{santos,medina,lamponne,ravenna}.py
Domain manifests domains/{dce,idp,has}/domain.toml
Memory memory/mem0_backend.py (provider-aware)
Infrastructure infra/litellm/, infra/vllm/, docker-compose.yml
Eval suite tests/evals/promptfooconfig.yaml
Documentation README.md, docs/{ARCHITECTURE,VISION,DATA_FLOW,PROVIDERS}.md, CLAUDE.md

Commits (10)

  1. refactor(domains): replace hardcoded model strings with logical roles in domain.toml
  2. feat(core): add ProviderConfig loader for multi-provider deployment profiles
  3. feat(llm): add provider-aware client factory with gateway switch
  4. fix(llm): update docstring and add OpenRouter header assertions
  5. feat(agents): add logical role mapping and provider-aware model resolution
  6. feat(prompt): add cache control adapter for cross-provider compatibility
  7. feat(infra): add LiteLLM proxy, vLLM, Ollama configs and provider profiles
  8. feat(memory): add provider-aware mem0 config for air-gapped deployments
  9. feat(evals): add multi-provider promptfoo eval suite and PROVIDERS.md
  10. docs: update documentation to reflect v4.0 multi-provider architecture

Test plan

  • All 1,299 existing tests pass (0 regressions)
  • 57 new tests: provider config (22), client factory (8), agent integration (8), cache adapter (11), base agent roles (7), backward compat (1)
  • Validate OpenRouter profile with live API key
  • Validate LiteLLM Docker proxy startup
  • Run promptfoo eval suite against multiple profiles

🤖 Generated with Claude Code

machinelearnear and others added 10 commits March 11, 2026 12:10
… in domain.toml

Replace provider-specific model identifiers (claude-opus-4-6, claude-sonnet-4-6)
with logical role names (capable, fast) across all three domain manifests. Roles
will be resolved at deployment time via provider config (Task 9.2).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rofiles

Introduce provider configuration system that maps logical roles (capable,
fast, extract, local) to real provider/model strings via TOML profiles.
A single env var SIMULADORES_PROVIDER_PROFILE selects the active profile.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implement build_instructor_client() that creates instructor-patched
clients for DIRECT (Vertex AI), OPENROUTER, and LITELLM gateways
based on ProviderConfig. Adds openai>=1.50 dependency for
OpenAI-compatible gateway support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ution

Agents now resolve models via AGENT_ROLES + ProviderConfig when available,
falling back to AGENT_MODELS for backward compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Strips Anthropic-specific cache_control headers for non-Anthropic providers.
Passes through for DIRECT, OpenRouter+Anthropic, and LiteLLM gateways.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…files

- LiteLLM proxy added to docker-compose.yml with health check
- LiteLLM configs: cloud (Anthropic), hospital (vLLM), dev (Ollama)
- vLLM hospital docker-compose with guided decoding
- local-ollama provider profile for zero-API-key dev
- SIMULADORES_PROVIDER_PROFILE env var wired into docker services

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
MemoryConfig dataclass added to ProviderConfig for specifying local LLM
and embedder backends. Hospital-airgapped profile includes Ollama config
for fully local memory extraction.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Eval suite tests against both anthropic-vertex and openrouter providers.
PROVIDERS.md documents the compatibility matrix and known limitations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update README, ARCHITECTURE, VISION, DATA_FLOW, and CLAUDE.md to reflect
the multi-provider LLM support: logical roles, provider profiles,
air-gapped deployments, and updated project structure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@machinelearnear machinelearnear merged commit 7d11b48 into main Mar 11, 2026
0 of 4 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