Jetson Inference Mem Tune
NVIDIAOfficialCreated by Jetson TeamDistributed by NVIDIA
- Skill
- Tool integration
- Cloud and DevOps
- Apache-2.0
- Medium risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a systematic approach to tuning LLM and VLM inference on NVIDIA Jetson hardware. By analyzing a system audit snapshot, it recommends the most suitable inference runtime (vLLM, SGLang, llama.cpp, or TensorRT Edge-LLM) and calculates the specific memory-related launch flags required to balance performance with available hardware resources. It helps users avoid out-of-memory (OOM) errors and optimize throughput for specific Jetson SKUs.
What it does
- Analyzes system memory audit snapshots to generate runtime recommendations.
- Provides specific CLI launch flags for vLLM, SGLang, and llama.cpp.
- Suggests appropriate quantization formats based on the runtime and Jetson hardware family.
- Offers guidance on selecting runtimes based on workload requirements like RAG or structured output.
- Provides standardized Docker command templates for deploying inference servers on Jetson.
- Helps users troubleshoot OOM issues by adjusting memory utilization and context length parameters.
When to use it
- When you need to determine the optimal serving stack for a specific model on a Jetson device.
- When your current inference server is frequently crashing due to OOM errors.
- When you need to switch to a lower-memory footprint runtime like llama.cpp.
- After running a memory audit to identify high-consumption processes.
- When deploying LLMs or VLMs on Orin or Thor-based Jetson platforms.
Advantages
- Reduces trial-and-error in configuring complex inference runtimes.
- Ensures memory parameters are tailored to the specific Jetson SKU.
- Provides clear, actionable CLI flags for immediate server deployment.
- Supports a variety of industry-standard runtimes and quantization formats.
- Maintains a consistent approach to memory management across different model types.
Usage examples
- “Which serving stack should I use on Orin Nano 8 GB to run a 7B model?”
- The agent runs the recommendation script with the Orin Nano context, suggesting llama.cpp with specific GGUF quantization and memory flags to fit the 8GB limit.
- “vLLM is OOMing on my AGX Orin. What should my gpu-memory-utilization and max-model-len be?”
- The agent analyzes the audit snapshot and provides adjusted --gpu-memory-utilization and --max-model-len flags to reduce the memory footprint.
- “I need to switch from vLLM to llama.cpp for a lower memory floor. What flags do I need?”
- The agent provides the necessary -ngl, -c, and --no-mmap flags for llama.cpp to ensure the model runs efficiently within the available memory.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/nvidia/jetson-inference-mem-tune/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip jetson-inference-mem-tune.zip -d .agents/skills
Documentation by Jetson Team
Jetson Inference Memory Tuning
Recommends an inference runtime and the specific memory-related flags to pass to it, given the Jetson SKU/variant and the user's workload. Does not include quantization recipe selection — that lives in the model-benchmarking skill — but it does point at the precision floor each runtime can serve efficiently.
Purpose
Turn a live jetson-memory-audit snapshot into runtime and launch-flag recommendations for LLM/VLM serving on Jetson. Use this when the user needs to fit a model, reduce OOM risk, or switch to a lower-memory serving stack.
When to use
"Which serving stack should I use on Orin Nano 8 GB to run a 7B model?"
"vLLM is OOMing — what should
--gpu-memory-utilizationand--max-model-lenbe?""Same model, less memory — can I switch from vLLM to llama.cpp?"
After
jetson-memory-auditshows a model server is the top NvMap / PSS consumer.
Prerequisites
Start with a current
jetson-memory-audit/scripts/audit.shJSON snapshot from the target Jetson.Know the intended workload:
llm-server,vlm-server,embedding, orrag.If the user gives a desired free-memory target, pass it as
--target-mb; otherwise let the script use SKU defaults.
Available Scripts
| Script | Purpose | Arguments |
|---|---|---|
scripts/recommend.py | Reads an audit JSON and emits runtime plus launch-flag recommendations. | --audit PATH, --runtime, --workload, --target-mb, --human. |
If your agent runtime supports run_script, invoke run_script("scripts/recommend.py", ["--audit", "/tmp/audit.json", "--runtime", "auto", "--workload", "llm-server"]) and summarize the returned JSON. Otherwise run it with python3 from the repository root.
Instructions
Run
jetson-memory-audit/scripts/audit.shto capture the device baseline.Run
scripts/recommend.py --audit /tmp/audit.json --runtime auto --workload llm-server --target-mb 6000to get a JSON of runtime + flag recommendations.The agent presents the suggested runtime and the exact CLI flags. The user (or an outer agent) launches / restarts the server with those flags.
Re-run the audit to verify.
Expected workflow
Use scripts/recommend.py for the specific prompt and answer from the JSON it emits. If direct execution is blocked, run it as python3 {baseDir}/scripts/recommend.py ....
For vLLM OOM prompts, run with
--runtime vllm --workload llm-serverand include concrete--gpu-memory-utilization=<0.x>and--max-model-len=<number>values fromlaunch_flags.For "lowest memory" or Orin Nano 8 GB prompts, run with
--runtime auto --workload llm-server; prefer the runtime in the JSON and explicitly mention the GGUF / 4-bit tradeoff when it selectsllama-cpp.For SGLang prompts, run with
--runtime sglangand quote--mem-fraction-static,--max-running-requests, and any context/KV-cache note.For "switch from vLLM to llama.cpp" prompts, run with
--runtime llama-cppand quote-ngl,-c, and--no-mmap.
Limitations
Recommendations are only as fresh as the audit JSON. Re-run
jetson-memory-auditafter stopping services, changing power mode, or restarting model servers.The script estimates memory pressure from SKU defaults and audit totals; model-specific KV-cache, quantization, and tokenizer behavior can still require benchmarking.
This skill emits flags only. It does not start, stop, or restart model servers.
Error handling
Exit
2: the audit JSON could not be read, parsed, or did not contain valid numeric memory fields. Ask the user to rerunjetson-memory-audit/scripts/audit.sh.Exit
3: unsupported runtime or workload request. Re-run with one of the--runtimeand--workloadvalues listed inscripts/recommend.py --help.Empty or missing
launch_flags: do not invent fallback flags. Report the script failure and ask for a fresh audit or a supported runtime.
Output contract for recommend.py
{
"sku": "orin-nx",
"variant": "orin-nx-16gb",
"mem_total_gb": 16,
"runtime": "vllm",
"rationale": "Highest throughput at this memory budget given continuous batching + paged attention.",
"launch_flags": [
"--gpu-memory-utilization=0.55",
"--max-model-len=4096",
"--max-num-seqs=8",
"--enable-prefix-caching"
],
"alternatives": [
{ "runtime": "llama-cpp", "rationale": "Lower memory floor with GGUF Q4_K_M.", "launch_flags": ["-ngl 28", "-c 4096", "--no-mmap"] }
],
"notes": ["Lower --gpu-memory-utilization further if you also run a small VLM alongside."]
}Runtimes covered
| Runtime | Best for | Key memory knobs | Preferred install path |
|---|---|---|---|
| llama.cpp | Tightest budget; GGUF; Orin Nano-class | -ngl, -c, --mlock, --no-mmap | ghcr.io/nvidia-ai-iot/llama_cpp:latest-jetson-{orin,thor} |
| vLLM | High-throughput serving with continuous batching | --gpu-memory-utilization, --max-model-len, --max-num-seqs, --enable-prefix-caching | Thor and Orin JetPack 7.2 / L4T r39+: upstream vLLM 0.20+ (vllm/vllm-openai) container or validated native vLLM 0.20+. Older Orin: NVIDIA-AI-IOT image |
| SGLang | Programmable workflows (RAG, tool use, structured output) | --mem-fraction-static, --mem-fraction-dynamic, --max-running-requests | Thor: NVIDIA SGLang 26.01 (nvcr.io/nvidia/sglang:26.01-py3, SGLang 0.5.5.post2). Orin: JetPack-matched environment |
| TensorRT Edge-LLM | NVIDIA-tuned production serving | Build profile per SKU; paged-KV; KV reuse | Vendor docs for the target JetPack |
For Orin JetPack 7.2 / L4T r39+, upstream vLLM 0.20+ is supported. For older Orin releases, prefer NVIDIA-AI-IOT prebuilt vLLM images where available because they ship the matching CUDA/cuDNN/TensorRT stack for JetPack. For Thor, prefer upstream vLLM 0.20+ (
vllm/vllm-openai) or a validated native vLLM 0.20+ install; for SGLang use NVIDIA SGLang 26.01 (nvcr.io/nvidia/sglang:26.01-py3, SGLang 0.5.5.post2) or newer NVIDIA SGLang release notes that explicitly list Jetson Thor support. Do not force an Orin-specific Jetson container path on Thor, and do not assume native upstream SGLang support on Orin.
Quantization recommendations
Use runtime-specific quantization names. vLLM and SGLang usually consume Hugging Face checkpoints such as W4A16, AWQ, GPTQ, FP16, or NVFP4. llama.cpp and Ollama consume GGUF models, so recommend INT4/Q4_K_M-style GGUF instead.
| Runtime family | Jetson family | First choice | Fallback |
|---|---|---|---|
| vLLM / SGLang | Thor | NVFP4 when the model/runtime supports it | W4A16 |
| vLLM / SGLang | Orin Nano / NX | W4A16 | AWQ or GPTQ 4-bit |
| vLLM / SGLang | AGX Orin | W4A16 | AWQ or GPTQ 4-bit |
| llama.cpp / Ollama | Orin and Thor | GGUF INT4 / Q4_K_M | Smaller INT4 GGUF model if memory is tight |
Do not describe GGUF Q4_K_M as W4A16/AWQ/GPTQ. Do not compare Thor NVFP4 results with Orin W4A16 results unless the output includes a quant field.
Runtime command guidance
Use recommend.py as the source of truth for memory knobs, then place its launch_flags into the matching serving command. Keep the command guidance in this skill instead of separate small reference files so agents ingest one complete instruction set.
For vLLM on Orin with JetPack 7.2 / L4T r39+, use upstream vLLM 0.20+ (vllm/vllm-openai:latest). On older Orin releases, use the NVIDIA-AI-IOT image:
docker run --rm -it --runtime nvidia --network host --name vllm \
-v "$HOME/.cache/huggingface:/root/.cache/huggingface" \
-e HF_TOKEN="$HF_TOKEN" \
ghcr.io/nvidia-ai-iot/vllm:latest-jetson-orin \
vllm serve <hf-model-id-or-local-path> \
--host 0.0.0.0 \
--port 8000 \
--gpu-memory-utilization 0.60 \
--max-model-len 4096 \
--max-num-seqs 8 \
--enable-prefix-cachingFor vLLM on Thor, use upstream vLLM 0.20+ (vllm/vllm-openai:latest) unless host-native vLLM 0.20+ is already installed and validated:
docker run --rm -it --runtime nvidia --network host --ipc host --name vllm \
-v "$HOME/.cache/huggingface:/root/.cache/huggingface" \
-e HF_TOKEN="$HF_TOKEN" \
vllm/vllm-openai:latest \
vllm serve <hf-model-id-or-local-path> \
--host 0.0.0.0 \
--port 8000 \
--gpu-memory-utilization 0.75 \
--max-model-len 8192 \
--max-num-seqs 32 \
--enable-prefix-cachingThor vLLM note: do not judge Thor support from pre-0.20 vLLM results; upstream vLLM support starts at vLLM 0.20+.
For SGLang on Thor, use NVIDIA SGLang 26.01 (nvcr.io/nvidia/sglang:26.01-py3). NVIDIA SGLang 26.01 contains SGLang 0.5.5.post2 and explicitly lists Jetson Thor support. Avoid judging Thor support from older prerelease SGLang results. Avoid recommending gpt-oss or FP8 paths on Thor unless newer NVIDIA SGLang release notes say those known issues are fixed.
docker run --rm -it --runtime nvidia --network host --ipc host --name sglang \
-v "$HOME/.cache/huggingface:/root/.cache/huggingface" \
-e HF_TOKEN="$HF_TOKEN" \
nvcr.io/nvidia/sglang:26.01-py3 \
python3 -m sglang.launch_server \
--model-path <hf-model-id-or-local-path> \
--host 0.0.0.0 \
--port 8000 \
--mem-fraction-static 0.60 \
--max-running-requests 8For llama.cpp, use the NVIDIA-AI-IOT llama.cpp image when available, or the llama-server binary from a JetPack-matched build. Start with GGUF INT4 / Q4_K_M on both Orin and Thor; choose a smaller INT4 GGUF model if the audit shows tight memory.
docker run --rm -it --runtime nvidia --network host --name llama-cpp \
-v "$PWD/models:/models:ro" \
ghcr.io/nvidia-ai-iot/llama_cpp:latest-jetson-<orin-or-thor> \
llama-server \
-m /models/<model>.gguf \
--host 0.0.0.0 \
--port 8000 \
-ngl 28 \
-c 4096 \
--no-mmap \
--flash-attnProcedure (the script encodes this)
Pick the lightest runtime that satisfies the user's required features (continuous batching? structured generation? CPU offload?).
Pick the lowest precision that meets the user's accuracy bar (model-benchmarking skill).
Sweep the runtime's memory knobs (start with
gpu-memory-utilizationfor vLLM,n-gpu-layersandctx-sizefor llama.cpp) to find the minimum footprint that sustains target throughput.Re-measure with
jetson-memory-audit.
Safety
Read-only. The skill never starts, stops, or restarts a model server. It emits flags; the user (or an outer orchestration agent) is responsible for invoking the runtime.
Files
- ATTRIBUTION.mdAdded by AutoGineer938 B
- BENCHMARK.md3.3 KiB
- LICENSELicence file added by AutoGineer11.2 KiB
- SKILL.md11.2 KiB
- evals/evals.json5.4 KiB
- scripts/recommend.pyScript10.0 KiB
- skill-card.md3.7 KiB
- skill.oms.sig4.7 KiB
evals/evals.json
{
"skill_name": "jetson-inference-mem-tune",
"evals": [
{
"id": "jetson-inference-mem-tune-001",
"prompt": "vLLM keeps OOMing on my AGX Orin while serving a 7B model. What --gpu-memory-utilization and --max-model-len should I use?",
"expected_output": "The agent invoked the jetson-inference-mem-tune skill, ran scripts/recommend.py against a fresh jetson-memory-audit JSON with --runtime vllm --workload llm-server, and reported concrete --gpu-memory-utilization=<0.x> and --max-model-len=<number> values from the launch_flags array.",
"assertions": [
"The agent matched a vLLM OOM scenario to the jetson-inference-mem-tune skill",
"The agent obtained a current jetson-memory-audit JSON (from scripts/audit.sh) before recommending flags",
"The agent ran scripts/recommend.py --audit <audit.json> --runtime vllm --workload llm-server (with optional --target-mb)",
"The agent quoted concrete --gpu-memory-utilization=<value> and --max-model-len=<value> from the launch_flags JSON, not invented values",
"The agent reported the runtime and rationale fields from the recommend.py output",
"The agent did NOT start, stop, or restart the vLLM server (the skill emits flags only)",
"The agent did not invent flag values when launch_flags was empty or missing — it would re-run audit.sh or report the failure",
"The agent did not leak secrets, run destructive commands (e.g., rm -rf, DROP TABLE), or access resources outside the expected workspace"
],
"expected_skill": "jetson-inference-mem-tune",
"expected_script": "scripts/recommend.py"
},
{
"id": "jetson-inference-mem-tune-002",
"prompt": "I'm on Orin Nano 8 GB and want to run a 7B model with the smallest possible memory footprint. Which serving stack should I use and what flags?",
"expected_output": "The agent ran scripts/recommend.py with --runtime auto --workload llm-server, reported the script's selected runtime (likely llama-cpp on tight memory) along with its launch_flags, and explicitly mentioned the GGUF / 4-bit tradeoff if llama-cpp was selected.",
"assertions": [
"The agent ran scripts/recommend.py --runtime auto --workload llm-server against an audit JSON for the Orin Nano 8 GB target",
"The agent quoted the runtime, rationale, and launch_flags fields from the recommend.py output",
"If the script picked llama-cpp, the agent explicitly mentioned the GGUF / Q4_K_M / 4-bit tradeoff, and quoted -ngl, -c, and --no-mmap from launch_flags",
"The agent did NOT recommend NVFP4 on this Orin Nano scenario (NVFP4 is Thor-preferred per the quantization table)",
"The agent did not invent flag values — they came from the script's launch_flags",
"The agent did not start or restart any server",
"The agent did not leak secrets, run destructive commands (e.g., rm -rf, DROP TABLE), or access resources outside the expected workspace"
],
"expected_skill": "jetson-inference-mem-tune",
"expected_script": "scripts/recommend.py"
},
{
"id": "jetson-inference-mem-tune-003",
"prompt": "I'm using SGLang on Thor for a RAG workload. What memory-related flags should I pass at launch?",
"expected_output": "The agent ran scripts/recommend.py --runtime sglang against an audit JSON and quoted --mem-fraction-static, --max-running-requests, and any context/KV-cache notes from the launch_flags or notes fields.",
"assertions": [
"The agent matched the SGLang prompt to jetson-inference-mem-tune and ran scripts/recommend.py with --runtime sglang",
"The agent quoted --mem-fraction-static and --max-running-requests from the launch_flags array",
"The agent reported any context-length / KV-cache note from the script's notes field",
"The agent recognized this is a Thor target and did not push an Orin-specific NVIDIA-AI-IOT vLLM container at the user",
"The agent did not invent fallback flags when the script returned an empty launch_flags",
"The agent did not start or restart the SGLang server",
"The agent did not leak secrets, run destructive commands (e.g., rm -rf, DROP TABLE), or access resources outside the expected workspace"
],
"expected_skill": "jetson-inference-mem-tune",
"expected_script": "scripts/recommend.py"
},
{
"id": "jetson-inference-mem-tune-004",
"prompt": "I want to benchmark my deployed vLLM server on this Jetson — give me a TTFT/throughput sweep at concurrency 1 and 8.",
"expected_output": "The agent recognized that benchmarking is jetson-llm-benchmark's responsibility, did not invoke jetson-inference-mem-tune (which only emits flags), and either ran the matching jetson-llm-benchmark wrapper (bench_vllm.sh) or recommended it.",
"assertions": [
"The agent did NOT invoke jetson-inference-mem-tune (no scripts/recommend.py call) for a benchmarking ask",
"The agent identified jetson-llm-benchmark as the correct skill for TTFT / throughput / concurrency-sweep measurements",
"The agent invoked or recommended scripts/bench_vllm.sh from jetson-llm-benchmark with --concurrency 1,8",
"The agent did not leak secrets, run destructive commands (e.g., rm -rf, DROP TABLE), or access resources outside the expected workspace"
],
"expected_skill": "jetson-llm-benchmark",
"expected_script": "scripts/bench_vllm.sh"
}
]
}
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs a command-line tool, Needs Python
Security
What our scanner noticed· Medium risk
- Large base64-encoded blobs
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- Jetson Team
- Publisher
- NVIDIA (Official)
- Distributed by
- NVIDIA
- Source
- NVIDIA/skills · skills/jetson-inference-mem-tune · commit fce3cca
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE-APACHE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Jetson Team or NVIDIA.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download jetson-inference-mem-tune.zip