Skip to main content
NVIDIA
Explore
Models
Skills
Blueprints
GPUs
Docs
Help Center
Getting Started
  1. Create and verify your account to unlock full access to NVIDIA NIM APIs.
ResourcesDeveloper ForumsContact Support
FAQs
  • View All Playbooks
    View All Playbooks

    onboarding

    • Connect Two DGX Stations for Distributed Workloads
    • MIG on DGX Station

    data science

    • Topic Modeling
    • Build Knowledge Graphs with txt2kg

    tools

    • Quantize Models to NVFP4 with NVIDIA Model Optimizer

    fine tuning

    • Train a Chat Model with NanoChat
    • NVFP4 Pretraining with Megatron Bridge

    use case

    • Run NemoClaw with a Local LLM
    • DGX Station AI Skills and dgx-assist
    • Secure AI Agents with OpenShell
    • Local Coding Agent
    • Profiler-Driven Kernel Optimization for Fine-Tuning
    • Local Healthcare Agent on DGX Station

    inference

    • Serve LLMs with vLLM
    • Generate Images and Videos with ComfyUI
    • Isaac GR00T N1.6 Fine-Tuning
    • Serve LLMs with SGLang

    Local Coding Agent

    30 MINS

    Run local CLI coding agents with Claude Code and Ollama on DGX Station (NVIDIA GB300) using qwen3.6:27b

    • Claude Code
    • Coding
    • DGX Station
    • GB300
    • LLM
    • Ollama
    OverviewOverviewClaude CodeClaude CodeTroubleshootingTroubleshooting

    Step 1
    Confirm your environment

    Description: Verify the GPU is visible before installing anything.

    nvidia-smi
    

    Expected output (example): A table showing driver version and GPU(s). On DGX Station, the GPU name may appear as NVIDIA GB300 (without "Ultra"):

    +-----------------------------------------------------------------------------+
    | NVIDIA-SMI 5xx.xx    Driver Version: 5xx.xx    CUDA Version: 12.x          |
    |-------------------------------+----------------------+----------------------+
    | GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
    |   0  NVIDIA GB300        On   | 00000000:06:00.0 Off |                    0 |
    ...
    

    Step 2
    Install or update Ollama

    Description: Install Ollama or ensure it is recent enough for modern coding models.

    curl -fsSL https://ollama.com/install.sh | sh
    ollama --version
    

    To install a specific version if needed:

    curl -fsSL https://ollama.com/install.sh | OLLAMA_VERSION=0.15.0 sh
    

    If Ollama is already present, simply run:

    ollama --version
    

    Expected output (example):

    ollama version is 0.15.0
    

    Step 3
    Pull a coding model

    Description: Download the model weights to your DGX Station.

    This playbook uses qwen3.6:27b with Claude Code through Ollama:

    ollama pull qwen3.6:27b
    

    Expected output (example): Progress lines followed by "success" and the model in ollama list:

    ollama list
    
    NAME                                ID              SIZE    MODIFIED
    qwen3.6:27b                         abc123...       ...     1 minute ago
    

    Step 4
    Test local inference

    Description: Run a quick prompt to confirm the model loads.

    ollama run qwen3.6:27b
    

    Try a prompt like:

    Write a short README checklist for a Python project.
    

    Expected output: The model replies with a short README checklist.

    Exit the Ollama REPL when done: type /bye or press Ctrl+D.

    Step 5
    Install Claude Code

    Description: Install the CLI tool that will drive the local model.

    curl -fsSL https://claude.ai/install.sh | bash
    

    Verify the installation:

    claude --version
    

    Expected output (example): A version string such as claude 0.x.x or similar. If you see claude: command not found, ensure the install script added the CLI to your PATH (e.g. restart the terminal or source your shell profile); see Troubleshooting.

    Step 6
    Increase context length (optional)

    Description: Ollama defaults to a 4096 token context length. For coding agents and larger codebases, set it to 64K tokens. This increases memory usage. For more details on configuring context length and other parameters, see the Ollama documentation (context window and runtime options).

    Set the context length per session in the Ollama REPL:

    ollama run qwen3.6:27b
    

    Then, in the Ollama prompt:

    /set parameter num_ctx 64000
    
    

    Exit when done: type /bye or press Ctrl+D.

    Optional method (set globally when serving Ollama):

    sudo systemctl stop ollama
    OLLAMA_CONTEXT_LENGTH=64000 ollama serve 
    

    Keep this terminal open and run the next step in a new terminal.

    Step 7
    Connect Claude Code to Ollama

    Description: Launch Claude Code through Ollama with the model you pulled.

    ollama launch claude --model qwen3.6:27b
    

    Expected output: Claude Code starts and uses the local Ollama model.

    Exit Claude Code when done: type /exit or press Ctrl+C.

    Step 8
    Complete a small coding task

    Description: Create a tiny repo and let Claude Code implement a function and tests.

    mkdir -p ~/cli-agent-demo
    cd ~/cli-agent-demo
    python3 -m venv .venv
    source .venv/bin/activate
    python3 -m pip install -U pytest
    
    printf 'def add(a, b):\n    """Return the sum of a and b."""\n    pass\n' > math_utils.py
    printf 'import math_utils\n\n\ndef test_add():\n    assert math_utils.add(1, 2) == 3\n' > test_math_utils.py
    

    If Claude Code is not already running, launch it:

    ollama launch claude --model qwen3.6:27b
    

    In Claude Code, enter:

    Please implement add() in math_utils.py and make sure the test passes.
    

    Exit Claude Code when finished: type /exit or press Ctrl+C, then run the test:

    python3 -m pytest -q
    deactivate
    

    Expected output should show the test passing.

    Step 9
    Cleanup and rollback

    Description: Remove the model and stop the Ollama service if you no longer need them. Remove the model first (while the Ollama server is running), then stop the service.

    WARNING

    The following removes the downloaded model files from disk.

    1. Remove the model (Ollama must be running). Use the same name you pulled:

    ollama rm qwen3.6:27b
    

    2. Stop the Ollama service:

    sudo systemctl stop ollama
    

    Step 10
    Next steps

    • Use larger context (e.g. 64K–198K) for big codebases.
    • Use Claude Code on multi-file refactors or test-generation tasks.

    Resources

    • Ollama Documentation
    • Qwen3.6 27B
    • Claude Code + Ollama Guide
    Terms of Use
    Privacy Policy
    Your Privacy Choices
    Contact

    Copyright © 2026 NVIDIA Corporation