Instructions to use JetBrains/Mellum-4b-sft-all-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use JetBrains/Mellum-4b-sft-all-gguf with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("JetBrains/Mellum-4b-sft-all-gguf", dtype="auto") - llama-cpp-python
How to use JetBrains/Mellum-4b-sft-all-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="JetBrains/Mellum-4b-sft-all-gguf", filename="mellum-4b-sft-all.Q8_0.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use JetBrains/Mellum-4b-sft-all-gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf JetBrains/Mellum-4b-sft-all-gguf:Q8_0 # Run inference directly in the terminal: llama-cli -hf JetBrains/Mellum-4b-sft-all-gguf:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf JetBrains/Mellum-4b-sft-all-gguf:Q8_0 # Run inference directly in the terminal: llama-cli -hf JetBrains/Mellum-4b-sft-all-gguf:Q8_0
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 JetBrains/Mellum-4b-sft-all-gguf:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf JetBrains/Mellum-4b-sft-all-gguf:Q8_0
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 JetBrains/Mellum-4b-sft-all-gguf:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf JetBrains/Mellum-4b-sft-all-gguf:Q8_0
Use Docker
docker model run hf.co/JetBrains/Mellum-4b-sft-all-gguf:Q8_0
- LM Studio
- Jan
- Ollama
How to use JetBrains/Mellum-4b-sft-all-gguf with Ollama:
ollama run hf.co/JetBrains/Mellum-4b-sft-all-gguf:Q8_0
- Unsloth Studio
How to use JetBrains/Mellum-4b-sft-all-gguf with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for JetBrains/Mellum-4b-sft-all-gguf to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for JetBrains/Mellum-4b-sft-all-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for JetBrains/Mellum-4b-sft-all-gguf to start chatting
- Docker Model Runner
How to use JetBrains/Mellum-4b-sft-all-gguf with Docker Model Runner:
docker model run hf.co/JetBrains/Mellum-4b-sft-all-gguf:Q8_0
- Lemonade
How to use JetBrains/Mellum-4b-sft-all-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull JetBrains/Mellum-4b-sft-all-gguf:Q8_0
Run and chat with the model
lemonade run user.Mellum-4b-sft-all-gguf-Q8_0
List all available models
lemonade list
Model Description
Mellum-4b-sft-all is a fine-tuned version of JetBrains' first open-source large language model (LLM) optimized for code-related tasks.
Pre-trained on over 4 trillion tokens with a context window of 8192 tokens across multiple programming languages, and then fine-tuned, Mellum-4b-sft-all is tailored for context-aware code completion tasks. It was fine-tuned on a diverse set of languages, including Batchfile, C, C#, CMake, C++, CSS, Cython, Dockerfile, F#, Go, Groovy, HCL, HTML (and variants like Django, EEx, ERB, and PHP templates), Java, JSP, JavaScript, JSX, Kotlin, Less, Makefile, Objective-C++, PHP, PowerShell, Python, R, RHTML, Ruby, Rust, Sass, Scala, SCSS, Shell, SQL, Swift, TOML, TypeScript, Visual Basic, Vue, and YAML. The model follows a LLaMA-style architecture with 4 billion parameters, making it efficient for both cloud inference (e.g., via vLLM) and local deployment (e.g., using llama.cpp or Ollama).
Mellum was trained using Automatic Mixed Precision (AMP) with bf16 precision. The uploaded version on Hugging Face retains the bf16 format for public use.
Designed for integration into professional developer tooling (e.g., intelligent code suggestions in IDEs), AI-powered coding assistants, and research on code understanding and generation, Mellum is also well-suited for educational applications and fine-tuning experiments.
Limitations
- Biases: May reflect biases present in public codebases. For example it will likely produce code which is similar in style to the open-source repositories.
- Security: Code suggestions should not be assumed to be secure or free of vulnerabilities.
Sample Usage
Here is an example of how to run and sample from the model with additional files context and fill in the middle.
Fill-in-the-middle example
llama-cli -m mellum-4b-sft-all.Q8_0.gguf --temp 0 -p $'<filename>Utils.kt\npackage utils\n\nfun multiply(x: Int, y: Int): Int {\n return x * y\n}\n\n<filename>Config.kt\npackage config\n\nobject Config {\n const val DEBUG = true\n const val MAX_VALUE = 100\n}\n\n<filename>Example.kt\n<fim_suffix>\nfun main() {\n val result = calculateSum(5, 10)\n println(result)\n}\n<fim_prefix>fun calculateSum(a: Int, b: Int): Int {\n<fim_middle>'
Benchmarks
We are providing scores for Mellum‑4b‑sft‑all to give users an estimate of the model’s potential capabilities.
RepoBench 1.1
Type: single‑line Languages: Python and Java Metric: Exact Match (EM), %
Since Mellum has a maximum context window of 8 k, we report both the average over all evaluated context lengths (2 k, 4 k, 8 k, 12 k and 16 k) and the average over the lengths within its supported range (≤ 8 k).
Python subset
| Model | 2 k | 4 k | 8 k | 12 k | 16 k | Avg | Avg ≤ 8 k |
|---|---|---|---|---|---|---|---|
| Mellum‑4b‑sft‑all | 26.38% | 29.30% | 30.42% | 26.85% | 28.18% | 28.23% | 28.70% |
Java subset
| Model | 2 k | 4 k | 8 k | 12 k | 16 k | Avg | Avg ≤ 8 k |
|---|---|---|---|---|---|---|---|
| Mellum‑4b‑sft‑all | 28.83% | 32.28% | 29.58% | 24.47% | 28.21% | 28.67% | 30.23% |
Syntax‑Aware Fill‑in‑the‑Middle (SAFIM)
Type: mix of multi‑line and single‑line Languages: multi‑language Metric: pass@1, %
| Model | Algorithmic | Control | API | Average |
|---|---|---|---|---|
| Mellum‑4b‑sft‑all | 40.05% | 53.03% | 65.48% | 52.85% |
HumanEval Infilling
- Type: single‑line and multi‑line
- Languages: Python
- Metric: pass@1, %
| Model | Single‑Line | Multi‑Line | Random Span |
|---|---|---|---|
| Mellum‑4b‑sft‑all | 80.83% | 48.19% | 37.20% |
Citation
If you use this model, please cite:
@misc{Mellum-4b-base,
title = {Mellum-4b-base},
author = {Pavlichenko, Nikita and Nazarov, Iurii and Dolgov, Ivan and Garanina, Ekaterina and Lasocki, Karol and Reshetnikova, Julia and Boitsov, Sergei and Bondyrev, Ivan and Karaeva, Dariia and Sheptyakov, Maksim and Ustalov, Dmitry and Mukhin, Artem and Proshev, Semyon and Abramov, Nikita and Kolomyttseva, Olga and Lysaniuk, Kseniia and Zavidnyi, Ilia and Semenkin, Anton and Tankov, Vladislav and Sazanovich, Uladzislau},
year = {2025},
}
Contact
For questions, collaborations and requests reach us out via mellum@jetbrains.com
- Downloads last month
- 89
8-bit
Model tree for JetBrains/Mellum-4b-sft-all-gguf
Base model
JetBrains/Mellum-4b-baseDatasets used to train JetBrains/Mellum-4b-sft-all-gguf
bigcode/the-stack
bigcode/the-stack-v2
Collection including JetBrains/Mellum-4b-sft-all-gguf
Evaluation results
- EM on RepoBench 1.1 (Python)self-reported0.282
- EM ≤ 8k on RepoBench 1.1 (Python)self-reported0.287
- EM on RepoBench 1.1 (Python, 2k)self-reported0.264
- EM on RepoBench 1.1 (Python, 4k)self-reported0.293
- EM on RepoBench 1.1 (Python, 8k)self-reported0.304
- EM on RepoBench 1.1 (Python, 12k)self-reported0.269
- EM on RepoBench 1.1 (Python, 16k)self-reported0.282
- EM on RepoBench 1.1 (Java)self-reported0.287