modal-vllm
БесплатноЗапускает вложенные скриптыНе проверенServe a model via vLLM on Modal as an HTTPS endpoint with strict leave-no-trace lifecycle. Use when an experiment needs to query an LLM as a remote API (chat…
от ChicagoHAI★ 164 звезды на GitHubОб этом скилле
modal-vllm
Cloud vLLM serving via Modal, wired into NeuriCo's reproducibility and cleanup model.
When to use
Use this skill when your experiment needs to:
- Query a model >7B as an HTTPS endpoint (OpenAI-compatible API via vLLM)
- Run synthetic data generation, distillation, or judging against a deployed model
- Test a fine-tuned LoRA adapter via the API (vLLM hot-loads adapters)
Do not use this skill if:
- You're training a model (use
modal-traininginstead) - You only need a single one-shot inference call (
modal runagainstmodal-trainingeval template is cheaper) - You're querying a model already hosted elsewhere (OpenAI, Anthropic, etc. — use their native client)
Contract (read first)
Same three rules as modal-training, with two serving-specific additions:
- Ephemeral compute, persistent workspace. All Modal-side state lives inside a per-experiment environment named
neurico-<EXP_ID>. - Pull before teardown.
lifecycle.pull_all()must succeed beforeteardown()runs. - Use the scaffolder.
scripts/new_modal_app.py.
Plus:
- Deployed apps must be explicitly stopped. Unlike
modal run,modal deploycreates persistent apps. The vLLM lifecycle callsmodal app stopbefore deleting the environment. The scaffolder bakes this into every generated template. - Endpoint credentials live in the workspace, never in code. Proxy-auth tokens (
MODAL_KEY,MODAL_SECRET) are written to.neurico/modal_endpoint.jsonat deploy time and read by the experiment code. They are destroyed at teardown with the rest of the environment.
Prerequisites
One-time setup on your HOST machine (not inside the container)
modal token new # opens browser, authenticates, writes ~/.modal.toml
Inside the neurico Docker container, ~/.modal.toml is mounted read-only
from your host (same pattern as Claude / Codex / Gemini credentials), so
modal is authenticated automatically on every run. Do not run
modal token new inside the container — no browser exists there.
Optional: Hugging Face token (only for gated models)
Add HF_TOKEN=hf_xxx to neurico/.env if your serving target uses gated
models or private repos. The lifecycle handles per-environment provisioning
and cleanup. Public models need nothing — pass --no-hf-secret to the
scaffolder to drop the HF entry.
Additional secrets
The scaffolder accepts repeated --secret NAME=ENV_VAR[,ENV_VAR2] flags
for any other Modal secrets the served model needs (e.g. a private weights
host). The lifecycle mints them per-env and cleans them up at teardown.
Proxy auth tokens (per deploy, one-time per endpoint)
vLLM endpoints use proxy auth. Mint a token pair in the Modal dashboard:
Modal dashboard -> Settings -> Proxy Auth Tokens -> Create
Pass the values to the capture-endpoint step once after modal deploy;
the lifecycle stores them in .neurico/modal_endpoint.json for experiment
code to read, and clears them at teardown. You do not put them in any
.env file.
Verify
python .claude/skills/modal-vllm/scripts/check_modal_setup.py
# --probe creates+stops a tiny test deploy, ~10sec, no GPU
# --json for machine-readable output
Quickstart
1. Generate a serving deployment
python .claude/skills/modal-vllm/scripts/new_modal_app.py vllm-serve \
--exp-id "$(basename $(pwd))" \
--base-model "Qwen/Qwen2.5-7B-Instruct" \
--lora-repo "user/my-adapter" # optional
--out src/modal_serve.py
--lora-repo takes a HuggingFace Hub repo id. If the adapter was trained
via modal-training, push artifacts/final/ to HF Hub first (e.g.
huggingface-cli upload <user>/<repo> artifacts/final) and pass that repo
here. vLLM hot-loads adapters at startup; there's no Modal-side handoff
between the training and serving skills.
2. Deploy it
modal deploy --env=neurico-<EXP_ID> src/modal_serve.py
Modal prints a URL. Then mint a proxy-auth token pair from the Modal dashboard (Settings → Proxy Auth Tokens → Create) and pass it to the generated script's capture-endpoint subcommand — the template writes the URL + tokens into .neurico/modal_endpoint.json so experiment code can read them:
MODAL_KEY=wk-... MODAL_SECRET=ws-... \
python src/modal_serve.py capture-endpoint
3. Use it in experiment code
import json, os
ep = json.loads(open(".neurico/modal_endpoint.json").read())
# ep = {"url": "https://...modal.run", "key": "wk-...", "secret": "ws-..."}
# Use as OpenAI-compatible base URL with proxy-auth headers
4. Pull artifacts + stop + sweep when done
# 1. Snapshot endpoint provenance (writes redacted artifacts/vllm_endpoint.json,
# marks pull_complete=True in the sentinel — required before teardown).
python .claude/skills/modal-vllm/scripts/lifecycle.py pull --exp-id <EXP_ID>
# 2. Tear the env down (modal app stop -> modal environment delete -y ->
# clears the live .neurico
Установить modal-vllm в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл modal-vllm?
Serve a model via vLLM on Modal as an HTTPS endpoint with strict leave-no-trace lifecycle. Use when an experiment needs to query an LLM as a remote API (chat completions, generation) rather than running it locally.
Как установить скилл modal-vllm?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл modal-vllm запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic