agentleFS
botirkhaltaevbotirkhaltaev/botir-skills/skills/modal-endpoints/SKILL.md

modal-endpoints

Skill4 starsChanged 3 months agoApache-2.0View on GitHub

Modal Auto Endpoints — production LLM inference with modal endpoint CLI. Use when deploying OpenAI-compatible chat completions for catalog or custom models (HF/Volume), configuring proxy tokens, routing regions, or choosing Endpoints vs custom @app.server / vLLM Functions. Triggers on: "modal endpoint", "Auto Endpoints", "modal endpoint create", "OpenAI-compatible Modal", "LLM endpoint Modal", "proxy tokens Modal".

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when deploying Auto Endpoints: managed, OpenAI API-compatible LLM inference on Modal with minimal configuration (SDK/CLI …

    line 14
  2. Distinctive:

    Prefer managed speculative decoding / recipes over writing server code first

    line 24
  3. Very specific:

    Prefer a custom @app.server when you need full control of engine flags, multi-model routers, or non-OpenAI protocols.

    line 26
  4. Very specific:

    Always pass a catalog --model (recipe base), then custom weights:

    line 60
  5. Distinctive:

    Stop tears down containers and stops compute billing.

    line 102
  6. Very specific:

    Create proxy token; pass both headers.

    line 118
  7. Distinctive:

    Prefer Volume-cached weights for custom checkpoints

    line 123
  8. Distinctive:

    Use the base/catalog repo id (or custom HF id), not the Endpoint display name

    line 126

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Modal Endpoints

Use this skill when deploying Auto Endpoints: managed, OpenAI API-compatible LLM inference on Modal with minimal configuration (SDK/CLI 1.5.1+).

Endpoints are built on Modal Servers. For custom server code, see modal-servers. For hand-rolled vLLM/SGLang Functions, see modal-web-serving / modal-scaling-performance.

When to Use This Skill

  • Need a production LLM API with one CLI command
  • Serving catalog models (Qwen, Kimi, Gemma, DeepSeek, Nemotron, GPT-OSS, GLM, …)
  • Serving fine-tunes from Hugging Face or a Modal Volume
  • Want scale-to-zero, usage-based GPU billing, and tuned engine recipes
  • Prefer managed speculative decoding / recipes over writing server code first

Prefer a custom @app.server when you need full control of engine flags, multi-model routers, or non-OpenAI protocols.

Quick Start

# Proxy token (required unless --unauthenticated)
modal workspace proxy-tokens create
# With RBAC:
modal workspace proxy-tokens allow wk-... main

modal endpoint create --model Qwen/Qwen3.5-4B
# Optional explicit name; default derived from model id
modal endpoint create --name agent --model zai-org/GLM-5.2-FP8

Dashboard: Endpoints tab mirrors CLI options.

Calling the API

OpenAI Chat Completions under /v1. Model name = base catalog repo id (or custom HF repo id).

curl "<endpoint-url>/v1/models" \
  -H "Modal-Key: $MODAL_PROXY_TOKEN_ID" \
  -H "Modal-Secret: $MODAL_PROXY_TOKEN_SECRET"

# Or for quick tests (auth injected; higher latency):
modal curl "<endpoint-url>/v1/models"

Find URLs: dashboard or modal endpoint list.

Custom Weights

Always pass a catalog --model (recipe base), then custom weights:

# Hugging Face fine-tune
modal endpoint create \
  --name my-ft \
  --model Qwen/Qwen3.6-27B \
  --custom-hf-repo org/my-ft \
  --custom-hf-revision <sha> \
  --custom-hf-token "$HF_TOKEN"   # if gated/private

# Modal Volume (directory must contain config.json)
modal endpoint create \
  --name my-volume-ft \
  --model Qwen/Qwen3.5-4B \
  --custom-volume-name my-volume \
  --custom-volume-path /checkpoints/1234

Placement

FlagMeaning
--routing-regionProxy anchor near callers: us-west (docs default for endpoints), us-east, ca-central, eu-west, ap-south
--compute-regionPin container regions (repeatable); incurs region multiplier
--colocate-computeRun compute in the routing region
modal endpoint create \
  --model Qwen/Qwen3.5-4B \
  --routing-region us-east \
  --compute-region us-west

Lifecycle Management

modal endpoint list --env prod
modal endpoint list --env prod --json
modal endpoint stop qwen3-5-4b --env prod

Stop tears down containers and stops compute billing. Autoscaling overrides are adjustable in the UI. Idle scale-to-zero → no compute charge while idle.

Endpoints vs Custom Servers vs Web Functions

NeedUse
Fastest path to OpenAI-compatible LLM APIEndpoints (modal endpoint)
Custom engine process, sticky sessions, full Server knobs@app.server (modal-servers)
FastAPI/ASGI app as a Functionmodal-web-serving
Batch .map / .spawn inferenceFunctions + modal-parallel-execution

Inspect generated Server source: Endpoint dashboard Source panel.

Symptom Triage

401 on requests

  • Create proxy token; pass both headers; with RBAC allow the Environment
  • Or recreate with --unauthenticated if public is intentional

Endpoint slow to become ready

  • Large models / weight pulls — watch dashboard provisioning
  • Prefer Volume-cached weights for custom checkpoints

Wrong model name in API calls

  • Use the base/catalog repo id (or custom HF id), not the Endpoint display name

Reference Map

  • references/endpoint-cli.md — create/list/stop and auth flags
  • references/custom-weights-placement.md — HF/Volume weights and regions
  • references/when-to-use-endpoints.md — product boundaries

Guardrails

  • Requires client/CLI with Endpoints support (1.5.1+)
  • Secrets for proxy tokens are shown once at creation — store safely
  • Region pinning multiplies cost — mention when recommending --compute-region
  • Endpoints bill standard GPU/CPU rates while containers run

Key References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.