> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/automodel/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/automodel/_mcp/server.

# StarCoder2

[StarCoder2](https://huggingface.co/blog/starcoder2) is BigCode's second-generation code language model, available in 3B, 7B, and 15B sizes, trained on 600+ programming languages from The Stack v2.

|                  |                                           |
| ---------------- | ----------------------------------------- |
| **Task**         | Code Generation                           |
| **Architecture** | `Starcoder2ForCausalLM`                   |
| **Parameters**   | 3B – 15B                                  |
| **HF Org**       | [bigcode](https://huggingface.co/bigcode) |

## Available Models

* **starcoder2-3b**: 3B
* **starcoder2-7b**: 7B
* **starcoder2-15b**: 15B

## Architecture

* `Starcoder2ForCausalLM`

## Example HF Models

| Model          | HF ID                                                                     |
| -------------- | ------------------------------------------------------------------------- |
| StarCoder2 3B  | [`bigcode/starcoder2-3b`](https://huggingface.co/bigcode/starcoder2-3b)   |
| StarCoder2 7B  | [`bigcode/starcoder2-7b`](https://huggingface.co/bigcode/starcoder2-7b)   |
| StarCoder2 15B | [`bigcode/starcoder2-15b`](https://huggingface.co/bigcode/starcoder2-15b) |

## Example Recipes

| Recipe                                                                                                                                                        | Description                               |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
| [starcoder\_2\_7b\_squad.yaml](https://github.com/NVIDIA-NeMo/Automodel/blob/main/examples/llm_finetune/starcoder/starcoder_2_7b_squad.yaml)                  | SFT — StarCoder2 7B on SQuAD              |
| [starcoder\_2\_7b\_hellaswag\_fp8.yaml](https://github.com/NVIDIA-NeMo/Automodel/blob/main/examples/llm_finetune/starcoder/starcoder_2_7b_hellaswag_fp8.yaml) | SFT — StarCoder2 7B on HellaSwag with FP8 |

## Try with NeMo AutoModel

**1. Install** ([full instructions](/get-started/installation)):

```bash
pip install nemo-automodel
```

**2. Clone the repo** to get the example recipes:

```bash
git clone https://github.com/NVIDIA-NeMo/Automodel.git
cd Automodel
```

**3. Run the recipe** from inside the repo:

```bash
automodel --nproc-per-node=8 examples/llm_finetune/starcoder/starcoder_2_7b_squad.yaml
```

**1. Pull the container** and mount a checkpoint directory:

```bash
docker run --gpus all -it --rm \
  --shm-size=8g \
  -v $(pwd)/checkpoints:/opt/Automodel/checkpoints \
  nvcr.io/nvidia/nemo-automodel:26.06.00
```

**2.** Navigate to the AutoModel directory (where the recipes are):

```bash
cd /opt/Automodel
```

**3. Run the recipe**:

```bash
automodel --nproc-per-node=8 examples/llm_finetune/starcoder/starcoder_2_7b_squad.yaml
```

See the [Installation Guide](/get-started/installation) and [LLM Fine-Tuning Guide](/recipes-e2e-examples/sft-peft).

## Fine-Tuning

See the [LLM Fine-Tuning Guide](/recipes-e2e-examples/sft-peft).

## Hugging Face Model Cards

* [bigcode/starcoder2-7b](https://huggingface.co/bigcode/starcoder2-7b)