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
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
+
tags:
|
| 7 |
+
- code
|
| 8 |
+
- coding
|
| 9 |
+
- software-engineering
|
| 10 |
+
- autonomous-agent
|
| 11 |
+
- gguf
|
| 12 |
+
- ollama
|
| 13 |
+
library_name: transformers
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# NIM-2 Coder (7B)
|
| 17 |
+
|
| 18 |
+
**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.
|
| 19 |
+
|
| 20 |
+
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.
|
| 21 |
+
|
| 22 |
+
[](https://github.com/N-I-M-AI)
|
| 23 |
+
[](LICENSE)
|
| 24 |
+
|
| 25 |
+
---
|
| 26 |
+
|
| 27 |
+
## Key Highlights
|
| 28 |
+
|
| 29 |
+
* **Autonomous Code Synthesis:** Writes idiomatic, complete code across Python, TypeScript/JavaScript, Rust, Go, C++, and Bash with zero placeholders.
|
| 30 |
+
* **Deterministic Logic & Edge Cases:** Trained on multi-stage algorithmic problem decomposition, cyclic graph traversals, and strict type constraints.
|
| 31 |
+
* **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.
|
| 32 |
+
* **Agentic Precision:** Minimal conversational fluff—outputs immediate technical rationale followed by runnable implementations.
|
| 33 |
+
|
| 34 |
+
---
|
| 35 |
+
|
| 36 |
+
## Technical Specifications
|
| 37 |
+
|
| 38 |
+
| Parameter | Specification |
|
| 39 |
+
| :--- | :--- |
|
| 40 |
+
| **Model Name** | NIM-2 Coder |
|
| 41 |
+
| **Organization** | NIM AI (`N-I-M-AI`) |
|
| 42 |
+
| **Architecture** | Dense Auto-regressive Transformer |
|
| 43 |
+
| **Parameters** | 7.6 Billion |
|
| 44 |
+
| **Context Length** | 4,096 tokens (dynamically extendable) |
|
| 45 |
+
| **Format** | `Q4_K_M` GGUF (~4.6 GB) / LoRA FP16 |
|
| 46 |
+
| **Prompt Template** | ChatML (`<|im_start|>`, `<|im_end|>`) |
|
| 47 |
+
|
| 48 |
+
---
|
| 49 |
+
|
| 50 |
+
## Quickstart Guide
|
| 51 |
+
|
| 52 |
+
### Run Directly via Ollama (Recommended)
|
| 53 |
+
|
| 54 |
+
Pull and execute directly from Hugging Face:
|
| 55 |
+
|
| 56 |
+
```bash
|
| 57 |
+
ollama run hf.co/N-I-M-AI/NIM-2-Coder-7B:NIM-2-Coder-7B-Q4_K_M.gguf
|