AGENT SKILL

serving-and-cli

Operate Mellea 0.8.0.dev0's m CLI and OpenAI-compatible server safely, including serving, routing, response schemas, streaming, decomposition, migration, evaluation routing, and bounded adapter commands.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
serving-and-cli
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Operate Mellea 0.8.0.dev0's m CLI and OpenAI-compatible server safely, including serving, routing, response schemas, streaming, decomposition, migration, evaluation routing, and bounded adapter commands.
disable-model-invocation
true

02 资源文件 5

03 SKILL.md 正文

Serving and CLI

Use this route for the m entry point, m serve, POST /v1/chat/completions, GET /health, OpenAI-compatible clients, model routing, response formats, SSE streaming, m decompose, m fix, or the bounded CLI aspects of m alora and m eval. The operating contract is for Mellea 0.8.0.dev0 and Python 3.11+.

Route the task

  1. Run the safe bundled checker before invoking a side-effectful command: python scripts/check_cli_surface.py --mode static. To render installed help without executing a callback, use --mode help --target <name>.
  2. Read CLI reference for exact command families, current defaults, output files, prerequisites, and side effects.
  3. For m serve, request/response fields, structured output, routing, streaming, multimodal messages, and error envelopes, read Serving API.
  4. Before binding a socket or exposing a process, read Deployment and configuration.
  5. For missing extras, schema failures, port conflicts, backend errors, partial output, or command-safety recovery, read Troubleshooting.

Safety gates

  • Help and static inspection are safe. m serve imports user code and starts a blocking server; m decompose and m eval call models and write files; m fix genslots writes unless --dry-run; aLoRA commands may download a model, consume substantial compute, overwrite local files, prompt, or upload to Hugging Face Hub.
  • Require an explicit decision before a public bind, provider call, model download, training run, remote upload, or non-dry-run rewrite. Never use a side-effectful command as an installation probe.
  • Prefer 127.0.0.1 over the m serve wildcard default. The built-in service has no authentication, TLS, rate limiting, or authorization layer.
  • Treat request model as untrusted routing metadata. Route only through a fixed allowlist; never derive a provider URL, import, credential, or arbitrary model loader directly from it.
  • Validate json_schema before generation. A response schema affects output only when the served function accepts format and passes it into Mellea.
  • True incremental streaming needs an uncomputed thunk and a streaming-capable backend. A computed result becomes one SSE content chunk.

Minimal workflows

Plan a serving request

  1. Choose a local host and an unused port; prefer 127.0.0.1:8080.
  2. Confirm the app's serve signature and backend prerequisites without importing untrusted, side-effectful application code.
  3. Draft one minimal request with model and a user message.
  4. Add exactly one advanced feature at a time: stream, response_format, tools, multimodal content, or model routing.
  5. Check /health, then send the bounded request and inspect the response or SSE [DONE] marker.

Plan a CLI migration or pipeline

  1. Render the exact nested help surface and check paths/credentials first.
  2. For fix, run --dry-run and review every match before writing.
  3. For decompose or eval, bound model/token/timeout settings and use a new output path; these commands make provider calls and files.
  4. Inspect generated Python, validators, and result counts before executing or treating a run as successful.
  5. Record which operations were deferred because they need a live backend, training resources, or remote write approval.

Route a difficult request

  • Structured-output endpoint with routing and streaming: read all of Serving API, use a fixed route allowlist, validate the JSON schema, and ensure the streaming branch returns an uncomputed thunk.
  • Missing server extra: run help/static checks, install server, and repeat help; do not start Uvicorn as a dependency test.
  • Decompose/fix misuse: read the failure table in Troubleshooting, preserve generated or rewritten artifacts, and recover with a narrower, reviewable operation.

Ownership boundaries

Route provider selection, model identifiers, credentials, backend extras, and provider failures to ../backends-and-models/SKILL.md. Route evaluation design, judge validity, and sampling semantics to ../sampling-and-evaluation/SKILL.md. Route tool execution, tool-call loops, and MCP to ../tools-and-agents/SKILL.md when that route is available; this skill covers only the HTTP envelope and CLI boundary for tools.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351