Text Generation
Transformers
Safetensors
GGUF
English
code
coding
software-engineering
autonomous-agent
ollama
conversational
Instructions to use NIM-AI/NIM-2-Coder-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NIM-AI/NIM-2-Coder-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NIM-AI/NIM-2-Coder-7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("NIM-AI/NIM-2-Coder-7B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use NIM-AI/NIM-2-Coder-7B with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf NIM-AI/NIM-2-Coder-7B:Q4_K_M # Run inference directly in the terminal: llama cli -hf NIM-AI/NIM-2-Coder-7B:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf NIM-AI/NIM-2-Coder-7B:Q4_K_M # Run inference directly in the terminal: llama cli -hf NIM-AI/NIM-2-Coder-7B:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf NIM-AI/NIM-2-Coder-7B:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf NIM-AI/NIM-2-Coder-7B:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf NIM-AI/NIM-2-Coder-7B:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf NIM-AI/NIM-2-Coder-7B:Q4_K_M
Use Docker
docker model run hf.co/NIM-AI/NIM-2-Coder-7B:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use NIM-AI/NIM-2-Coder-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NIM-AI/NIM-2-Coder-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NIM-AI/NIM-2-Coder-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/NIM-AI/NIM-2-Coder-7B:Q4_K_M
- SGLang
How to use NIM-AI/NIM-2-Coder-7B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "NIM-AI/NIM-2-Coder-7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NIM-AI/NIM-2-Coder-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "NIM-AI/NIM-2-Coder-7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NIM-AI/NIM-2-Coder-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use NIM-AI/NIM-2-Coder-7B with Ollama:
ollama run hf.co/NIM-AI/NIM-2-Coder-7B:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use NIM-AI/NIM-2-Coder-7B with Docker Model Runner:
docker model run hf.co/NIM-AI/NIM-2-Coder-7B:Q4_K_M
- Lemonade
How to use NIM-AI/NIM-2-Coder-7B with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull NIM-AI/NIM-2-Coder-7B:Q4_K_M
Run and chat with the model
lemonade run user.NIM-2-Coder-7B-Q4_K_M
List all available models
lemonade list
- Atomic Chat
|
Download README.md from NIM-AI/NIM-2-Coder-7B: direct link, hf CLI and curl.
- Browser
- Download file 2.08 kB
-
https://huggingface.co/NIM-AI/NIM-2-Coder-7B/resolve/main/README.md
- Command line
-
hf download hf://NIM-AI/NIM-2-Coder-7B/README.md
-
curl -L -o README.md https://huggingface.co/NIM-AI/NIM-2-Coder-7B/resolve/main/README.md
2.08 kB
| license: apache-2.0 | |
| language: | |
| - en | |
| pipeline_tag: text-generation | |
| tags: | |
| - code | |
| - coding | |
| - software-engineering | |
| - autonomous-agent | |
| - gguf | |
| - ollama | |
| library_name: transformers | |
| # NIM-2 Coder (7B) | |
| **NIM-2 Coder** is a specialized, high-density 7-billion parameter language model engineered by **NIM AI** for advanced software engineering, algorithmic design, and full-stack development. | |
| Engineered specifically to punch above its weight class on consumer hardware, NIM-2 Coder delivers complete, type-safe, production-ready code with deep architectural reasoning while running fully locally within 8 GB VRAM. | |
| [](https://github.com/N-I-M-AI) | |
| [](LICENSE) | |
| --- | |
| ## Key Highlights | |
| * **Autonomous Code Synthesis:** Writes idiomatic, complete code across Python, TypeScript/JavaScript, Rust, Go, C++, and Bash with zero placeholders. | |
| * **Deterministic Logic & Edge Cases:** Trained on multi-stage algorithmic problem decomposition, cyclic graph traversals, and strict type constraints. | |
| * **Hardware Optimized:** Packaged in high-throughput `Q4_K_M` GGUF quantization (~4.6 GB), allowing full offloading to consumer GPUs like the NVIDIA RTX 4060 (8 GB) and Apple Silicon. | |
| * **Agentic Precision:** Minimal conversational fluff—outputs immediate technical rationale followed by runnable implementations. | |
| --- | |
| ## Technical Specifications | |
| | Parameter | Specification | | |
| | :--- | :--- | | |
| | **Model Name** | NIM-2 Coder | | |
| | **Organization** | NIM AI (`N-I-M-AI`) | | |
| | **Architecture** | Dense Auto-regressive Transformer | | |
| | **Parameters** | 7.6 Billion | | |
| | **Context Length** | 4,096 tokens (dynamically extendable) | | |
| | **Format** | `Q4_K_M` GGUF (~4.6 GB) / LoRA FP16 | | |
| | **Prompt Template** | ChatML (`<|im_start|>`, `<|im_end|>`) | | |
| --- | |
| ## Quickstart Guide | |
| ### Run Directly via Ollama (Recommended) | |
| Pull and execute directly from Hugging Face: | |
| ```bash | |
| ollama run hf.co/N-I-M-AI/NIM-2-Coder-7B:NIM-2-Coder-7B-Q4_K_M.gguf | |