Instructions to use pankajpandey-dev/Carbon-3B-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use pankajpandey-dev/Carbon-3B-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="pankajpandey-dev/Carbon-3B-GGUF", filename="carbon-3b-Q2_K.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 pankajpandey-dev/Carbon-3B-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf pankajpandey-dev/Carbon-3B-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf pankajpandey-dev/Carbon-3B-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf pankajpandey-dev/Carbon-3B-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf pankajpandey-dev/Carbon-3B-GGUF: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 pankajpandey-dev/Carbon-3B-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf pankajpandey-dev/Carbon-3B-GGUF: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 pankajpandey-dev/Carbon-3B-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf pankajpandey-dev/Carbon-3B-GGUF:Q4_K_M
Use Docker
docker model run hf.co/pankajpandey-dev/Carbon-3B-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use pankajpandey-dev/Carbon-3B-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "pankajpandey-dev/Carbon-3B-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pankajpandey-dev/Carbon-3B-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/pankajpandey-dev/Carbon-3B-GGUF:Q4_K_M
- Ollama
How to use pankajpandey-dev/Carbon-3B-GGUF with Ollama:
ollama run hf.co/pankajpandey-dev/Carbon-3B-GGUF:Q4_K_M
- Unsloth Studio
How to use pankajpandey-dev/Carbon-3B-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 pankajpandey-dev/Carbon-3B-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 pankajpandey-dev/Carbon-3B-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for pankajpandey-dev/Carbon-3B-GGUF to start chatting
- Docker Model Runner
How to use pankajpandey-dev/Carbon-3B-GGUF with Docker Model Runner:
docker model run hf.co/pankajpandey-dev/Carbon-3B-GGUF:Q4_K_M
- Lemonade
How to use pankajpandey-dev/Carbon-3B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull pankajpandey-dev/Carbon-3B-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Carbon-3B-GGUF-Q4_K_M
List all available models
lemonade list
Carbon-3B-GGUF
GGUF quantizations of HuggingFaceBio/Carbon-3B β a generative DNA foundation model β for efficient inference with llama.cpp.
Carbon-3B is a 3B-parameter autoregressive genomic model that uses a hybrid tokenizer (6-mer chunks for DNA inside <dna> tags, BPE for English text). It matches the performance of Evo2-7B while running over 250Γ faster at inference.
π¦ Available Quantizations
| File | Quant Method | Size | Use Case |
|---|---|---|---|
| carbon-3b-Q2_K.gguf | Q2_K | 1.4 GB | Smallest β for very constrained edge devices |
| carbon-3b-Q3_K_M.gguf | Q3_K_M | 1.8 GB | Small with reasonable quality |
| carbon-3b-Q4_K_M.gguf | Q4_K_M | 2.1 GB | β Recommended β best size/quality balance |
| carbon-3b-Q5_K_M.gguf | Q5_K_M | 2.4 GB | Higher quality |
| carbon-3b-Q6_K.gguf | Q6_K | 2.7 GB | Very close to f16 quality |
| carbon-3b-Q8_0.gguf | Q8_0 | 3.5 GB | Highest quality, near-lossless |
βοΈ Requirements
You must use a recent build of llama.cpp that includes PR #23410 β this added support for Carbon's custom HybridDNATokenizer. Any build from master after that PR works.
git clone https://github.com/ggml-org/llama.cpp
cd llama.cpp && cmake -B build && cmake --build build -j
π Usage
Download a quant
huggingface-cli download pankajpandey-dev/Carbon-3B-GGUF carbon-3b-Q4_K_M.gguf --local-dir .
DNA sequence continuation
Wrap DNA sequences in <dna> tags so the tokenizer switches into 6-mer mode:
./build/bin/llama-completion -m carbon-3b-Q4_K_M.gguf \
-p '<dna>ATGCGCTAGCTACGATCGATCGTAGCTAGCTAGCTAGCTACG' \
-n 64 --temp 0 -no-cnv
Conditional generation with metadata tags
./build/bin/llama-completion -m carbon-3b-Q4_K_M.gguf \
-p '<vertebrate_mammalian><protein_coding_region><dna>ATGCGCTAG' \
-n 64 --temp 0 -no-cnv
Long-context generation (up to 131k 6-mer tokens β 786 kbp)
./build/bin/llama-completion -m carbon-3b-Q4_K_M.gguf \
-c 65536 --rope-scaling yarn --rope-scale 4 --yarn-orig-ctx 32768 \
-p '<dna>...' -n 64 --temp 0 -no-cnv
β οΈ Important Notes
- DNA tag is mandatory. Raw DNA without the
<dna>tag will be BPE-tokenized as English text, producing meaningless results. - 6-mer constraint. DNA sequences must contain only
[ATCG]characters. Any other letters trigger an<oov>token. fnsrevision is not supported. This GGUF is converted from themainrevision only. Thefnsbranch uses a factorized nucleotide supervision head that requires the Pythontransformerspath.- Carbon-500M (GGUF here) can be used as a draft model for speculative decoding to speed up Carbon-3B inference at no quality loss.
π Quantization Method
These quants were produced from the original bf16 HuggingFaceBio/Carbon-3B safetensors using convert_hf_to_gguf.py followed by llama-quantize from llama.cpp (build b9330). Standard K-quants and Q8_0 were used β no imatrix calibration was applied, as standard text calibration corpora are not appropriate for DNA-pretrained models.
π License
Apache 2.0 β inherited from the source model.
π Credits
- Original model: HuggingFaceBio/Carbon-3B β full credit to the Hugging Face biology team for designing, training, and open-sourcing Carbon.
- GGUF conversion & quantization: @pankajpandey-dev
- Reference: Original GGUF release HuggingFaceBio/Carbon-3B-GGUF (bf16 only). This repository complements it with smaller K-quants for CPU/edge inference.
π Related
- 𧬠Carbon model family collection
- π Carbon technical report
- π¬ Interactive demo
- π» Carbon GitHub repo
Part of my GGUF Quantizations collection β making open models accessible across hardware tiers.
- Downloads last month
- 639
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit
Model tree for pankajpandey-dev/Carbon-3B-GGUF
Base model
HuggingFaceBio/Carbon-3B