Install NVIDIA Nemotron 3 Nano 4B with Ollama

Install NVIDIA Nemotron 3 Nano 4B with Ollama

 

Run NVIDIA Nemotron 3 Nano 4B Locally on Windows with Ollama

You can run a small NVIDIA language model on a Windows PC, then call it from Python without sending each prompt to a hosted API. This guide sets up Nemotron 3 Nano 4B with Ollama and builds a tiny local tool-calling demo.

This is the released Nemotron 3 Nano 4B model. It is separate from Nemotron 4 Super, which NVIDIA has announced for a later release. The Ollama model page lists the 4B download at about 2.8–2.9 GB and a 256K-token context window. Those figures describe the model package and its supported context; they are not a promise that every computer can run the full context quickly. (Ollama model page)

Access without medium partner: NVIDIA Nemotron 3 Nano 4B Installations

What you’ll build

The setup has three parts: Ollama runs the model in the background, Python sends it messages through Ollama’s local service, and a small Python function acts as a tool the model can request. The tool in this example returns a made-up status from a local dictionary. It needs no account or API key.

Nemotron 3 Nano 4B is an open-weight, approximately four-billion-parameter model intended for on-device use. NVIDIA lists Transformers, vLLM, TensorRT-LLM, and llama.cpp as supported inference engines; Ollama packages a Q4_K_M version for an easier local start. (NVIDIA’s model guide)

Before installing

You need a Windows PC, an internet connection for the initial downloads, and Python 3.10 or newer for the Ollama Python library. Leave several gigabytes free for the model file. The running process also needs working memory for the model and its context, so available RAM or GPU memory matters beyond the download size.

There isn’t one useful hardware minimum for every setup: performance depends on the computer, memory, context length, and whether Ollama can use a supported GPU. Start with short prompts and a small context. If generation is slow, the model can still work on CPU, but waiting for responses may be less pleasant. NVIDIA describes the model as designed for NVIDIA GPU platforms including RTX and Jetson devices; Ollama’s Windows installer and GPU support details are on its download page and GPU documentation.

Install Ollama on Windows

Download and run the Windows installer from ollama.com/download/windows. Ollama runs as a background application. When installation finishes, open a new PowerShell window and check that the command is available:

ollama --version

If PowerShell says it cannot find ollama, close that window, open another, and try again. The installer may have updated the command search path after your existing terminal started.

Now download and start the 4B model:

ollama run nemotron-3-nano:4b

The first run downloads the model, which is roughly 2.8–2.9 GB. When it finishes, enter a prompt such as Give me three practical uses for a local language model. If you get an answer, the basic model setup works. Type /bye to leave the chat.

You can also download it first and launch it later:

ollama pull nemotron-3-nano:4b
ollama run nemotron-3-nano:4b

The first command downloads the model; the second opens an interactive session. ollama list shows downloaded models. (Ollama’s Nemotron page)

Create a Python environment

Keep the demo in its own folder. In PowerShell:

mkdir nemotron-python-demo
cd nemotron-python-demo
py -3 -m venv .venv
.\.venv\Scripts\python.exe -m pip install --upgrade pip
.\.venv\Scripts\python.exe -m pip install ollama

Using the virtual environment’s Python directly avoids changing PowerShell’s script-execution policy just to activate it. The official Ollama Python library supports Python 3.10 and newer and connects to the local Ollama service. (Ollama Python library)

Create a file named ask_nemotron.py in this folder with this first request:

from ollama import chatresponse = chat(
model="nemotron-3-nano:4b",
messages=[
{"role": "user", "content": "Explain a Python virtual environment in two sentences."}
],
)print(response.message.content)

Run it with the environment’s Python:

.\.venv\Scripts\python.exe .\ask_nemotron.py

Ollama must still be running in the background. If the script returns an error saying the model is missing, run ollama pull nemotron-3-nano:4b in PowerShell. If it cannot connect to Ollama, check that the Ollama app is open before rerunning the script. The local API normally listens at http://localhost:11434; the SDK handles that connection for you. (Ollama chat API)

Add a local tool call

A model tool call is a request for the application to run a function. The model does not run Python on its own. Your program receives the proposed function name and arguments, checks them, runs an allowed function, and sends the result back to the model. Ollama’s Python SDK supports passing Python functions as tools. (Ollama tool-calling guide)

Replace ask_nemotron.py with the example below. It exposes one safe, read-only demo function. The “service status” is sample data stored in Python; the function does not inspect your computer or contact a server.

from ollama import chat
MODEL = "nemotron-3-nano:4b"
def lookup_service(name: str) -> str:
"""Look up a service in this demo's local status table."""
statuses = {
"ollama": "The local Ollama service should be running on this computer.",
"python": "The Python demo is running in its project virtual environment.",
}
return statuses.get(name.lower(), "No sample status is available for that name.")

messages = [
{
"role": "user",
"content": "Use the lookup_service tool to check Ollama, then explain the result.",
}
]
response = chat(model=MODEL, messages=messages, tools=[lookup_service])
messages.append(response.message)
tool_calls = response.message.tool_calls or []
for tool_call in tool_calls:
if tool_call.function.name != "lookup_service":
continue
result = lookup_service(**tool_call.function.arguments)
messages.append(
{
"role": "tool",
"tool_name": tool_call.function.name,
"content": result,
}
)
if tool_calls:
final_response = chat(model=MODEL, messages=messages, tools=[lookup_service])
print(final_response.message.content)
else:
print(response.message.content)

Run it again:

.\.venv\Scripts\python.exe .\ask_nemotron.py

The model may answer directly instead of calling the function. That is normal: tool calling is a model decision, not a guarantee that every prompt triggers a tool. The example handles both paths. In a real application, keep the function list small, validate arguments, and require confirmation before any tool changes files, sends messages, runs shell commands, or modifies data. Never route a model’s arbitrary text into eval or a shell.

Check what is running

If responses are slow, inspect the model’s memory use and context before changing anything. A longer context can consume much more memory than the weights alone. Begin with short prompts, close other memory-heavy applications, and check that your graphics driver and Ollama installation are current. If a supported GPU is not available, the model may use CPU instead; this changes speed, not the Python code.

For a useful local benchmark, send the same short prompt five times and note response time, whether the answer is useful, and whether your machine uses CPU or GPU. Do not compare your result directly with an NVIDIA benchmark unless the model quantization, hardware, prompt, context, and measurement method match.

What this setup does — and doesn’t do

You now have a small model running locally and a Python program that can pass a controlled tool result back into the conversation. That is enough to prototype a private assistant, test structured tool use, or learn how a local model fits into a Python application.

It is not the unreleased Nemotron 4 Super, and it will not match every hosted frontier model. The 4B download is modest, but quality and speed depend on the task and hardware. Start with a narrow use case, inspect the output, and add tools only when the program can safely validate what the model asks it to do.


Post a Comment

Previous Post Next Post