hosted-model-agents
Deploy hosted or local models as agent runtimes (Hugging Face router + Hub MCP + Spaces + Endpoints, Modal/RunPod/Lightning, Azure Foundry, Ollama/LM Studio/llama.cpp, Cursor Max/auth2api), register them in .agents/models.json, reach them via the inference-hub MCP (models_list/chat/chat_many) or rendered provider blocks, then attach tools in the local harness. Use when picking where a model runs, wiring OpenAI /v1 or Gradio MCP, or adding tool loops for agents. Any model that emits tool_calls.
- License 许可
- MIT
- 最近更新
- 2026-11-02
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- hosted-model-agents
- metadata
- { "status": "active", "valid_as_of": 1788307200000 }
- description
- Deploy hosted or local models as agent runtimes (Hugging Face router + Hub MCP + Spaces + Endpoints, Modal/RunPod/Lightning, Azure Foundry, Ollama/LM Studio/llama.cpp, Cursor Max/auth2api), register them in .agents/models.json, reach them via the inference-hub MCP (models_list/chat/chat_many) or rendered provider blocks, then attach tools in the local harness. Use when picking where a model runs, wiring OpenAI /v1 or Gradio MCP, or adding tool loops for agents. Any model that emits tool_calls.
02 资源文件 2
- 参考文档recipes/hf-router-featherless.md3.5 KB
- 参考文档recipes/ollama-local.md3.2 KB
03 SKILL.md 正文
Hosted model agents (environment + tools, not one model)
Job: pick an environment, deploy a runtime, then give an agent persona tools. The model family (Qwen, Llama, GPT, Grok, ...) is a checkpoint choice, not the skill.
Three layers. Mixing them is how the last pass went wrong.
| Layer | What it is | Estate surface |
|---|---|---|
| Control plane | Search, push, Spaces CRUD, papers, Hub files | Hugging Face Hub MCP huggingface (https://huggingface.co/mcp?login). Claude-targeted in agents.json. Reuse HUGGINGFACE_TOKEN / HF_TOKEN. |
| Runtime | Something that runs weights and speaks chat | HF router /v1, Space Gradio UI, Space OpenAI /v1, Inference Endpoint / TGI / vLLM, Modal GPU fn, Foundry deploy, local Ollama / LM Studio / llama-server, Cursor Max |
| Harness | Who executes tools and who prompts the agent | Local Cursor/Claude/Codex process. Allowlist + schema. Persona = system prompt pack, not a new MCP. |
Read environments.md for where to deploy, tool-loop.md for how to give tools, profiles.md for red-team / learner / coder packs, evals.md for the eval gate.
Hard rules
- Hub MCP is first-class for Hugging Face as an environment. Use it (or the official HF plugin where mounted) for Hub work. Do not invent a second Hub MCP. Cursor may not mount it (
targets: claude) - then usehuggingface_hub/ Hub HTTP with the same token, not a fake server. - An inference URL is not Hub MCP. A router model, a Space
/v1/chat/completionsor a TGI endpoint is a runtime. Call it with process-local HTTP (OpenAI SDK, a small wrapper) or throughinference-hub. Do not register every GPU URL inagents.jsonas MCP - that explodes the tool catalogue (mcp-fleet-curation) and is the wrong layer. The ONE inference MCP row isinference-hub; endpoints and models live in.agents/models.json, never as more MCP rows. - The hosted model proposes; the harness executes.
tool_callscome back over HTTP/MCP. Shell, files, HexStrike, browsers stay local after allowlist + JSON-schema checks. Do not grow a remote shell on a Space to "make tools work." Do not let the router execute remote MCP tools for you (see tool-loop.md). - Personas are prompt packs, not skills named after a checkpoint. One runtime can host a red-team reporter, a literature learner, or a coding worker by swapping
messages[0]and thetoolslist. - G-32 is Cursor-quota wrapping, not "ban HF MCP." G-32 =
ai-mode/*-cursorstay process-local to auth2api:8317; no persistent global Cursor-bridge env. Hugging Face Hub MCP is unrelated. G-36 = at most onecursor-agentprocess (RAM). Neither lock forbids deploying models on HF.
GPU rental / cloud-hub multiplex: skill cloud-infra-toolchain. Azure model deploy: microsoft-foundry. Action-space design: agent-harness-construction. OpenRouter is a spend-capped sidecar only - never Cursor BYOK (openrouter-routing, lock L1). All estate locks in one place: docs/plans/estate-locks.md.
Registry + hub (architecture as of 2026-09-02)
.agents/models.jsonis the SSOT of endpoints and models. Closed schema (endpoints{},models{},aliases{},slots{},locks[],policy). Secrets by NAME only: an endpoint'sauth.envnames an environment variable (the HF router row namesHUGGINGFACE_TOKEN_INFERENCE); no value ever appears in the registry, a rendered config, a log or a doc (L6). Capability lattice per endpoint and model:native > probed > declared > emulated > absentforwire.*andfeatures.*; model rows may only override downward. Every row carriestargets{}for all ten runtimes,denyCallers[],resource.ramBytesand itslocks[]. Validator:.agents/scripts/models_control_plane.py(rule ids V1-V20) with the CLI.agents/scripts/validate_models_control_plane.py.inference-hubis the ONE door for the MCP-only runtimes Claude Code, Cursor, Agy and Gemini CLI. It lives intools/mcp/inference-hub/, listens on127.0.0.1:8901, and exposes an MCP face (POST /mcp, toolsmodels_list,chat,chat_many,probe,budget_status) plus an OpenAI/v1face (GET /v1/models,POST /v1/chat/completions,GET /healthz). Use:models_listfirst, thenchat model="glm-5.3"(model id,id@endpoint, or an alias);chat_manyfor fan-out ({requests: [...]}or{prompt, models: [...], n}; per-endpoint semaphores, no head-of-line blocking). Onechat= exactly one model round; the caller executestool_calls. The request never acceptsbase_url,api_key,providerorheaders; the hub refuses prompts that contain a credential value (REFUSED_SECRET_IN_PROMPT). Lazy start: the stdio shim.agents/scripts/inference_hub_stdio.py(theagents.jsonrow) starts the hub on first call, idle-exit 600 s, one resident process at most (the bind on 8901 is the mutex, L4).- Native runtimes take rendered provider blocks, not the hub. Codex, Grok, Goose, OpenCode, Aider and Fabric get their provider/model blocks rendered from the registry by
.agents/scripts/merge_generated_<runtime>_models.py(shared module.agents/scripts/models_materialize_common.py). Dry run is the default;--writeis explicit and per runtime;--checkreports drift; only managed blocks are touched; secrets are rendered as each runtime's own env-reference syntax. Codex is rendered last: its renderer floorswire.responses >= probed, never writeswire_api = "chat", and smoke-testscodex --versionwith a rollback. Cloud agents never run--writeagainst a real config. - Routing policy + PACE live in
.agents/routing-policy.json(validator.agents/scripts/routing_policy.py): per task classprimary,escalate_to[],floors{},exponents{quality, speed, cost},spend_share,pace {P, A, C, E, triggers[]},justification. Names only; every name must exist in the registry; the PACE rungs must be distinguishable means (at most onecursor-*rung, at least one non-network rung,E=basic-memory :8765+agent-mail :8812handoff); OpenRouter rungs only in CLI/Codex task classes (L1). - Gone:
glm53-spaceandqwen-space. D1 = hard delete (2026-09-02): theglm53-spaceMCP row andtools/mcp/glm53-spaceare removed;merge_generated_cursor_mcp.pylistsglm53-spaceas retired andinference-hubtook its Cursor safe-default adapter slot. The capability is kept (L7) as modelglm-5.3on endpointhf-router(remote idzai-org/GLM-5.3:zai-org):chat model="glm-5.3"through the hub. Theqwen-spacewrapper and theqwen-space-tool-apiskill are not on this branch; where a box-side copy still exists it is a tombstone that points here. Do not re-create either as an MCP server.
One-line decision
- Need Hub search / Space metadata / papers -> HF Hub MCP (or Hub CLI).
- Need tokens out of a GPU -> runtime
/v1or Gradio; from Claude / Cursor / Agy / Gemini, always viainference-hub. - Need a model in Codex / Grok / Goose / OpenCode / Aider / Fabric -> rendered provider block from the registry.
- Need the agent to do something -> local tools + tool loop.
Worked HF Space OpenAI example (not the SSOT): recipes/hf-space-openai.md. Provider-pinned featherless route for the abliterated/WRN offsec checkpoints (consumed by the consult-offsec MCP): recipes/hf-router-featherless.md. The four local Ollama offsec models at 64K context (route=local for cred-laden consults): recipes/ollama-local.md.
04 同仓库更多 Skills
clarify-requirements
Resolve genuine pre-execution ambiguity by scanning repo context, generating 1-6 grounded options, and asking 1-3 focused questions via AskUserQuestion. NOT for mid-task use (injection risk); NOT when the goal is already unambiguous; use to disambiguate vague prompts before any file edits.
openmm-md
Run FREE, open-source, Windows-native GPU molecular dynamics via the openmm-md MCP (OpenMM + CUDA on the local NVIDIA GPU). Use for protein / protein-ligand MD when you want a free stack or are on Windows without a Schrodinger license. Covers the full workflow (prepare, solvate, minimize, equilibrate, production, analyze, mmgbsa) AND an honest decision guide vs Schrodinger Desmond, including how to run Desmond legitimately on Linux or a cloud GPU with a real license. This is a deliberately LESSER free alternative and does NOT replace the schrodinger MCP tools. Do NOT use it to pick a free tool when a validated FEP+, WaterMap, IFD-MD, or Prime MM-GBSA result is actually required.
visual-review
Take screenshots of web pages and UI using Playwright for visual review and iteration
status
Diagnostic status report — shows metaswarm installation state, project setup, and potential issues
start
Use when starting work on any task, when the user mentions metaswarm, or when the user wants to begin tracked development work
setup
Interactive project setup — detects your project, configures metaswarm, writes project-local files