Instructions to use daniel-eai/Llama-3.2-2B-40pct-Compressed-3B-EN-V1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use daniel-eai/Llama-3.2-2B-40pct-Compressed-3B-EN-V1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="daniel-eai/Llama-3.2-2B-40pct-Compressed-3B-EN-V1", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("daniel-eai/Llama-3.2-2B-40pct-Compressed-3B-EN-V1", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("daniel-eai/Llama-3.2-2B-40pct-Compressed-3B-EN-V1", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use daniel-eai/Llama-3.2-2B-40pct-Compressed-3B-EN-V1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "daniel-eai/Llama-3.2-2B-40pct-Compressed-3B-EN-V1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "daniel-eai/Llama-3.2-2B-40pct-Compressed-3B-EN-V1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/daniel-eai/Llama-3.2-2B-40pct-Compressed-3B-EN-V1
- SGLang
How to use daniel-eai/Llama-3.2-2B-40pct-Compressed-3B-EN-V1 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 "daniel-eai/Llama-3.2-2B-40pct-Compressed-3B-EN-V1" \ --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": "daniel-eai/Llama-3.2-2B-40pct-Compressed-3B-EN-V1", "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 "daniel-eai/Llama-3.2-2B-40pct-Compressed-3B-EN-V1" \ --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": "daniel-eai/Llama-3.2-2B-40pct-Compressed-3B-EN-V1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use daniel-eai/Llama-3.2-2B-40pct-Compressed-3B-EN-V1 with Docker Model Runner:
docker model run hf.co/daniel-eai/Llama-3.2-2B-40pct-Compressed-3B-EN-V1
Llama-3.2-2B β 40% Compressed from Llama-3.2-3B (English)
Built with Llama. This repository is part of the Efficient and Robust AI System (E-AI) Project by Vincent-Daniel Yun. This model is a compressed edition of meta-llama/Llama-3.2-3B with 11 of 28 transformer layers removed (17 layers remain, β2.11B parameters), recovered training-free. It is a base (nonβchat-tuned) model.
π Project: https://www.worldwidedaniel.com/eai-project π Release: 2026-06-28 Β· Version: V1
βοΈ License: governed by the Llama 3.2 Community License Agreement (https://huggingface.co/meta-llama/Llama-3.2-3B/blob/main/LICENSE.txt), and subject to the Llama 3.2 Acceptable Use Policy (https://www.llama.com/llama3_2/use-policy). By using this model you agree to those terms. "Llama" is a trademark of Meta Platforms, Inc. Built with Llama.
β οΈ Language: English-focused. Use as a discrimination / classification engine β open-ended long-form generation is degraded by compression (see PPL). For factual questions use retrieval (RAG).
About E-AI
Modern AI is powerful but heavy. The E-AI (Efficient-AI) project builds compact yet capable AI β making every model lightweight and fast β so AI can assist people in urgent, high-stakes moments.
Method
The pruning method and the training-free recovery method are proprietary, undisclosed methods created by Vincent-Daniel Yun and are not released. Only the resulting model is shared.
Results (measured, full test sets)
PPL on 2048-token context (β better); downstream & MMLU are 0-shot via lm-eval-harness (β better).
| Metric | Llama-3.2-3B (base) | This model (40%) |
|---|---|---|
| PPL Β· WikiText2 β | 7.81 | 209.11 |
| PPL Β· C4 β | 10.26 | 156.25 |
| ARC-c β | 0.4599 | 0.3208 |
| ARC-e β | 0.7163 | 0.4508 |
| BoolQ β | 0.7324 | 0.6229 |
| COPA β | 0.8600 | 0.7200 |
| HellaSwag β | 0.7363 | 0.4494 |
| OpenBookQA β | 0.4300 | 0.3100 |
| RACE β | 0.4010 | 0.3158 |
| RTE β | 0.5487 | 0.6354 |
| WinoGrande β | 0.6985 | 0.6219 |
| Avg. downstream (9) β | 0.6203 | 0.4941 |
| MMLU β | 0.5437 | 0.5120 |
Task-suitability (vs base Llama-3.2-3B)
| Task | Llama-3.2-3B (base) | This model (40%) |
|---|---|---|
| Topic classification (AG News) | 0.550 | 0.418 |
| LLM-as-judge (RewardBench) | 0.612 | 0.610 |
| SafetyBench (MCQ) | 0.743 | 0.629 |
| MultiRC | 0.572 | 0.572 |
| WiC | 0.497 | 0.500 |
| MRPC | 0.625 | 0.684 |
| CB (NLI) | 0.500 | 0.196 |
| SST-2 | 0.751 | 0.611 |
| MedQA | 0.511 | 0.503 |
| MedMCQA | 0.491 | 0.464 |
| PubMedQA | 0.732 | 0.556 |
| Belebele-en | 0.654 | 0.590 |
| Belebele-ko | 0.527 | 0.446 |
| XNLI-zh | 0.411 | 0.347 |
| ToxiGen | 0.432 | 0.432 |
| TruthfulQA | 0.392 | 0.495 |
(Discrimination is largely preserved; generation/PPL degrades with compression. Yes/No safety-F1 benchmarks are omitted as the non-chat base is poorly calibrated for them.)
Efficiency (measured, fp16, single GPU)
| Llama-3.2-3B (base) | This model (40%) | |
|---|---|---|
| Layers | 28 | 17 |
| Parameters | 3.21B | 2.11B |
| Peak inference memory (fp16) | 9.53 GB | 6.94 GB (β27%) |
| Forward latency (fp16) | 571 ms | 378 ms (β34%) |
Usage β Transformers
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
m = AutoModelForCausalLM.from_pretrained("daniel-eai/Llama-3.2-2B-40pct-Compressed-3B-EN-V1", trust_remote_code=True, dtype=torch.float16, device_map="cuda")
tok = AutoTokenizer.from_pretrained("daniel-eai/Llama-3.2-2B-40pct-Compressed-3B-EN-V1", trust_remote_code=True)
ids = tok("The capital of France is", return_tensors="pt").to("cuda")
print(tok.decode(m.generate(**ids, max_new_tokens=20)[0]))
trust_remote_code=True is required (custom decoder layer in modeling_llama_recovered.py).
License & Acknowledgements
Derivative of Llama 3.2, distributed under the Llama 3.2 Community License. Built with Llama. Thanks to Prof. Sai Praneeth Karimireddy (USC) and Prof. Sunwoo Lee (Inha University) for guidance, and to Meta for releasing Llama 3.2.
- Downloads last month
- -
Model tree for daniel-eai/Llama-3.2-2B-40pct-Compressed-3B-EN-V1
Base model
meta-llama/Llama-3.2-3B
