AGENT SKILL

model-serving

Use FedML for model cards, local predictors, on-prem or cloud deployment, inference requests, and streaming response serving.

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

01 前言 Front Matter

name
model-serving
license
Apache 2.0
metadata
{ "disco-role": "operating", "parent_skill": "fedml" }
description
Use FedML for model cards, local predictors, on-prem or cloud deployment, inference requests, and streaming response serving.
disable-model-invocation
true

02 资源文件 1

03 SKILL.md 正文

FedML Model Serving

Use this sub-skill for FedML model cards, local model serving, cloud/on-prem deployment, endpoint requests, streaming responses, FedMLPredictor, FedMLInferenceRunner, and fedml model CLI/API workflows.

Do not use this for

  • Training a model before serving: use ../distributed-training/SKILL.md.
  • Launching a generic non-serving job: use ../launch-and-packaging/SKILL.md.
  • Multi-step workflow DAGs that include deploy/inference jobs: use ../workflow-orchestration/SKILL.md.

Route by serving task

User task Preferred path
local predictor smoke subclass FedMLPredictor, wrap with FedMLInferenceRunner, test readiness/predict
streaming inference use the streaming predictor pattern and stream chunks explicitly
model card creation fedml model create or fedml.api.model_create
package/push/deploy fedml model package/push/deploy or matching fedml.api.model_* calls
remote endpoint invocation fedml model run or fedml.api.model_run(endpoint_id, json_string)

Local safe smoke

Run the bundled local predictor helper from the root skill directory:

python sub-skills/model-serving/scripts/local_predictor_smoke.py
python sub-skills/model-serving/scripts/local_predictor_smoke.py --streaming

The helper uses FedML serving classes without pushing or deploying a model card.

Model-card CLI/API path

Discovery commands are safe:

fedml model --help
fedml model create --help
fedml model deploy --help
fedml model run --help

Remote operations require approval and credentials:

fedml model create <name> --model <path> --config <config.yaml>
fedml model package <name>
fedml model push <name> --api-key <key>
fedml model deploy <name> --endpoint-name <endpoint>
fedml model run <endpoint-id> '{"inputs": ...}'

Python equivalents are listed in ../../references/api-reference.md#public-fedmlapi-helpers.

Evidence anchors

  • python/fedml/serving/fedml_predictor.py — predictor base class.
  • python/fedml/serving/fedml_inference_runner.py — local inference runner.
  • python/examples/deploy/quick_start/src/main_entry.py — simple predictor shape.
  • python/examples/deploy/streaming_response/src/main_entry.py — streaming response pattern.
  • python/tests/test_model_cli/ — model CLI reference paths, credential-bound for real execution.

Cautions

  • fedml model deploy can create endpoints and consume resources; ask before running.
  • Remote deployment can require API key, endpoint name/id, worker/master device ids, provider resources, Docker/local platform, and model artifacts.
  • Do not treat a streaming predictor as a one-shot JSON predictor.
  • Keep local smoke tests separate from remote model card registry actions.

Exit criteria

A model-serving task is complete when the serving mode, predictor interface, model artifact path, endpoint/credential requirements, and local-vs-remote decision are explicit, and local smoke or remote deployment status is recorded.

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