Instructions to use JetBrains/Mellum2-12B-A2.5B-Base-Pretrain with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use JetBrains/Mellum2-12B-A2.5B-Base-Pretrain with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="JetBrains/Mellum2-12B-A2.5B-Base-Pretrain")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("JetBrains/Mellum2-12B-A2.5B-Base-Pretrain") model = AutoModelForCausalLM.from_pretrained("JetBrains/Mellum2-12B-A2.5B-Base-Pretrain", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use JetBrains/Mellum2-12B-A2.5B-Base-Pretrain with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "JetBrains/Mellum2-12B-A2.5B-Base-Pretrain" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "JetBrains/Mellum2-12B-A2.5B-Base-Pretrain", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/JetBrains/Mellum2-12B-A2.5B-Base-Pretrain
- SGLang
How to use JetBrains/Mellum2-12B-A2.5B-Base-Pretrain 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 "JetBrains/Mellum2-12B-A2.5B-Base-Pretrain" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "JetBrains/Mellum2-12B-A2.5B-Base-Pretrain", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "JetBrains/Mellum2-12B-A2.5B-Base-Pretrain" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "JetBrains/Mellum2-12B-A2.5B-Base-Pretrain", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use JetBrains/Mellum2-12B-A2.5B-Base-Pretrain with Docker Model Runner:
docker model run hf.co/JetBrains/Mellum2-12B-A2.5B-Base-Pretrain
Mellum2 Base Pretrain
Use this checkpoint as a starting point for research on long-context extension or for 8K-context continued pretraining and fine-tuning. For downstream applications use Base, Instruct, or Thinking instead.
Mellum2 Base Highlights
Mellum2 Base is a pretrained causal language model trained by JetBrains.
The model uses a Mixture-of-Experts architecture with 64 experts and activates 8 experts per token. It uses a combination of sliding-window and full attention layers, with a context length of 8,192 tokens.
This is a checkpoint before long-context extension.
Mellum2 Model Family
This repository contains one checkpoint from the Mellum2 family.
| Checkpoint | Description |
|---|---|
| Base Pretrain | Base checkpoint before long-context extension |
| Base | Final base model |
| Instruct SFT | Supervised instruction-tuned checkpoint |
| Thinking SFT | Supervised thinking checkpoint |
| Instruct | RL-tuned instruction model |
| Thinking | RL-tuned thinking model |
Model Overview
Mellum2 Base has the following features:
- Number of Layers: 28
- Hidden Size: 2304
- Intermediate Size: 7168
- MoE Intermediate Size: 896
- Number of Experts: 64
- Number of Activated Experts: 8
- Number of Attention Heads (GQA): 32 for Q and 4 for KV
- Context Length: 8,192
- Sliding Window: 1,024
- Vocabulary Size: 98,304
- Precision: bfloat16
- License: Apache 2.0
Serving with vLLM
This checkpoint has an 8K context length (long-context extension is applied in Base).
vllm serve JetBrains/Mellum2-12B-A2.5B-Base-Pretrain --max-model-len 8192
Quickstart
Text-Only Input (base model β use the completions endpoint, not chat)
from openai import OpenAI
# Configured by environment variables
client = OpenAI()
completion = client.completions.create(
model="JetBrains/Mellum2-12B-A2.5B-Base-Pretrain",
prompt="def fibonacci(n):\n ",
max_tokens=4096,
temperature=0.6,
top_p=0.95,
extra_body={
"top_k": 20,
},
)
print("Completion:", completion)
Evaluation
Evaluation results are available in the model card. All values are self-reported by JetBrains.
For more details, see the Mellum2 Technical Report.
License
Released under the Apache 2.0 license.
- Downloads last month
- 277
Spaces using JetBrains/Mellum2-12B-A2.5B-Base-Pretrain 3
Collection including JetBrains/Mellum2-12B-A2.5B-Base-Pretrain
Paper for JetBrains/Mellum2-12B-A2.5B-Base-Pretrain
Article mentioning JetBrains/Mellum2-12B-A2.5B-Base-Pretrain
Evaluation results
- openai/gsm8k Β· Gsm8k View evaluation results leaderboard 81.73 *
- Idavidrein/gpqa leaderboard
- Diamond View evaluation resultspre-training eval, no-tools31.31 *
- Main View evaluation results
- TIGER-Lab/MMLU-Pro Β· Mmlu Pro View evaluation results leaderboard 59.31 *
- pass@1 on HumanEvalself-reported41.460
- pass@1 on HumanEval+self-reported37.200
- pass@1 on MBPPself-reported62.400