Instructions to use utter-project/EuroMoE-2.6B-A0.6B-Instruct-2512 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use utter-project/EuroMoE-2.6B-A0.6B-Instruct-2512 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="utter-project/EuroMoE-2.6B-A0.6B-Instruct-2512") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("utter-project/EuroMoE-2.6B-A0.6B-Instruct-2512") model = AutoModelForCausalLM.from_pretrained("utter-project/EuroMoE-2.6B-A0.6B-Instruct-2512") 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 utter-project/EuroMoE-2.6B-A0.6B-Instruct-2512 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "utter-project/EuroMoE-2.6B-A0.6B-Instruct-2512" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "utter-project/EuroMoE-2.6B-A0.6B-Instruct-2512", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/utter-project/EuroMoE-2.6B-A0.6B-Instruct-2512
- SGLang
How to use utter-project/EuroMoE-2.6B-A0.6B-Instruct-2512 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 "utter-project/EuroMoE-2.6B-A0.6B-Instruct-2512" \ --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": "utter-project/EuroMoE-2.6B-A0.6B-Instruct-2512", "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 "utter-project/EuroMoE-2.6B-A0.6B-Instruct-2512" \ --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": "utter-project/EuroMoE-2.6B-A0.6B-Instruct-2512", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use utter-project/EuroMoE-2.6B-A0.6B-Instruct-2512 with Docker Model Runner:
docker model run hf.co/utter-project/EuroMoE-2.6B-A0.6B-Instruct-2512
Model Card for EuroMoE-2.6B-A0.6B-Instruct-2512
This is the model card for EuroMoE-2.6B-A0.6B-Instruct-2512. You can also check the pre-trained version: EuroMoE-2.6B-A0.6B-2512.
- Developed by: Instituto Superior Técnico - University of Lisbon, Instituto de Telecomunicações, University of Edinburgh, Aveni, Unbabel, University of Paris-Saclay, Artefact Research Center, University of Amsterdam, Naver Labs, Sorbonne Université.
- Funded by: European Union.
- Model type: A 2.6B parameter multilingual transformer MoE with 0.6B active parameters.
- Language(s) (NLP): Bulgarian, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hungarian, Irish, Italian, Latvian, Lithuanian, Maltese, Polish, Portuguese, Romanian, Slovak, Slovenian, Spanish, Swedish, Arabic, Catalan, Chinese, Galician, Hindi, Japanese, Korean, Norwegian, Russian, Turkish, and Ukrainian.
- License: Apache License 2.0.
Model Details
The EuroLLM project has the goal of creating a suite of LLMs capable of understanding and generating text in all European Union languages as well as some additional relevant languages. EuroMoE-2.6B-A0.6B is a 2.6B parameter model trained on 8 trillion tokens divided across the considered languages and several data sources: Web data, parallel data (en-xx and xx-en), and high-quality datasets. EuroMoE-2.6B-A0.6B-Instruct was further instruction tuned on EuroBlocks, an instruction tuning dataset with focus on general instruction-following and machine translation.
Model Description
EuroMoE uses a standard MoE Transformer architecture:
- We use grouped query attention (GQA) with 2 key-value heads, since it has been shown to increase speed at inference time while maintaining downstream performance.
- We perform pre-layer normalization, since it improves the training stability, and use the RMSNorm, which is faster.
- We use the SwiGLU activation function, since it has been shown to lead to good results on downstream tasks.
- We use rotary positional embeddings (RoPE) in every layer, since these have been shown to lead to good performances while allowing the extension of the context length.
For pre-training, we use 512 Nvidia A100 GPUs of the Leonardo supercomputer, training the model with a constant batch size of 4096 sequences, which corresponds to approximately 17 million tokens, using the Adam optimizer, and BF16 precision. Here is a summary of the model hyper-parameters:
| Sequence Length | 4,096 |
| Number of Layers | 24 |
| Embedding Size | 1,024 |
| Total/Active experts | 64/8 |
| Expert Hidden Size | 512 |
| Number of Heads | 8 |
| Number of KV Heads (GQA) | 2 |
| Activation Function | SwiGLU |
| Position Encodings | RoPE (\Theta=500,000) |
| Layer Norm | RMSNorm |
| Tied Embeddings | Yes |
| Embedding Parameters | 0.13B |
| LM Head Parameters | 0.13B |
| Active Non-embedding Parameters | 0.34B |
| Total Non-embedding Parameters | 2.35B |
| Active Parameters | 0.6B |
| Total Parameters | 2.61B |
Run the model
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "utter-project/EuroMoE-2.6B-A0.6B-Instruct-2512"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
messages = [
{
"role": "system",
"content": "You are EuroLLM --- an AI assistant specialized in European languages that provides safe, educational and helpful answers.",
},
{
"role": "user", "content": "What is the capital of Portugal? How would you describe it?"
},
]
inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
outputs = model.generate(inputs, max_new_tokens=1024)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Bias, Risks, and Limitations
EuroMoE-2.6B-A0.6B-Instruct-2512 has not been aligned to human preferences, so the model may generate problematic outputs (e.g., hallucinations, harmful content, or false statements).
- Downloads last month
- 1,072
Model tree for utter-project/EuroMoE-2.6B-A0.6B-Instruct-2512
Base model
utter-project/EuroMoE-2.6B-A0.6B-2512