Claude Skills Guide

Claude Code for NeMo Framework Workflow Guide

NVIDIA NeMo Framework is a powerful platform for building, training, and deploying generative AI models—including large language models, speech AI, and multimodal systems. This guide shows you how to integrate Claude Code into your NeMo development workflow to accelerate prototyping, streamline training configurations, and simplify deployment pipelines.

Understanding NeMo Framework Architecture

NeMo Framework provides a modular architecture for AI development. Before integrating Claude Code, understanding the core components helps you work more effectively:

Claude Code can help you navigate these components by explaining APIs, generating boilerplate code, and debugging issues across the stack.

Setting Up Your NeMo Development Environment

Start by configuring a proper development environment. Claude Code can guide you through installation and dependency management:

# Create a new conda environment for NeMo
conda create -n nemo python=3.10
conda activate nemo

# Install NeMo framework
pip install nemo-toolkit

# Verify installation
python -c "import nemo; print(nemo.__version__)"

When you encounter dependency conflicts or CUDA version mismatches, describe the error to Claude Code. It can suggest compatible version combinations or workarounds.

IDE Configuration

For optimal development, configure your editor to work with NeMo’s structure:

{
  "python.linting.enabled": true,
  "python.linting.pylintEnabled": true,
  "python.analysis.typeCheckingMode": "basic",
  "files.exclude": {
    "**/__pycache__": true,
    "**/*.pyc": true
  }
}

Building Models with Claude Code Assistance

Model Configuration

NeMo uses configuration files (YAML) to define model architectures. Claude Code can help you create and modify these configurations:

# Example: LLM Configuration
model:
  language_model:
    architectur: "gpt"
    hidden_size: 4096
    num_layers: 32
    num_attention_heads: 32
  training:
    micro_batch_size: 4
    global_batch_size: 32
    lr: 1e-4
    num_nodes: 1
    num_gpus_per_node: 4

Ask Claude Code to explain configuration parameters or suggest optimal values based on your hardware setup.

Custom Model Implementation

When building custom models, use Claude Code to generate NeMo-compatible classes:

import torch
from nemo.core import NeuralModule

class CustomTransformer(NeuralModule):
    def __init__(self, vocab_size, hidden_size, num_layers, num_heads):
        super().__init__()
        self.embedding = torch.nn.Embedding(vocab_size, hidden_size)
        self.transformer = torch.nn.TransformerEncoder(
            torch.nn.TransformerEncoderLayer(
                d_model=hidden_size,
                nhead=num_heads,
                batch_first=True
            ),
            num_layers=num_layers
        )
        self.output_layer = torch.nn.Linear(hidden_size, vocab_size)
    
    def forward(self, input_ids, attention_mask):
        embeddings = self.embedding(input_ids)
        encoded = self.transformer(embeddings, src_key_padding_mask=attention_mask)
        return self.output_layer(encoded)

Claude Code can also help you implement custom metrics, callbacks, and data loaders compatible with NeMo’s training pipeline.

Data Curation and Preprocessing

NeMo Curator Pipelines

NeMo Curator provides scalable data preprocessing. Here’s a typical workflow:

from nemo.curator import DocumentTokenizer
from nemo.curator import DataBalancer

# Tokenize documents
tokenizer = DocumentTokenizer(
    tokenizer_type="bert",
    vocab_file="vocab.txt"
)

# Balance dataset across domains
balancer = DataBalancer(
    stratify_by="domain",
    max_samples_per_class=10000
)

Ask Claude Code to optimize these pipelines for your specific data types or to add custom preprocessing steps.

Training Workflow Optimization

Distributed Training Setup

NeMo supports multi-GPU and multi-node training. Claude Code can help you configure these setups:

# Single node multi-GPU training
python train.py trainer.num_gpus=4

# Multi-node training
python train.py trainer.num_nodes=2 trainer.num_gpus=4

Debugging Training Issues

When training fails, provide the error logs to Claude Code:

“I’m getting an out-of-memory error during forward pass with batch size 8 on A100. The model has 7B parameters.”

Claude Code might suggest:

Checkpoint Management

Implement smart checkpoint handling:

from nemo.utils import checkpoint
from pytorch_lightning.callbacks import ModelCheckpoint

checkpoint_callback = ModelCheckpoint(
    dirpath="checkpoints/",
    filename="nemo-{epoch:02d}-{val_loss:.2f}",
    save_top_k=3,
    monitor="val_loss",
    mode="min",
    save_weights_only=False
)

Deployment and Inference

Model Export

Export trained models for inference:

import nemo.export

# Export to TensorRT
nemo.export.export_to_trt(
    nemo_model,
    output="model.trt.engine",
    precision="fp16"
)

# Export to ONNX
nemo.export.export_to_onnx(
    nemo_model,
    output="model.onnx"
)

Claude Code can help you optimize these exports for specific inference targets.

Inference Optimization

For production inference, consider:

import torch

# Enable optimizations
torch.set_float32_matmul_precision('high')
torch.backends.cudnn.benchmark = True

# Use TorchScript for deployment
model.eval()
traced_model = torch.jit.trace(model, example_inputs)
traced_model.save("model.pt")

Practical Tips for NeMo Development

  1. Start Small: Test configurations with smaller models before scaling up
  2. Use Configs as Code: Keep YAML configs version-controlled
  3. Monitor Resources: Use NVIDIA’s tools to track GPU memory and utilization
  4. Validate Early: Run inference on test samples before full training
  5. Document Experiments: Track hyperparameters and results systematically

Claude Code can help you set up experiment tracking or generate training reports automatically.

Conclusion

Integrating Claude Code into your NeMo Framework workflow accelerates development through faster prototyping, intelligent debugging, and automated code generation. Whether you’re building LLMs, speech models, or multimodal systems, Claude Code serves as an intelligent development partner throughout the AI development lifecycle.

Start with simple tasks—configuration explanation and code generation—then progressively use its capabilities for complex debugging and optimization challenges. The combination of Claude Code’s contextual understanding and NeMo’s powerful abstractions enables rapid iteration from prototype to production.

Built by theluckystrike — More at zovo.one