Add pluggable provider routing for local and hosted backends#1
Add pluggable provider routing for local and hosted backends#1
Conversation
POST /api/config/model and POST /api/session/{id}/model previously
accepted any authenticated HF user, letting non-members of
ml-agent-explorers flip a session onto anthropic/claude-opus-4-6
which is billed to the Space's ANTHROPIC_API_KEY.
Add a require_huggingface_member dependency and apply it to both
routes. Org name is configurable via HF_EMPLOYEE_ORG env var,
defaulting to 'huggingface'. check_org_membership already caches
positive results for 5 min so the extra whoami-v2 round-trip is
amortized.
Non-HF users keep working on the session's default model.
Route `bedrock/<model>` model IDs through LiteLLM's Bedrock adapter with the same thinking/effort params as the `anthropic/` path. LiteLLM handles AWS auth (access keys or bearer token for SSO). Also adds boto3 as a core dependency (required by LiteLLM's Bedrock adapter). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Added a follow-up commit on this branch: local Rowan-style providers now expose reachability metadata in the model catalog, and CLI shows / for local lanes (, , , ).\n\nThis uses a short TTL probe against , can be disabled with , and is covered by tests. |
|
Follow-up on this branch: local Rowan-style providers now expose reachability metadata in the model catalog, and CLI /model shows lane up or lane down for local lanes (mlx/, ollama/, bld/, lm_studio/). This uses a short TTL probe against each configured base URL plus /models, can be disabled with ML_INTERN_SKIP_PROVIDER_PROBES=1, and is covered by tests. |
|
Added Rowan MCP wiring on top of the provider work. What changed:
This keeps Rowan MCP opt-in, env-driven, and usable for both local and remote/proxied deployments. |
|
Added default Rowan MCP policy on this branch.
Policy controls:
Tests cover the default allowlist and the override behavior. |
|
Added two Rowan-ready preset configs on this branch. Profiles:
The existing |
|
Added runtime config selection on this branch. You can now select Rowan profiles without copying files over
Both interactive and headless entrypoints now use the shared resolver, and tests cover preset resolution, explicit path override, and bad preset rejection. |
Summary
Downstream integration PR for
Spitfire-Cowboy/ml-intern.This branch does two distinct things:
#55,#60,#63,#66)This is the fork-side answer to upstream issue
huggingface/ml-intern#67.Review map
1. Provider architecture and upstream-aligned changes
2. Rowan and local-backend support
openrouter/<model>lm_studio/<model>opencode/<model>opencode-go/<model>mlx/<model>ollama/<model>bld/<model>openai-compat/<model>3. Rowan operator usability
/modelrowan-mcpwiring from envRowan-specific defaults
mlx/->MLX_SERVER_URLdefaulthttp://localhost:8080/v1ollama/->OLLAMA_BASE_URLdefaulthttp://localhost:11434/v1bld/->BLD_OLLAMA_BASE_URLdefaulthttp://192.168.50.252:11434/v1Rowan MCP behavior
ML_INTERN_ENABLE_ROWAN_MCP=1auto-injectsrowan-mcpif the config does not already define itROWAN_MCP_URLand optionalROWAN_MCP_TOKENdrive that injected serverROWAN_MCP_ALLOW_ALL_TOOLS=1ROWAN_MCP_ALLOWED_TOOLS=...ROWAN_MCP_BLOCKED_TOOLS=...Config profiles
Available presets:
defaultrowanrowan_research_saferowan_ops_fullSelection:
ML_INTERN_CONFIG_PRESET=<preset>ML_INTERN_CONFIG_PATH=/abs/path/to/config.jsonoverrides preset selectionTests
Ran:
Result:
29 passedUpstream split
Reasonable upstream candidates:
Fork-only pieces: