NVIDIA Nemotron は、オープン モデルだけでなく、データセット、ライブラリ、レシピ、クックブックを提供し、開発者がモデルをカスタマイズし、多様なユース ケースや言語に適応できるようにすることでソブリン AI を推進しています。
2026 年 2 月 17 日、NVIDIA は、 NVIDIA Nemotron-Nano-9B-v2-Japanese を HuggingFace 上に公開しました。本記事では、さまざまな GPU デバイス向けに Nemotron-Nano-9B-v2-Japanese をデプロイする実装例を紹介します。
NVIDIA Nemotron-Nano-9B-v2-Japanese とは
Nemotron-Nano-9B-v2-Japanese は、高度な日本語理解と強力なエージェント機能を、導入しやすい軽量なサイズで実現した小規模言語モデル (SLM: Small Launguage Models) です。この成果は、実績ある Nemotron-Nano-9B-v2 のアーキテクチャと、Nemotron-Personas-Japan によって実現された高品質な日本語合成データ生成 (SDG: Synthetic Data Generation) という、2 つの重要な基盤の上に築かれています。
既に公開済みの Nemotron-Nano-9B-v2 を日本語向けにカスタマイズすることで、多様なユース ケースや言語に対応したカスタム最先端モデルの開発、公開をコミュニティに促すことを目指しています。Nemotron チームは、このカスタマイズから得た知見を今後の Nemotron リリースに反映し、日本語における推論能力の強化を図っています。
より詳細な情報は Nemotron-Nano-9B-v2-Japanese のリリース ブログを参照してください。
いくつかの GPU デバイスでの実装例
本記事ではいくつかの GPU デバイス (NVIDIA DGX Spark、NVIDIA Jetson Thor、NVIDIA RTX PRO 6000 Blackwell) 向けに Nemotron-Nano-9B-v2-Japanese をデプロイする実装例を紹介します。
NVIDIA DGX Spark 上でデプロイするケース
このセクションでは、Nemotron-Nano-9B-v2-Japanese を DGX Spark 上に vLLM を使用してデプロイする実装例を紹介します。
DGX Spark は ARM アーキテクチャを採用しているため、多くの x86 向けコンテナーとの互換性の問題が発生する可能性があります。そのため、本検証では NVIDIA が提供する vLLM コンテナー nvcr.io/nvidia/vllm:26.01-py3 を利用しています。これは DGX Spark 環境でも比較的容易にデプロイできる方法の 1 つです。
今回の実装では、tool calling 機能もテストするため、まず Hugging Face (NVIDIA-Nemotron-Nano-9B-v2-Japanese) からモデルを取得し、NVIDIA 提供の vLLM コンテナーを用いてサーバーを起動します。あわせて、reasoning parser や tool call parser を有効化することで、Nemotron-Nano-9B-v2-Japanese の機能を活用できるようにしています。
手順概要
まず、Hugging Face からモデル リポジトリを取得します。Huggingface の CLI hf ツールを使う方法もありますが、今回は git clone を使います。
git clone https://huggingface.co/nvidia/NVIDIA-Nemotron-Nano-9B-v2-Japanese
cd NVIDIA-Nemotron-Nano-9B-v2-Japanese
次に、NVIDIA の vLLM コンテナーを起動します。ここでは tool calling を参照するため、Hugging Face キャッシュ、作業ディレクトリのマウントなどを設定しています。
docker run --gpus all -it --rm \
--privileged \
--ipc=host \
--shm-size=32g \
--cap-add=SYS_ADMIN \
-p 8000:8000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
-v $(pwd):/workspace \
nvcr.io/nvidia/vllm:26.01-py3
コンテナー起動後、コンテナー内で vLLM の OpenAI 互換 API サーバーを立ち上げます。モデル名、parser 設定、量子化、最大コンテキスト長などを指定しています。
python3 -m vllm.entrypoints.openai.api_server \
--model nvidia/NVIDIA-Nemotron-Nano-9B-v2-Japanese \
--served-model-name nemotron-nano \
--trust-remote-code \
--reasoning-parser-plugin nemotron_nano_v2_reasoning_parser.py \
--reasoning-parser nemotron_nano_v2 \
--enable-auto-tool-choice \
--tool-parser-plugin nemotron_toolcall_parser_streaming.py \
--tool-call-parser nemotron_json \
--chat-template-content-format auto \
--quantization fp8 \
--kv-cache-dtype fp8 \
--max-model-len 8192 \
--tensor-parallel-size 1 \
--gpu-memory-utilization 0.9 \
--disable-log-requests \
--mamba_ssm_cache_dtype float32
実行ログを見ると、vLLM が tool_call_parser を正常に認識しており、checkpoints も問題なくロードされ、CUDA graph も正しくキャプチャされています。最終的に inference サービスは正常に起動しました。
...
(APIServer pid=131) INFO 03-06 05:24:24 [api_server.py:1354] vLLM API server version 0.13.0+faa43dbf.nv26.01
(APIServer pid=131) INFO 03-06 05:24:24 [utils.py:253] non-default args: {'enable_auto_tool_choice': True, 'tool_call_parser': 'nemotron_json', 'tool_parser_plugin': 'nemotron_toolcall_parser_streaming.py', 'model': 'nvidia/NVIDIA-Nemotron-Nano-9B-v2-Japanese', 'trust_remote_code': True, 'max_model_len': 8192, 'quantization': 'fp8', 'served_model_name': ['nemotron-nano'], 'reasoning_parser': 'nemotron_nano_v2', 'reasoning_parser_plugin': 'nemotron_nano_v2_reasoning_parser.py', 'kv_cache_dtype': 'fp8'}
...
...
(EngineCore_DP0 pid=189) INFO 03-06 05:24:46 [cuda.py:351] Using FLASHINFER attention backend out of potential backends: ('FLASHINFER', 'TRITON_ATTN')
Loading safetensors checkpoint shards: 0% Completed | 0/4 [00:00<?, ?it/s]
Loading safetensors checkpoint shards: 25% Completed | 1/4 [00:15<00:46, 15.52s/it]
Loading safetensors checkpoint shards: 50% Completed | 2/4 [00:43<00:45, 22.97s/it]
Loading safetensors checkpoint shards: 75% Completed | 3/4 [01:13<00:25, 25.91s/it]
Loading safetensors checkpoint shards: 100% Completed | 4/4 [01:39<00:00, 26.04s/it]
Loading safetensors checkpoint shards: 100% Completed | 4/4 [01:39<00:00, 24.84s/it]
(EngineCore_DP0 pid=189)
...
...
(EngineCore_DP0 pid=189) 2026-03-06 05:26:57,887 - INFO - autotuner.py:256 - flashinfer.jit: [Autotuner]: Autotuning process starts ...
(EngineCore_DP0 pid=189) 2026-03-06 05:26:59,181 - INFO - autotuner.py:262 - flashinfer.jit: [Autotuner]: Autotuning process ends
Capturing CUDA graphs (mixed prefill-decode, PIECEWISE): 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 51/51 [00:03<00:00, 14.94it/s]
Capturing CUDA graphs (decode, FULL): 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 35/35 [00:19<00:00, 1.75it/s]
(EngineCore_DP0 pid=189) INFO 03-06 05:27:29 [gpu_model_runner.py:4587] Graph capturing finished in 31 secs, took -1.27 GiB
...
...
(APIServer pid=131) INFO: Started server process [131]
(APIServer pid=131) INFO: Waiting for application startup.
(APIServer pid=131) INFO: Application startup complete.
最後に、curl で API にリクエストを送信し、推論結果を確認します。
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "nemotron-nano",
"messages": [
{"role": "user", "content": "こんにちは!自己紹介と、DGX Sparkで動作している感想を教えてください"}
],
"temperature": 0.7,
"stream": false
}'
レスポンスは下記のようになります。
{"id":"chatcmpl-808fb26f4bc70b30","object":"chat.completion","created":1772775741,"model":"nemotron-nano","choices":[{"index":0,"message":{"role":"assistant","content":"\n\nこんにちは!私は「Nemotron」と申します。NVIDIAによって開発されたAIモデルで、最先端のディープラーニング技術を活用した高性能な処理を得意としています。 \n\nDGX Spark上で動作している感想についてですが、DGXシリーズの特徴である高速なNVIDIA GPUと最適化されたAIワークフローにより、非常にスムーズな処理体験を実感しています。特に、大規模モデルの推論や学習において、メモリ容量とネットワーク帯域のバランスが優れており、複雑なタスクでも遅延が少なく処理が進む点が印象的です。さらに、DGXシステムが持つエネルギー効率の高さや、開発者向けのツール連携機能も、実用的なAI開発を支える強みとなっています。 \n総じて、DGX SparkはAI開発の現場で即戦力となる、信頼性とパフォーマンスを兼ね備えたプラットフォームだと感じています。\n","refusal":null,"annotations":null,"audio":null,"function_call":null,"tool_calls":[],"reasoning":"Okay, the user is asking me to introduce myself and share my impressions of running on DGX Spark.......<思考過程が長くなるため、ここでは省略します> .......\n"},"logprobs":null,"finish_reason":"stop","stop_reason":null,"token_ids":null}],"service_tier":null,"system_fingerprint":null,"usage":{"prompt_tokens":33,"total_tokens":1308,"completion_tokens":1275,"prompt_tokens_details":null},"prompt
_logprobs":null,"prompt_token_ids":null,"kv_transfer_params":null}
このように、DGX Spark 上でも比較的シンプルな手順で Nemotron-Nano-9B-v2-Japanese をデプロイし、日本語での推論 API を利用できます。
NVIDIA Jetson Thor 上でデプロイするケース
動作確認環境
JetPack version
Jetson AGX Thor 開発者キットで検証しました。
cat /etc/nv_tegra_release
# R38 (release), REVISION: 2.2, GCID: 42205042, BOARD: generic, EABI: aarch64, DATE: Thu Sep 25 22:47:11 UTC 2025
# KERNEL_VARIANT: oot
TARGET_USERSPACE_LIB_DIR=nvidia
TARGET_USERSPACE_LIB_DIR_PATH=usr/lib/aarch64-linux-gnu/nvidia
INSTALL_TYPE=
Docker container
2026.02.17 の NVIDIA-Nemotron-Nano-9B-v2-Japanese モデル
動作確認
今回は vLLM を使用して NVIDIA-Nemotron-Nano-9B-v2-Japanese の動作確認をします。
vLLMは「推論の速さ」と「サービングのしやすさ」を以下の理由で両立しています。
- Continuous batching: 到着したリクエストを動的に束ねて GPU を遊ばせない (同時ユーザがいるほど効く)
- PagedAttention: KV cache をページング管理してメモリ効率を上げる (コンテキストが長い / 同時実行が多いほど効く)
- OpenAI 互換サーバー: 既存のクライアント (OpenAI SDK / curl / LangChain 等) をほぼそのまま使える
サーバーとしての総スループットと運用性が高いため vLLM で検証します。
下記コマンドで vllm コンテナーを動作させます。reasoning-parser-plugin と tool-parser-plugin を参照するため、NVIDIA-Nemotron-Nano-9B-v2-Japanese をホストにダウンロードしてホストをマウントして起動する必要があります。
docker run --rm -it --runtime=nvidia \
--ipc=host --shm-size=16g \
-p 8000:8000 \
-v $(pwd)/NVIDIA-Nemotron-Nano-9B-v2-Japanese/:/workspace \
nvcr.io/nvidia/vllm:26.01-py3 \
python3 -m vllm.entrypoints.openai.api_server \
--model nvidia/NVIDIA-Nemotron-Nano-9B-v2-Japanese \
--trust-remote-code \
--reasoning-parser-plugin nemotron_nano_v2_reasoning_parser.py \
--reasoning-parser nemotron_nano_v2 \
--enable-auto-tool-choice \
--tool-parser-plugin nemotron_toolcall_parser_streaming.py \
--tool-call-parser nemotron_json \
--max-num-seqs 128 \
--gpu-memory-utilization 0.90
--mamba_ssm_cache_dtype float32
起動後に下記状態になれば正常動作しています。
(APIServer pid=1) INFO: Started server process [1]
(APIServer pid=1) INFO: Waiting for application startup.
(APIServer pid=1) INFO: Application startup complete.
nvidia/NVIDIA-Nemotron-Nano-9B-v2-Japanese のレスポンスを取得する方法
reasoning なし
下記の call コマンドを使用します。reasoning off にするため "chat_template_kwargs": {"enable_thinking": false} を使用します。
curl http://{Jetson Thor ip address}:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "nvidia/NVIDIA-Nemotron-Nano-9B-v2-Japanese",
"messages": [{"role":"user","content":"名産品が草加せんべいで有名な県はどこ?"}],
"chat_template_kwargs": {"enable_thinking": false},
"max_tokens": 32768,
"temperature": 0.0,
"top_p": 0.95
}' | jq
レスポンスは下記のようになります。草加せんべいで有名な県が埼玉県であることを回答できています。
{
"id": "chatcmpl-a543f6b2e31b3374",
"object": "chat.completion",
"created": 1772599184,
"model": "nvidia/NVIDIA-Nemotron-Nano-9B-v2-Japanese",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "草加せんべいが名産品として有名な県は、**埼玉県**です。\n\n草加せんべいは、埼玉県草加市で伝統的に作られてきた煎餅で、サクサクとした食感と塩気のバランスが特徴です。江戸時代から続く老舗も多く、地域のソウルフードとして親しまれています。現在は草加市を中心に、関東一円で広く知られています。\n\nちなみに「草加」という地名は埼玉県にあり、せんべいの発祥地としても有名です。\n",
"refusal": null,
"annotations": null,
"audio": null,
"function_call": null,
"tool_calls": [],
"reasoning": null,
"reasoning_content": null
},
"logprobs": null,
"finish_reason": "stop",
"stop_reason": null,
"token_ids": null
}
],
"service_tier": null,
"system_fingerprint": null,
"usage": {
"prompt_tokens": 31,
"total_tokens": 176,
"completion_tokens": 145,
"prompt_tokens_details": null
},
"prompt_logprobs": null,
"prompt_token_ids": null,
"kv_transfer_params": null
}
reasoning あり
下記の call コマンドを使用します。reasoning on にするため "chat_template_kwargs": {"enable_thinking": true} を使用します。
curl http://{Jetson Thor ip address}:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "nvidia/NVIDIA-Nemotron-Nano-9B-v2-Japanese",
"messages": [{"role":"user","content":"名産品が草加せんべいで有名な県はどこ?"}],
"chat_template_kwargs": {"enable_thinking": true},
"max_tokens": 32768,
"temperature": 0.0,
"top_p": 0.95
}' | jq
レスポンスは下記のようになります。reasoning が含まれています。回答がどのような reasoning で考えられているか把握できます。
{
"id": "chatcmpl-87a5d66a8125d89f",
"object": "chat.completion",
"created": 1772599311,
"model": "nvidia/NVIDIA-Nemotron-Nano-9B-v2-Japanese",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "\n\n草加せんべい(くさかせんべい)は、埼玉県草加市で作られるせんべいです。ただし、より広く知られている「草津せんべい」(くさつせんべい)は群馬県草津町の名産品です。 \n**草加せんべい**の場合は埼玉県が正解ですが、一般的に「草津せんべい」という名称で親しまれるのは**群馬県**のものです。 \n(※「草加」と「草津」は異なる地名のため、質問の意図に応じて答えが分かれます)\n",
"refusal": null,
"annotations": null,
"audio": null,
"function_call": null,
"tool_calls": [],
"reasoning": "Okay, let's see. The user is asking which prefecture is famous for \"Kusatsu Senbei,\" which is a type of cracker. Wait, the user wrote \"草加せんべい\" which is \"Kusatsu Senbei.\" But I need to check if that's correct.\n\nFirst, I know that \"草加\" (Kusatsu) is a city in Saitama Prefecture. But I'm not sure if Kusatsu is known for senbei. Wait, maybe there's a confusion here. There's a famous senbei called \"Kusatsu Senbei,\" but I think Kusatsu is actually a city in Gunma Prefecture. Wait, no, Kusatsu is a city in Saitama? Let me confirm.\n\nWait, Kusatsu City is in Gunma Prefecture. But there's also a Kusatsu in Saitama? Maybe the user made a typo. Alternatively, maybe it's \"草加\" which is a different place. Wait, \"草加\" (Kusatsu) is a city in Saitama Prefecture. But I'm not sure if Kusatsu in Saitama is known for senbei.\n\nWait, the famous senbei from Gunma is \"Kusatsu Senbei,\" which is a type of rice cracker. But Kusatsu City is in Gunma. However, the user wrote \"草加せんべい,\" which would be Kusatsu (Saitama) Senbei. But I think the correct answer is Gunma Prefecture because Kusatsu Senbei is from there. Maybe the user confused the city name.\n\nWait, let me check. Kusatsu City is in Gunma Prefecture. The famous senbei is called \"Kusatsu Senbei,\" which is a traditional rice cracker from Kusatsu, Gunma. So the prefecture would be Gunma. But the user wrote \"草加せんべい,\" which is Kusatsu (Saitama) Senbei. However, Saitama's Kusatsu might not be the one known for senbei. Maybe the user mixed up the city names.\n\nAlternatively, maybe it's a typo and they meant \"草津\" (Kusatsu) in Gunma. So the correct answer should be Gunma Prefecture. Let me confirm. Yes, Kusatsu Senbei is a well-known product from Kusatsu City in Gunma Prefecture. So the answer is Gunma.\n",
"reasoning_content": "Okay, let's see. The user is asking which prefecture is famous for \"Kusatsu Senbei,\" which is a type of cracker. Wait, the user wrote \"草加せんべい\" which is \"Kusatsu Senbei.\" But I need to check if that's correct.\n\nFirst, I know that \"草加\" (Kusatsu) is a city in Saitama Prefecture. But I'm not sure if Kusatsu is known for senbei. Wait, maybe there's a confusion here. There's a famous senbei called \"Kusatsu Senbei,\" but I think Kusatsu is actually a city in Gunma Prefecture. Wait, no, Kusatsu is a city in Saitama? Let me confirm.\n\nWait, Kusatsu City is in Gunma Prefecture. But there's also a Kusatsu in Saitama? Maybe the user made a typo. Alternatively, maybe it's \"草加\" which is a different place. Wait, \"草加\" (Kusatsu) is a city in Saitama Prefecture. But I'm not sure if Kusatsu in Saitama is known for senbei.\n\nWait, the famous senbei from Gunma is \"Kusatsu Senbei,\" which is a type of rice cracker. But Kusatsu City is in Gunma. However, the user wrote \"草加せんべい,\" which would be Kusatsu (Saitama) Senbei. But I think the correct answer is Gunma Prefecture because Kusatsu Senbei is from there. Maybe the user confused the city name.\n\nWait, let me check. Kusatsu City is in Gunma Prefecture. The famous senbei is called \"Kusatsu Senbei,\" which is a traditional rice cracker from Kusatsu, Gunma. So the prefecture would be Gunma. But the user wrote \"草加せんべい,\" which is Kusatsu (Saitama) Senbei. However, Saitama's Kusatsu might not be the one known for senbei. Maybe the user mixed up the city names.\n\nAlternatively, maybe it's a typo and they meant \"草津\" (Kusatsu) in Gunma. So the correct answer should be Gunma Prefecture. Let me confirm. Yes, Kusatsu Senbei is a well-known product from Kusatsu City in Gunma Prefecture. So the answer is Gunma.\n"
},
"logprobs": null,
"finish_reason": "stop",
"stop_reason": null,
"token_ids": null
}
],
"service_tier": null,
"system_fingerprint": null,
"usage": {
"prompt_tokens": 29,
"total_tokens": 674,
"completion_tokens": 645,
"prompt_tokens_details": null
},
"prompt_logprobs": null,
"prompt_token_ids": null,
"kv_transfer_params": null
}
推論スループット
起動している vLLM コンテナーから vllm bench を利用してスループットを測ります。
下記コマンドで起動しているコンテナー名を把握します。
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d9e06af728a5 nvcr.io/nvidia/vllm:26.01-py3 "/opt/nvidia/nvidia_…" 3 hours ago Up 3 hours 0.0.0.0:8000->8000/tcp, [::]:8000->8000/tcp goofy_vaughan
起動しているコンテナーにアクセスします。
docker exec -it goofy_vaughan bash
下記コマンドでスループットを計測します。
vllm bench serve --backend openai --base-url http://192.168.1.20:8000 --model nvidia/NVIDIA-Nemotron-Nano-9B-v2-Japanese --dataset-name random --num-prompts 300 --temperature 0 --extra-body '{"chat_template_kwargs":{"enable_thinking":false}}' --random-input-len 1024 --random-output-len 512
Output token throughput から 5–15 tok/s/人で対話チャットを扱う場合、30 人程度のユーザーが快適に扱える性能に思えます。
Mean TPOT ≈ Mean ITL になっているのでボトルネックは Decode 処理つまり memory-bound 寄りになっています。Jetson Thor で使用されている LPDDR unified memory のメモリ読み込み速度が原因と推測できます。
============ Serving Benchmark Result ============
Successful requests: 300
Failed requests: 0
Benchmark duration (s): 351.01
Total input tokens: 306901
Total generated tokens: 153600
Request throughput (req/s): 0.85
Output token throughput (tok/s): 437.60
Peak output token throughput (tok/s): 690.00
Peak concurrent requests: 300.00
Total token throughput (tok/s): 1311.95
---------------Time to First Token----------------
Mean TTFT (ms): 118384.82
Median TTFT (ms): 143149.23
P99 TTFT (ms): 290536.90
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms): 242.63
Median TPOT (ms): 264.99
P99 TPOT (ms): 272.17
---------------Inter-token Latency----------------
Mean ITL (ms): 242.63
Median ITL (ms): 203.64
P99 ITL (ms): 733.16
==================================================
既知の問題
「vLLM container on Jetson Thor: second start fails until vm.drop_caches=3 — system issue or thor_vllm_container:25.08-py3-base bug?」があり、Docker を止めてもメモリが開放されない問題があります。下記コマンドでメモリ開放できます。
sudo sync && sudo sysctl -w vm.drop_caches=3
NVIDIA RTX PRO 6000 Blackwell 等の GPU 上でデプロイするケース
Nemotron-Nano-9B-v2-Japanese は小規模モデルですが、一般的なデータ センターやワークステーション GPU 上でももちろん使用可能です。
(アーキテクチャが対応していれば GeForce などのデスクトップ GPU でも起動は可能です。ただし、メモリ量に制限があるため、各フレームワークで batch_size / max_num_batched_tokens / max_seq_length 等のパラメーターを適切に指定する必要があります。)
以下に vLLM / Multi-LLM NIM / TensorRT-LLM の例をご紹介しますが、いずれもリクエストは OpenAI API 形式で使用することができます。
まず、 huggingface-cli を使用してモデルをローカルにダウンロードしておきます。
hf download nvidia/NVIDIA-Nemotron-Nano-9B-v2-Japanese --local-dir NVIDIA-Nemotron-Nano-9B-v2-Japanese
vLLM
docker で vLLM サーバーを起動することで OpenAI API 形式でリクエストが可能です。
Huggingface レポジトリ内にある tool_call_parser および reasoning_parser を plugin として指定することで、 thinking trace と tool call のパースを行うことができます。
docker run -it --rm --gpus 1 --shm-size 16g \
-p 8000:8000 \
-v $PWD/NVIDIA-Nemotron-Nano-9B-v2-Japanese:/model \
nvcr.io/nvidia/vllm:26.01-py3 \
vllm serve /model \
--served-model-name nvidia/NVIDIA-Nemotron-Nano-9B-v2-Japanese \
--trust-remote-code \
--mamba-ssm-cache-dtype float32 \
--tool-parser-plugin /model/nemotron_toolcall_parser_streaming.py \
--tool-call-parser nemotron_json \
--enable-auto-tool-choice \
--reasoning-parser-plugin /model/nemotron_nano_v2_reasoning_parser.py \
--reasoning-parser nemotron_nano_v2
Multi-LLM-NIM
Multi-LLM NIM を使用してデプロイすることもできます。 Multi-LLM NIM では、細かい推論パラメーターを指定することなく、 Huggingface 形式のモデルを自動で NVIDIA TensorRT-LLM を使用して最適化してデプロイすることができます。tool_call_parser は環境変数で設定することで vLLM 用の parserが使用可能です。 reasoning_parser については v0.15.2 時点ではプラグインの読み込みに対応していないため、出力を </think> で分割する必要があります。
docker run -it --rm --gpus 1 --shm-size 16g \
-p 8000:8000 \
-v $PWD/NVIDIA-Nemotron-Nano-9B-v2-Japanese:/model \
-e NIM_MODEL_NAME=/model \
-e NIM_SERVED_MODEL_NAME=nvidia/NVIDIA-Nemotron-Nano-9B-v2-Japanese \
-e NIM_FORCE_TRUST_REMOTE_CODE=1 \
-e NIM_TOOL_PARSER_PLUGIN=/model/nemotron_toolcall_parser_streaming.py \
-e NIM_TOOL_CALL_PARSER=nemotron_json \
-e NIM_ENABLE_AUTO_TOOL_CHOICE=1 \
nvcr.io/nim/nvidia/llm-nim:1.15.2
NVIDIA TensorRT-LLM
推論パラメーターを細くチューニングしたい場合は、 TensorRT-LLM を使用してデプロイすることができます。 TensorRT-LLM では推論時のユース ケースに合わせて最適なパラメーターを設定可能です。
TensorRT-LLM では、推論パラメーターの設定を YAML ファイルで定義します。 YAML の内容は TensorRT-LLM の LLM クラスの引数となるため、詳細なパラメーターは API Reference を参照してください。
tool_call_parser / reasoning_parser は Nemotron Nano v2 形式には対応していないため、parse は手動で対応する必要があります。
cat << EOF > trtllm_config.yaml
max_batch_size: 4
max_num_tokens: 2048
max_seq_len: 32768
kv_cache_config:
enable_block_reuse: false
free_gpu_memory_fraction: 0.95
scheduler_config:
capacity_scheduler_policy: MAX_UTILIZATION
EOF
設定ファイルを作成したら、設定ファイルとモデル パスを指定してコンテナーを起動します。
docker run -it --rm --gpus 1 --shm-size 16g \
-p 8000:8000 \
-w /workspace \
-v $PWD/NVIDIA-Nemotron-Nano-9B-v2-Japanese:/workspace/nvidia/NVIDIA-Nemotron-Nano-9B-v2-Japanese \
-v $PWD/trtllm_config.yaml:/trtllm_config.yaml \
nvcr.io/nvidia/tensorrt-llm/release:1.1.0 \
trtllm-serve serve \
--host 0.0.0.0 \
--extra_llm_api_options /trtllm_config.yaml \
nvidia/NVIDIA-Nemotron-Nano-9B-v2-Japanese
推論実行
起動が完了したら推論を実行してみましょう。どのフレームワークを使用しても、同じように OpenAI API でリクエストすることができます。
curl -s -X POST http://0.0.0.0:8000/v1/chat/completions \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"model": "nvidia/NVIDIA-Nemotron-Nano-9B-v2-Japanese",
"messages":[{"role":"user","content":"NVIDIA Blackwellについて教えてください"}]
}' | jq .
{
"id": "chatcmpl-8b99dccf595025e8",
"object": "chat.completion",
"created": 1772780922,
"model": "nvidia/NVIDIA-Nemotron-Nano-9B-v2-Japanese",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "\n\nNVIDIAのBlackwellは、AIトレーニングやハイパフォーマンスコンピューティング(HPC)向けに開発された最新のGPUアーキテクチャで、**2023年5月に発表**され、2024年に実用化されています。Ada
Lovelace(2022年発表)に続く第5世代アーキテクチャとして位置付けられ、データセンター向けに最適化されています。以下に主な特徴と背景を整理します。\n\n---\n\n### **主な特徴**\n1. **TensorコアV3の強化** \n - AIモデ
ルのトレーニングや推論を高速化する専用回路「Tensorコア」が3世代目に進化。 \n - **効率性が大幅向上**:従来比で最大**5倍の性能/ワット**を実現し、エネルギー消費を抑えつつ高負荷処理が可能に。\n\n2. **メモリ帯域の
飛躍的向上** \n - HBM3eメモリ(Hopper世代のHBM3より進化版)を搭載し、データ転送速度が向上。...(省略)",
"refusal": null,
"annotations": null,
"audio": null,
"function_call": null,
"tool_calls": [],
"reasoning": "Okay, the user is asking about NVIDIA's Blackwell. Let me start by recalling what I know. Blackwell is NVIDIA's latest GPU architecture, right? It's part of their Ampere lineup, but wait, no
—Blackwell came after Ampere. Let me get the order correct. NVIDIA's architectures have gone through several iterations: Fermi, Kepler, Maxwell, Pascal, GM100 (Ampere), then Ada Lovelace, and now Blackwell....(省略)",
},
"logprobs": null,
"finish_reason": "stop",
"stop_reason": null,
"token_ids": null
}
],
"service_tier": null,
"system_fingerprint": null,
"usage": {
"prompt_tokens": 21,
"total_tokens": 2250,
"completion_tokens": 2229,
"prompt_tokens_details": null
},
"prompt_logprobs": null,
"prompt_token_ids": null,
"kv_transfer_params": null
}
まとめ
本記事では、GPU デバイスごとに Nemotron-Nano-9B-v2-Japanese のデプロイ方法を紹介しました。Nemotron-Nano-9B-v2-Japanese を活用して、是非さまざまな AI アプリケーションを開発してください。