---
title: "StarCoder2"
description: ""
---
[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.

<Info>

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

</Info>

## 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
```

<Accordion title="Run with Docker">
**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.02.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
```
</Accordion>

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)
