edge-llm-serve
Skill631 starsChanged 3 days agoApache-2.0View on GitHub
Launch and verify TensorRT Edge-LLM's experimental OpenAI-compatible server for one Hugging Face checkpoint or local checkpoint. Use for `trtedge serve`, OpenAI API requests, server sizing, streaming, tools, media, batching, speculative decoding, or a server startup failure. Do not use for ONNX export or C++ inference (edge-llm-convert-model), installation (edge-llm-install), or adding architecture support (edge-llm-add-model).
In this repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- edge-llm-accuracy-debuggingSkill
- edge-llm-add-modelSkill
- edge-llm-benchmark-accuracySkill
- edge-llm-benchmark-performanceSkill
- edge-llm-convert-modelSkill
- edge-llm-cpp-testSkill
- edge-llm-cutedsl-kernelSkill
- edge-llm-documentationSkill
- edge-llm-e2e-testSkill
- edge-llm-feature-combinationsSkill
- edge-llm-few-layer-testSkill
- edge-llm-installSkill
- edge-llm-plugin-extensionSkill
- edge-llm-version-migrationSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
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
- could be automatic: a setting could enforce it
- Distinctive: line 15
Do the work; do not stop after printing a command.
- Very specific: line 24
Read from the revision being run: docs/source/user_guide/examples/server.md, getting_started/support-matrix.md, …
- Distinctive: line 29
Stop and report a mismatch instead of combining flags from both.
- Very specific: line 36
Check the checkpoint against the support documents, and free device memory (nvidia-smi --query-gpu=name,compute_cap,memory.free …
- Distinctive: line 47
Create a run directory and a cache directory for this task, and pick an unused port.
- Very specific: line 48
Start the server with the host's background-process mechanism, record the PID, and redirect output to a log.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
<!-- SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. --><!-- SPDX-License-Identifier: Apache-2.0 -->Serve a checkpoint
Do the work; do not stop after printing a command. The default path is: launch, wait until ready, send one request, report, stop the server.
Instructions
Launch the server on loopback with a recorded PID and a log, wait for /health/ready, send one deterministic request that matches the user's modality, report the evidence, and stop the server unless the user asked to keep it. Add sizing, auth, media, tools, or batching only when asked.
Source of truth
Read from the revision being run: docs/source/user_guide/examples/server.md,
getting_started/support-matrix.md, getting_started/supported-models.md, and
docs/source/user_guide/features/in-flight-batching.md for concurrency. Run
trtedge serve --help; it owns flag names, defaults, and value lists, and the
docs describe the checkout while --help describes the active installation.
Stop and report a mismatch instead of combining flags from both.
Before launching
- The server consumes Hugging Face or local checkpoints, not ONNX or C++ engine
directories. Do not switch to the ONNX workflow to work around a failure
(
edge-llm-convert-modelowns that). - Check the checkpoint against the support documents, and free device memory
(
nvidia-smi --query-gpu=name,compute_cap,memory.free --format=csv,noheader) against the checkpoint size. - For a quick check without HTTP,
trtedge chat <checkpoint> --prompt "<text>"generates once; it is not evidence that the server works. - Environment: a published wheel with the
runtimeextra outside a checkout, or an editable source install backed by this checkout's build directory (edge-llm-install).
Launch
- Create a run directory and a cache directory for this task, and pick an unused port.
- Start the server with the host's background-process mechanism, record the PID,
and redirect output to a log. Do not use
pkillor kill a process you did not start.
trtedge serve <checkpoint> \
--host 127.0.0.1 --port <port> --cache-dir <task-cache> \
--max-input-len <prompt-limit> --max-kv-cache-capacity <prompt-plus-output-limit>- The default host is
0.0.0.0, so always pass--host 127.0.0.1unless the user asked for remote access (ask before exposing it). - The server listens only after the model loads, so a refused connection means
"still loading" while the PID is alive. Poll
/health/readywith a deadline and read the log; a cache-miss engine build can take minutes.
Size --max-input-len to the longest prompt and --max-kv-cache-capacity to
prompt plus generated tokens, and do not copy another checkpoint's profile. Take
every other option (batching, speculative decoding, tools and reasoning parsers,
--api-key, caching, queueing) from --help and only when the user needs it.
Three facts --help does not make obvious: speculative decoding cannot be
combined with in-flight batching; the default server serializes requests, so
concurrency needs --enable-in-flight-batching with a matching
--max-batch-size; and requests beyond the running batch plus
--max-queued-requests get HTTP 429. Use --allowed-local-media-path only for a
directory the user approved, and never print an API key.
Prove the API
- Save
/healthand/v1/models. - Send one request with
temperature: 0, a boundedmax_tokens, and the model name/v1/modelsreturned. Match the modality: a known small image or audio input for media,message.tool_callsfor tools. - For streaming, show at least one content or tool-call delta before the final event.
- Record status, body, finish reason, usage, and the log line naming the engine bundle in use.
For latency or throughput use edge-llm-benchmark-performance; for dataset
accuracy edge-llm-benchmark-accuracy. Do not time one curl.
Failures
| Failure | Action |
| Exits before ready | Report the first actionable log error (checkpoint access, memory, profile limits, native payload) |
| 400 / 404 / 413 | Request schema or unknown field / served model name / input over --max-input-len |
| 401 / 429 | API key / queue full |
| 503 | Shutting down, or the engine failed; read /health reason and the log |
| Plugin or TensorRT load error | edge-llm-install; do not reinstall over the environment blindly |
| Empty or wrong output | Keep the artifacts; edge-llm-few-layer-test, then edge-llm-accuracy-debugging |
Report
The launch command with secrets redacted, checkpoint, port and PID, the request and response excerpt, and whether the server was stopped or left running.
Examples
- "Serve Qwen/Qwen3.5-4B on port 8000 and show that streaming works": size the limits, launch, wait for
/health/ready, send a streamed request, report the evidence, stop. - "Start the server for four concurrent clients": add
--enable-in-flight-batchingwith a matching--max-batch-size, launch, and show that concurrent requests complete.
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
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.

