Instructions to use CarlosRCDev/EuroLLM-22B-Instruct-2512-awq with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CarlosRCDev/EuroLLM-22B-Instruct-2512-awq with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CarlosRCDev/EuroLLM-22B-Instruct-2512-awq") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("CarlosRCDev/EuroLLM-22B-Instruct-2512-awq") model = AutoModelForCausalLM.from_pretrained("CarlosRCDev/EuroLLM-22B-Instruct-2512-awq") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use CarlosRCDev/EuroLLM-22B-Instruct-2512-awq with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CarlosRCDev/EuroLLM-22B-Instruct-2512-awq" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CarlosRCDev/EuroLLM-22B-Instruct-2512-awq", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/CarlosRCDev/EuroLLM-22B-Instruct-2512-awq
- SGLang
How to use CarlosRCDev/EuroLLM-22B-Instruct-2512-awq 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 "CarlosRCDev/EuroLLM-22B-Instruct-2512-awq" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CarlosRCDev/EuroLLM-22B-Instruct-2512-awq", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "CarlosRCDev/EuroLLM-22B-Instruct-2512-awq" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CarlosRCDev/EuroLLM-22B-Instruct-2512-awq", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use CarlosRCDev/EuroLLM-22B-Instruct-2512-awq with Docker Model Runner:
docker model run hf.co/CarlosRCDev/EuroLLM-22B-Instruct-2512-awq
EuroLLM-22B-Instruct AWQ (W4A16)
This is a W4A16 AWQ quantized version of utter-project/EuroLLM-22B-Instruct-2512.
Model Details
| Attribute | Value |
|---|---|
| Original Model | EuroLLM-22B-Instruct-2512 |
| Quantization | W4A16_ASYM (4-bit weights, 16-bit activations) |
| Calibration Samples | 256 |
| Sequence Length | 512 |
| Calibration Dataset | HuggingFaceH4/ultrachat_200k |
Quantization Script
Dependencies
dependencies = [
"llmcompressor>=0.10.0.1",
"protobuf>=7.34.0",
"sentencepiece>=0.2.1",
"compressed-tensors>=0.12.2"
]
Code
from transformers import AutoModelForCausalLM, AutoTokenizer
from llmcompressor.modifiers.awq import AWQModifier, AWQMapping
from llmcompressor import oneshot
from datasets import load_dataset
# envs
MODEL_PATH = "EuroLLM-22B-Instruct-2512"
OUTPUT_PATH = "EuroLLM-22B-Instruct-2512-awq"
NUM_CALIBRATION_SAMPLES = 256
MAX_SEQUENCE_LENGTH = 512
# Load model and tokenizer
model = AutoModelForCausalLM.from_pretrained(
MODEL_PATH,
device_map="auto",
dtype="auto",
)
tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH)
# Load and preprocess calibration dataset
calib_dataset = load_dataset("HuggingFaceH4/ultrachat_200k", split=f"train_sft[:{NUM_CALIBRATION_SAMPLES}]")
calib_dataset = calib_dataset.shuffle(seed=42)
def preprocess(example):
return {
"text": tokenizer.apply_chat_template(
example["messages"],
tokenize=False,
)
}
calib_dataset = calib_dataset.map(preprocess)
# Tokenize calibration dataset
def tokenize(example):
return tokenizer(
example["text"],
padding=False,
max_length=MAX_SEQUENCE_LENGTH,
truncation=True,
add_special_tokens=False,
)
calib_dataset = calib_dataset.map(tokenize, remove_columns=calib_dataset.column_names)
# Define mappings for llama
mappings_llama = [
AWQMapping(
"re:.*input_layernorm",
["re:.*q_proj", "re:.*k_proj", "re:.*v_proj"],
),
AWQMapping("re:.*v_proj", ["re:.*o_proj"]),
AWQMapping(
"re:.*post_attention_layernorm",
["re:.*gate_proj", "re:.*up_proj"],
),
AWQMapping(
"re:.*up_proj",
["re:.*down_proj"],
),
]
# Define AWQ quantization recipe
recipe = AWQModifier(
targets="Linear",
scheme="W4A16_ASYM",
ignore=["lm_head"],
mappings=mappings_llama
)
# Run quantization with calibration
oneshot(
model=model,
tokenizer=tokenizer,
dataset=calib_dataset,
recipe=recipe,
max_seq_length=MAX_SEQUENCE_LENGTH,
num_calibration_samples=NUM_CALIBRATION_SAMPLES,
output_dir=OUTPUT_PATH,
)
Languages Supported
EuroLLM supports all 24 official EU languages plus additional European languages: Bulgarian, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hungarian, Irish, Italian, Latvian, Lithuanian, Maltese, Norwegian, Polish, Portuguese, Romanian, Slovak, Slovenian, Spanish, Swedish, Turkish, Ukrainian
Chat Template
This model uses the ChatML format:
<|im_start|>system
{system_message}<|im_end|>
<|im_start|>user
{user_message}<|im_end|>
<|im_start|>assistant
{assistant_message}<|im_end|>
Credits
- Original Model: UTTER Project - EuroLLM team
- Calibration Dataset: ultrachat_200k
License
Apache 2.0 (same as base model)
- Downloads last month
- 35
Model tree for CarlosRCDev/EuroLLM-22B-Instruct-2512-awq
Base model
utter-project/EuroLLM-22B-2512