Skip to navigation

Get Started with Inkling-2-Small

View as MarkdownOpen in Claude

Deploy Inkling-2-Small using the SGLang Model-Free NIM Experimental Collection. The collection provides a model-free container and a separate serving recipe resource. Supply the model weights at runtime and load the recipe for your GPU and topology. For the supported configurations, refer to Inkling-2-Small.

Inkling-2-Small is a sparse mixture-of-experts model with 594B total and 17B active parameters, published in NVFP4 precision. It accepts text and image input and returns text. Audio and video input are not supported.

Use container and recipe version 2.1.9-variant-inkling-2-small together. A recipe may set engine options that another container version does not support. The container does not include model weights. Download the Thinking Machines checkpoint separately, as shown below.

For the generic NIM LLM and VLM onboarding path, refer to Quickstart. For endpoint schemas, refer to API Reference.

Prerequisites

Before deploying the container, ensure your environment meets the following requirements:

Hardware Requirements

The following are the minimum required specifications for supported hardware components:

RequirementSpecification
CPUAMD64, ARM64
GPURefer to the Support Matrix for NIMs

Software Requirements

Minimum required versions for supported software components.

RequirementSpecification
Operating SystemUbuntu 22.04 LTS or later recommended
Container Toolkit1.14.0 or later
CUDA SDK12.9 or later
GPU Driver580 or later
Docker24.0 or later

Operating System

While other Linux distributions can be compatible with NIM, they have not been officially validated.

We recommend using Ubuntu 22.04 LTS or later for the best experience.

CUDA SDK

Install CUDA SDK by following the CUDA installation guide for Linux.

GPU Drivers

Install the NVIDIA GPU drivers by following the NVIDIA Driver Installation Guide.

Docker

Docker is required to run the containerized NIM services.

  1. Install Docker Engine for your Linux distribution by following the Docker Engine installation guide.

  2. Verify that the Docker daemon is running and that your user can execute docker commands without sudo. Add your user to the docker group if needed:

    sudo groupadd docker
    sudo usermod -aG docker $USER
  3. Log out and back in for the group change to take effect.

Container Toolkit

The NVIDIA Container Toolkit enables Docker containers to access the host GPU.

  1. Install the toolkit by following the NVIDIA Container Toolkit installation guide.

  2. Configure Docker to use the NVIDIA runtime by following the Docker configuration steps.

  3. Restart the Docker daemon after configuration:

    sudo systemctl restart docker

NIM Container Access

To download and deploy NIM containers, you need one of the following:

Generate Access Credentials

NGC

An NGC Personal API key is not required to access most NVIDIA NIM containers and models hosted on NGC. An NGC API key is only required to download Production Branch (PB) models. This Get Started documentation uses a feature branch model as an example, so creating an NGC Personal API key is optional.

If you want to create an NGC Personal API key, do the following:

  1. Generate the Personal API Key on the Setup API Keys page.

  2. When creating the Personal API key, select at least NGC Catalog from the Services Included list. You can also include additional services if you want to use the same key for other purposes.

Legacy API keys are not supported by NIM. Always use a Personal API Key.

Hugging Face

Create a Hugging Face access token with read permissions (or higher, only if your org or private repos require it). This token allows model-free NIM to fetch models directly from Hugging Face.

Verify NVIDIA Runtime Access

To ensure that your setup is correct, run the following command:

docker run --rm --runtime=nvidia --gpus all ubuntu nvidia-smi

This command should produce output similar to one of the following, where you can confirm CUDA driver version, and available GPUs.

+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 580.95.05 Driver Version: 580.95.05 CUDA Version: 12.9 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA H100 80GB HBM3 On | 00000000:1B:00.0 Off | 0 |
| N/A 36C P0 112W / 700W | 78489MiB / 81559MiB | 0% Default |
| | | Disabled |
+-----------------------------------------+------------------------+----------------------+
+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| No running processes found |
+-----------------------------------------------------------------------------------------+

In addition, this model has the following requirements:

  • GPUs: Run each deployment on a single node whose GPUs are connected by NVLink. Use four B200 or GB200 GPUs, or eight H200, H20 (96 GB), or H20-3e GPUs. Data parallelism and pipeline parallelism are not supported for this model.
  • Disk space: The NVFP4 checkpoint is approximately 394 GB (367 GiB). Provide at least 400 GB of free space for it, in addition to approximately 40 GB for the container image.
  • NGC CLI: Install the NGC CLI to download the serving recipe.
  • GB200 only: Configure an IMEX domain on the host that spans one tray with four GPUs.

Configure Authentication and Caching

The Hugging Face repository for this model is public, so a Hugging Face token is optional. Review the model’s license and acceptable use policy on Hugging Face before you download the weights.

Export a Hugging Face Access Token

Export a Hugging Face token to download models from Hugging Face.

  1. Export the variable in your shell (temporary), replacing <token-value> with your actual token:

    export HF_TOKEN="<token-value>"
  2. Optional: Persist the variable in your shell profile for future terminals.

    If using bash:

    echo 'export HF_TOKEN="<token-value>"' >> ~/.bashrc

    If using zsh:

    echo 'export HF_TOKEN="<token-value>"' >> ~/.zshrc
  3. Verify the variable is set:

    echo "$HF_TOKEN"

Export an NGC API Key

An NGC API key is only required to download Production Branch (PB) models. You can skip this section if you did not create an NGC API key.

  1. Export the variable in your shell (temporary), replacing <VALUE> with your actual API key:

    export NGC_API_KEY=<VALUE>
  2. Optional: Persist the variable in your shell profile for future terminals.

    If using bash:

    echo "export NGC_API_KEY=$NGC_API_KEY" >> ~/.bashrc

    If using zsh:

    echo "export NGC_API_KEY=$NGC_API_KEY" >> ~/.zshrc
  3. Verify the variable is set:

    echo "$NGC_API_KEY"

Model Cache

NIM downloads model weights to a cache on the host that you mount into the container. Artifacts persist across restarts, so you do not pull the full model on every run.

Local Cache

An essential variable to configure on your host system is the cache path directory. This directory is mapped from the host machine to container; assets (for example, model weights) are downloaded to this host directory and persist across container restarts. Configuring a local cache is highly recommended, as it avoids re-downloading large model files upon subsequent container restarts. You can name the environment variable containing the path to the local cache whatever you want.

Create the cache directory and export an environment variable:

export LOCAL_NIM_CACHE=~/.cache/nim
mkdir -p $LOCAL_NIM_CACHE
# Optionally add sticky bit to avoid issues writing to the cache if the container is running as a different user
chmod -R a+rwxt $LOCAL_NIM_CACHE

When you start the NIM container, you must map your host machine’s local cache directory ($LOCAL_NIM_CACHE) to the container’s internal cache path (/opt/nim/.cache) using a Docker volume mount, such as -v "$LOCAL_NIM_CACHE:/opt/nim/.cache". This mapping ensures that the large model weights downloaded by the container are saved to your host machine. Because containers are ephemeral, any data stored only inside the container is lost when it stops. By using a volume mount, subsequent container runs detect the existing model files in your local cache and skip the lengthy download process, allowing the NIM to start up faster.

If you created an NGC API key, authenticate with the NVIDIA Container Registry using the following command:

echo "$NGC_API_KEY" | docker login nvcr.io --username '$oauthtoken' --password-stdin

Use $oauthtoken as the username and NGC_API_KEY as the password. The $oauthtoken username is a special name that indicates that you will authenticate with an API key and not a user name and password.

Choose the Model Source

Choose one of the following model sources.

To download the checkpoint from Hugging Face when the container starts, set NIM_MODEL_PATH to the repository. Append the revision that the recipes were validated with to pin the download to that revision:

export NIM_MODEL_PATH="hf://thinkingmachines/Inkling-2-Small:ef5bf64c1b8e7d0e57b284e10c6891f8db6304c4"

Without the revision suffix, NIM follows the main branch of the repository. NIM saves the downloaded files in the mounted cache, so the cache volume needs approximately 400 GB of free space.

To use a checkpoint that you already downloaded, set MODEL_DIR to the host directory that contains the Hugging Face files. The launch command in Run NIM mounts it read-only:

export MODEL_DIR=/path/to/Inkling-2-Small
export NIM_MODEL_PATH=/opt/nim/model

For other sources, refer to Supported Model Sources.

Pull the Container and Download the Recipe

Pull the experimental SGLang Model-Free NIM container and download the matching Inkling-2-Small recipe. Both artifacts use version 2.1.9-variant-inkling-2-small:

docker pull nvcr.io/nim/nvidia/sglang-model-free-nim-experimental:2.1.9-variant-inkling-2-small
ngc registry resource download-version "nim/nvidia/inkling-2-small-recipe:2.1.9-variant-inkling-2-small"
export RECIPE_DIR="$PWD/inkling-2-small-recipe_v2.1.9-variant-inkling-2-small"
chmod 0755 "$RECIPE_DIR"
chmod 0644 "$RECIPE_DIR"/*.yaml

The container runs as UID 1000. The NGC CLI can save the recipe directory and files with modes 0700 and 0600, so that only the downloading user can read them. The chmod commands make them readable by the container user and change only the file mode.

Select a Recipe

Each GPU type has two recipes. The standard recipe uses plain decoding. The recipe whose name ends in -dspark.yaml enables DSpark speculative decoding. Select the recipe for your GPU type, and set GPU_COUNT to the GPU count in the recipe name:

GPUGPU countStandard recipeDSpark recipe
B2004inkling-2-small-nvfp4-b200-4gpu-tp4-ep4.yamlinkling-2-small-nvfp4-b200-4gpu-tp4-ep4-dspark.yaml
GB2004inkling-2-small-nvfp4-gb200-4gpu-tp4-ep4.yamlinkling-2-small-nvfp4-gb200-4gpu-tp4-ep4-dspark.yaml
H2008inkling-2-small-nvfp4-h200-8gpu-tp8-ep8.yamlinkling-2-small-nvfp4-h200-8gpu-tp8-ep8-dspark.yaml
H20 (96 GB)8inkling-2-small-nvfp4-h20-8gpu-tp8-ep8.yamlinkling-2-small-nvfp4-h20-8gpu-tp8-ep8-dspark.yaml
H20-3e8inkling-2-small-nvfp4-h20-3e-8gpu-tp8-ep8.yamlinkling-2-small-nvfp4-h20-3e-8gpu-tp8-ep8-dspark.yaml

For example, to use four B200 GPUs with standard decoding, set:

export RECIPE="$RECIPE_DIR/inkling-2-small-nvfp4-b200-4gpu-tp4-ep4.yaml"
export GPU_COUNT=4
GPU_DOCKER_ARGS=()

For GB200, also set the IMEX channel:

GPU_DOCKER_ARGS=(-e NVIDIA_IMEX_CHANNELS=0)

For all other GPU types, leave GPU_DOCKER_ARGS empty (GPU_DOCKER_ARGS=()). Run the launch command in the same Bash shell where you set these variables.

All recipes use the following settings:

Recipe settingValue
context_length1048576 (1M tokens)
tp_size and ep_sizeEqual to the GPU count
served_model_namethinkingmachines/Inkling-2-Small
reasoning_parserinkling
tool_call_parserinkling2
enable_multimodaltrue (image input)
no_allow_local_media_filestrue
enable_response_storetrue
max_running_requests (DSpark recipes only)192 on B200 and GB200, 64 on H200, H20, and H20-3e

Run NIM

Mount the selected recipe read-only and load it with NIM_CONFIG_FILE.

To download the checkpoint from Hugging Face, mount the cache:

docker run --rm --name inkling-2-small \
--gpus "$GPU_COUNT" --ipc=host --shm-size=32g --ulimit memlock=-1 \
"${GPU_DOCKER_ARGS[@]}" \
-e NIM_MODEL_PATH="$NIM_MODEL_PATH" \
-e HF_TOKEN \
-e NIM_CONFIG_FILE=/opt/nim/recipe.yaml \
-v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
-v "$RECIPE:/opt/nim/recipe.yaml:ro" \
-p 8000:8000 \
nvcr.io/nim/nvidia/sglang-model-free-nim-experimental:2.1.9-variant-inkling-2-small

To use a local checkpoint, mount the model directory read-only instead:

docker run --rm --name inkling-2-small \
--gpus "$GPU_COUNT" --ipc=host --shm-size=32g --ulimit memlock=-1 \
"${GPU_DOCKER_ARGS[@]}" \
-e NIM_MODEL_PATH="$NIM_MODEL_PATH" \
-e NIM_CONFIG_FILE=/opt/nim/recipe.yaml \
-v "$MODEL_DIR:/opt/nim/model:ro" \
-v "$LOCAL_NIM_CACHE:/opt/nim/.cache" \
-v "$RECIPE:/opt/nim/recipe.yaml:ro" \
-p 8000:8000 \
nvcr.io/nim/nvidia/sglang-model-free-nim-experimental:2.1.9-variant-inkling-2-small

A recipe is required for this model. The recipe sets the parallel layout, and the engine accepts only one layout per node for this model: expert parallelism equal to tensor parallelism, with no data or pipeline parallelism. Starting the container without NIM_CONFIG_FILE is not a supported configuration.

Note the following about the launch options:

  • GPU count: Expose exactly the GPU count of the recipe. If more GPUs are visible, NIM uses the first GPUs up to the recipe’s tp_size and logs a warning that names the used and idle GPUs. If fewer GPUs are visible, the container does not start.
  • Shared memory: The container needs more shared memory than the Docker default of 64 MB. With the default, startup fails after one to two minutes with NCCL error: unhandled system error. Keep --ipc=host, --shm-size=32g, and --ulimit memlock=-1, which every validated configuration uses. On GB200, all three options are required.

Override a Recipe Setting

While NIM_CONFIG_FILE is set, the recipe is authoritative. A key in the recipe takes precedence over the matching NIM_* environment variable, NIM_PASSTHROUGH_ARGS, and container command-line options. Settings that the recipe does not name follow the usual precedence. For the general recipe workflow, refer to Run with a Downloaded Serving Recipe.

To run with a different value for a recipe key, edit a copy of the recipe and set RECIPE to the copy. Any change moves the deployment outside the validated configuration.

Interact with the API

The container provides /v1/chat/completions, /v1/completions, /v1/responses, and the Anthropic-compatible /v1/messages endpoint. Use the running container’s /docs explorer for request and response schemas. For additional request formats, refer to API Reference.

Verify Health Endpoints

Wait for the model to load before sending inference requests. The readiness endpoint returns HTTP 200 when the model is ready:

until curl --fail --silent --output /dev/null http://localhost:8000/v1/health/ready; do
sleep 10
done

With the weights on local disk, startup takes approximately 10 to 15 minutes for weight loading and CUDA graph capture. The first start with an hf:// model path also includes the download time. Set Kubernetes startup probes and client timeouts accordingly.

Find the Model Name

The recipes set served_model_name to thinkingmachines/Inkling-2-Small. Query /v1/models to confirm the identifier:

curl --fail http://localhost:8000/v1/models

Use this identifier in the model field of every request. You do not need to set NIM_SERVED_MODEL_NAME.

Send a Chat Completion Request

curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "thinkingmachines/Inkling-2-Small",
"messages": [{"role": "user", "content": "What is 17 multiplied by 23?"}],
"max_tokens": 2048
}'

The model reasons by default. The response returns the reasoning text in choices[0].message.reasoning_content and the final answer in choices[0].message.content. Reasoning tokens count against max_tokens. If the response ends with finish_reason: "length" and an empty content, increase max_tokens and retry.

Streaming

To receive output incrementally, add "stream": true to the request. The API returns Server-Sent Events. Streamed chunks carry reasoning in choices[0].delta.reasoning_content and the answer in choices[0].delta.content, and the stream ends with data: [DONE].

Control Reasoning

Set the top-level reasoning_effort field of a Chat Completions request to control reasoning:

  • To turn reasoning off, set "reasoning_effort": "none".
  • To select an effort, set reasoning_effort to minimal, low, medium, high, xhigh, or max, or to a number from 0.0 to 0.99.

If you omit reasoning_effort, the model reasons at its default effort. Other values return HTTP 400. The chat_template_kwargs flags enable_thinking and thinking have no effect on this model.

For example, to answer without reasoning:

curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "thinkingmachines/Inkling-2-Small",
"messages": [{"role": "user", "content": "What is 17 multiplied by 23?"}],
"max_tokens": 1024,
"reasoning_effort": "none"
}'

Send an Image Request

Include text and image_url content parts in a user message. The image can be an http or https URL that the container can reach, or a base64 data: URI:

curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "thinkingmachines/Inkling-2-Small",
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "Describe the image in one sentence."},
{"type": "image_url", "image_url": {"url": "https://assets.ngc.nvidia.com/products/api-catalog/phi-3-5-vision/example1b.jpg"}}
]
}],
"max_tokens": 2048
}'

Every recipe sets no_allow_local_media_files: true. An image given as a path or a file:// URL inside the container returns HTTP 400. The recipes do not restrict the hosts from which the container fetches http or https images. If your deployment requires that restriction, apply it at the network level.

Audio and video content parts are not supported and return HTTP 400.

Tool Calling

Supply function definitions in tools. The model can return one or more tool calls in choices[0].message.tool_calls. Your application runs each tool and sends the result in a tool message in the next request. tool_choice accepts auto, required, none, or a named function. For a complete execution loop, refer to Tool Calling and MCP Integration.

curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "thinkingmachines/Inkling-2-Small",
"messages": [{"role": "user", "content": "What is the weather in Paris?"}],
"tools": [{"type": "function", "function": {
"name": "get_weather",
"description": "Get the current weather for a city.",
"parameters": {
"type": "object",
"properties": {"city": {"type": "string"}},
"required": ["city"]
}
}}],
"max_tokens": 2048
}'

Structured Output

Use response_format to constrain the answer to a JSON schema. The constraint applies to the answer in content, not to the reasoning text:

curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "thinkingmachines/Inkling-2-Small",
"messages": [{"role": "user", "content": "Name the largest city in Japan and its population in millions."}],
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "city",
"strict": true,
"schema": {
"type": "object",
"properties": {
"city": {"type": "string"},
"population_millions": {"type": "number"}
},
"required": ["city", "population_millions"],
"additionalProperties": false
}
}
},
"max_tokens": 2048
}'

Send a Responses Request

The recipes enable the response store, so you can retrieve a stored response with GET /v1/responses/{response_id} and continue a conversation with previous_response_id:

curl http://localhost:8000/v1/responses \
-H "Content-Type: application/json" \
-d '{
"model": "thinkingmachines/Inkling-2-Small",
"input": "Name one prime number greater than 10.",
"max_output_tokens": 2048
}'

The model reasons by default. The response output contains a reasoning item followed by the message item. To select an effort, add "reasoning": {"effort": "low"}.

Send an Anthropic-Compatible Messages Request

On /v1/messages, the model does not reason unless the request asks for it. To request reasoning, add a thinking block:

curl http://localhost:8000/v1/messages \
-H "Content-Type: application/json" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "thinkingmachines/Inkling-2-Small",
"max_tokens": 2048,
"thinking": {"type": "enabled", "budget_tokens": 1024},
"messages": [{"role": "user", "content": "What is 17 multiplied by 23?"}]
}'

The response returns the reasoning in a thinking content block before the text block.

Troubleshooting

  • Startup fails with NCCL error: unhandled system error: The container does not have enough shared memory. Add --ipc=host --shm-size=32g --ulimit memlock=-1 to docker run.
  • The container does not start: Confirm that NIM_CONFIG_FILE is set, that the recipe matches your GPU type, and that at least the recipe’s GPU count is visible to the container. Use the container and recipe from the same version.
  • The recipe cannot be read: Run chmod 0755 on the recipe directory and chmod 0644 on the recipe files, as shown in Run NIM.
  • Requests fail with a model-name error: Query /v1/models and use the reported identifier, thinkingmachines/Inkling-2-Small.
  • An answer is empty: Check finish_reason. If it is length, the reasoning used the output budget. Increase max_tokens, or set reasoning_effort to a lower effort or to none.
  • An image request returns HTTP 400: Send an http or https URL that the container can reach, or a base64 data: URI. Local paths and file:// URLs are not allowed.
  • A request with stop returns an empty or truncated answer: Stop strings also match control-token text and reasoning text. Refer to the stop-string known issue.

For additional diagnostics, refer to Troubleshooting.

Next Steps