LLM API Guide

How to Use NVIDIA Nemotron Labs Dory 1.0 API

Run Dory 1.0 locally behind an OpenAI-compatible API with vLLM, SGLang, or llama.cpp; hosted inference is not listed yet, so start from NVIDIA's model card.

An editorial collage shows one API cable branching toward three differently sized server modules, with chips, a keyboard, coins, and abstract code textures suggesting multiple inference backends and API cost.
Illustration, AI-generated

Summary

  1. Dory 1.0 exposes OpenAI-compatible chat completions through vLLM, SGLang, or llama.cpp.
  2. Use two recurrent loops first; one reduces compute, while four can improve agentic-task accuracy.
  3. The model card lists no hosted inference provider, so API access currently means running the server yourself.

Run NVIDIA Nemotron Labs Dory 1.0 as a local OpenAI-compatible API with the commands in NVIDIA's Dory 1.0 model card. The card documents vLLM, SGLang, and llama.cpp servers, but its Inference Providers section currently lists no hosted deployment, so you need your own machine or GPU service.

On this page

Pick the serving path

Dory 1.0 is a 4B BF16 model with a maximum context of 256K tokens. NVIDIA lists Linux with Hopper or Blackwell GPUs for the PyTorch path. The model is English-focused and uses a looped architecture: the recurrent block runs several times at inference time, letting you trade compute for accuracy without downloading another checkpoint.

Use vLLM when you want the documented 256K context, reasoning output, and tool-call parsers. Use SGLang for its straightforward OpenAI-compatible server. Use llama.cpp when you want the Q5_K_M GGUF checkpoint and a local server on Apple Silicon.

Start vLLM

Dory support is still under review in vLLM pull request #60149. Until a release includes it, install the pull request revision:

bash
VLLM_USE_PRECOMPILED=1 pip install "git+https://github.com/vllm-project/vllm.git@refs/pull/60149/head"

Start with two recurrent loops:

bash
vllm serve --model nvidia/NVIDIA-Nemotron-Labs-Dory1.0-4B-BF16 \
    --hf-overrides '{"n_recurrent_loops": 2, "recurrent_kv_cache_mode": "per_loop"}' \
    --max-model-len 262144 \
    --max-num-seqs 128 \
    --enable-prefix-caching \
    --async-scheduling \
    --reasoning-parser nemotron_v3 \
    --tool-call-parser qwen3_coder \
    --enable-auto-tool-choice

NVIDIA recommends two loops as the starting point. Set n_recurrent_loops to 1 when compute per token matters most, or to 4 when accuracy on agentic tasks matters more. Higher loop counts can reduce generated-token counts, so compare end-to-end latency and cost on your workload.

The default command keeps a separate KV cache for each loop. To keep the cache near the one-loop footprint, change the override to:

bash
--hf-overrides '{"n_recurrent_loops": 2, "recurrent_kv_cache_mode": "last_loop"}'

With last_loop, each recurrent pass overwrites the previous pass's cache. NVIDIA reports accuracy close to per_loop, with nearly unchanged output lengths.

Start SGLang

The model card documents this SGLang server:

bash
pip install sglang
python3 -m sglang.launch_server \
    --model-path "nvidia/NVIDIA-Nemotron-Labs-Dory1.0-4B-BF16" \
    --host 0.0.0.0 \
    --port 30000

When the process is ready, send an OpenAI-format request:

bash
curl -X POST "http://localhost:30000/v1/chat/completions" \
    -H "Content-Type: application/json" \
    --data '{
        "model": "nvidia/NVIDIA-Nemotron-Labs-Dory1.0-4B-BF16",
        "messages": [
            {
                "role": "user",
                "content": "What is the capital of France?"
            }
        ]
    }'

A successful response is a JSON chat-completion object. The model card does not document Dory-specific loop or KV-cache flags for SGLang, so use vLLM or llama.cpp when you need those controls.

Build llama.cpp on Apple Silicon

llama.cpp loads GGUF, not the BF16 Hugging Face files. NVIDIA's instructions pin a Dory-enabled revision for native ARM64 macOS:

bash
brew install cmake openssl@3
git init llama.cpp-dory
cd llama.cpp-dory
git remote add origin https://github.com/brianchmielNV/llama.cpp.git
git fetch --depth 1 origin 98a74c97ea09ac72f6ceda1559808fc0a2f447ce
git checkout --detach FETCH_HEAD

HF_UI_VERSION=b11551 cmake -S . -B build \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_OSX_ARCHITECTURES=arm64 \
    -DCMAKE_OSX_SYSROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk" \
    -DGGML_METAL=ON -DGGML_METAL_EMBED_LIBRARY=ON \
    -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=Apple \
    -DLLAMA_BUILD_SERVER=ON \
    -DLLAMA_BUILD_TESTS=OFF -DLLAMA_BUILD_EXAMPLES=OFF -DLLAMA_BUILD_APP=OFF \
    -DLLAMA_BUILD_UI=OFF -DLLAMA_USE_PREBUILT_UI=ON \
    -DLLAMA_OPENSSL=ON -DOPENSSL_ROOT_DIR="$(brew --prefix openssl@3)"
cmake --build build --parallel 4 --target llama-server

Download dory-q5_k_m.gguf, place it in llama.cpp-dory/, and verify the file before starting the server:

bash
echo "96080be49ffd67b916018b7bdef8c484762576fb52780e10ab98ac4978a660e0  dory-q5_k_m.gguf" | shasum -a 256 -c -

The expected file size is 3,673,288,864 bytes. Launch the local API with two loops:

bash
./build/bin/llama-server \
    -m ./dory-q5_k_m.gguf \
    --alias dory \
    --host 127.0.0.1 --port 8080 \
    -ngl 999 \
    --ctx-size 4096 --parallel 1 \
    --batch-size 512 --ubatch-size 512 \
    --cache-type-k f16 --cache-type-v f16 \
    --flash-attn off \
    --no-context-shift \
    --jinja --reasoning on \
    --temp 1.0 --top-p 0.95 --top-k 0 --min-p 0 --repeat-penalty 1 \
    --override-kv "dory.num_loops=int:2,dory.recurrent_kv_cache_mode=str:per_loop"

The API is available at http://127.0.0.1:8080/v1, and the model name is dory. This server binds to localhost and has no authentication. Keep the prompt, history, and output within the configured --ctx-size of 4,096 tokens.

For last-loop caching, replace the final override with:

bash
--override-kv "dory.num_loops=int:2,dory.recurrent_kv_cache_mode=str:last_loop"

Call the API from Python

For vLLM, use the model identifier passed to --model:

python
from openai import OpenAI

client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
MODEL = "nvidia/NVIDIA-Nemotron-Labs-Dory1.0-4B-BF16"
MAX_TOKENS = 16000

response = client.chat.completions.create(
    model=MODEL,
    messages=[{"role": "user", "content": "Write a haiku about GPUs"}],
    max_tokens=MAX_TOKENS,
    temperature=1.0,
    top_p=0.95,
)
print(response.choices[0].message.content)

For llama.cpp, use the dory alias and leave room for the 4,096-token context:

python
from openai import OpenAI

client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="EMPTY")
MODEL = "dory"
MAX_TOKENS = 2048

Streaming uses the same endpoint:

python
stream = client.chat.completions.create(
    model=MODEL,
    messages=[{"role": "user", "content": "Explain how a transformer works in two sentences"}],
    max_tokens=MAX_TOKENS,
    temperature=1.0,
    top_p=0.95,
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="", flush=True)

Enable tool calling in vLLM

The vLLM command already enables automatic tool choice with the qwen3_coder parser and nemotron_v3 reasoning parser. For coding agents, add this request body:

python
extra_body={"chat_template_kwargs": {"force_nonempty_content": True}}

llama.cpp uses --jinja for chat-template-based tool calling, so it does not use the vLLM parser flags.

Quantized checkpoints

NVIDIA lists four formats: BF16 (W16A16), MXFP8 (W8A16), NVFP4 (W4A16), and a Q5_K_M GGUF export for llama.cpp. The benchmark table in the model card uses BF16, so do not treat quantized-checkpoint results as identical to those figures.

Not confirmed yet

The model card does not list a hosted inference provider, per-token price, or a managed API endpoint for Dory 1.0. vLLM and llama.cpp support are documented through development revisions, so the exact release that first includes each integration remains to be confirmed.

Sources and checks

  1. nvidia/NVIDIA-Nemotron-Labs-Dory1.0-4B-BF16
  2. Model Add Dory support, Pull Request #60149