Welcome
utter-project/ EuroLLM-9B-Instruct
API Sample: utter-project/EuroLLM-9B-Instruct
You don't have any projects yet. To be able to use our api service effectively, please sign in/up and create a project.
Get your api keyPrepare Authentication Signature
//Sign up Wiro dashboard and create project
export YOUR_API_KEY="{{useSelectedProjectAPIKey}}";
export YOUR_API_SECRET="XXXXXXXXX";
//unix time or any random integer value
export NONCE=$(date +%s);
//hmac-SHA256 (YOUR_API_SECRET+Nonce) with YOUR_API_KEY
export SIGNATURE="$(echo -n "${YOUR_API_SECRET}${NONCE}" | openssl dgst -sha256 -hmac "${YOUR_API_KEY}")";
Create a New Folder - Make HTTP Post Request
Create a New Folder - Response
Upload a File to the Folder - Make HTTP Post Request
Upload a File to the Folder - Response
Run Command - Make HTTP Post Request
curl -X POST "{{apiUrl}}/Run/{{toolSlugOwner}}/{{toolSlugProject}}" \
-H "Content-Type: {{contentType}}" \
-H "x-api-key: ${YOUR_API_KEY}" \
-H "x-nonce: ${NONCE}" \
-H "x-signature: ${SIGNATURE}" \
-d '{{toolParameters}}';
Run Command - Response
//response body
{
"errors": [],
"taskid": "2221",
"socketaccesstoken": "eDcCm5yyUfIvMFspTwww49OUfgXkQt",
"result": true
}
Get Task Detail - Make HTTP Post Request
curl -X POST "{{apiUrl}}/Task/Detail" \
-H "Content-Type: {{contentType}}" \
-H "x-api-key: ${YOUR_API_KEY}" \
-H "x-nonce: ${NONCE}" \
-H "x-signature: ${SIGNATURE}" \
-d '{
"tasktoken": 'eDcCm5yyUfIvMFspTwww49OUfgXkQt',
}';
Get Task Detail - Response
//response body
{
"total": "1",
"errors": [],
"tasklist": [
{
"id": "2221",
"uuid": "15bce51f-442f-4f44-a71d-13c6374a62bd",
"name": "",
"socketaccesstoken": "eDcCm5yyUfIvMFspTwww49OUfgXkQt",
"parameters": {
"inputImage": "https://api.wiro.ai/v1/File/mCmUXgZLG1FNjjjwmbtPFr2LVJA112/inputImage-6060136.png"
},
"debugoutput": "",
"debugerror": "",
"starttime": "1734513809",
"endtime": "1734513813",
"elapsedseconds": "6.0000",
"status": "task_postprocess_end",
"cps": "0.000585000000",
"totalcost": "0.003510000000",
"guestid": null,
"projectid": "699",
"modelid": "598",
"description": "",
"basemodelid": "0",
"runtype": "model",
"modelfolderid": "",
"modelfileid": "",
"callbackurl": "",
"marketplaceid": null,
"createtime": "1734513807",
"canceltime": "0",
"assigntime": "1734513807",
"accepttime": "1734513807",
"preprocessstarttime": "1734513807",
"preprocessendtime": "1734513807",
"postprocessstarttime": "1734513813",
"postprocessendtime": "1734513814",
"pexit": "0",
"categories": "["tool","image-to-image","quick-showcase","compare-landscape"]",
"outputs": [
{
"id": "6bc392c93856dfce3a7d1b4261e15af3",
"name": "0.png",
"contenttype": "image/png",
"parentid": "6c1833f39da71e6175bf292b18779baf",
"uuid": "15bce51f-442f-4f44-a71d-13c6374a62bd",
"size": "202472",
"addedtime": "1734513812",
"modifiedtime": "1734513812",
"accesskey": "dFKlMApaSgMeHKsJyaDeKrefcHahUK",
"foldercount": "0",
"filecount": "0",
"ispublic": 0,
"expiretime": null,
"url": "https://cdn1.wiro.ai/6a6af820-c5050aee-40bd7b83-a2e186c6-7f61f7da-3894e49c-fc0eeb66-9b500fe2/0.png"
}
],
"size": "202472"
}
],
"result": true
}
Get Task Process Information and Results with Socket Connection
<script type="text/javascript">
window.addEventListener('load',function() {
//Get socketAccessToken from task run response
var SocketAccessToken = 'eDcCm5yyUfIvMFspTwww49OUfgXkQt';
WebSocketConnect(SocketAccessToken);
});
//Connect socket with connection id and register task socket token
async function WebSocketConnect(accessTokenFromAPI) {
if ("WebSocket" in window) {
var ws = new WebSocket("wss://socket.wiro.ai/v1");
ws.onopen = function() {
//Register task socket token which has been obtained from task run API response
ws.send('{"type": "task_info", "tasktoken": "' + accessTokenFromAPI + '"}');
};
ws.onmessage = function (evt) {
var msg = evt.data;
try {
var debugHtml = document.getElementById('debug');
debugHtml.innerHTML = debugHtml.innerHTML + "\n" + msg;
var msgJSON = JSON.parse(msg);
console.log('msgJSON: ', msgJSON);
if(msgJSON.type != undefined)
{
console.log('msgJSON.target: ',msgJSON.target);
switch(msgJSON.type) {
case 'task_queue':
console.log('Your task has been waiting in the queue.');
break;
case 'task_accept':
console.log('Your task has been accepted by the worker.');
break;
case 'task_preprocess_start':
console.log('Your task preprocess has been started.');
break;
case 'task_preprocess_end':
console.log('Your task preprocess has been ended.');
break;
case 'task_assign':
console.log('Your task has been assigned GPU and waiting in the queue.');
break;
case 'task_start':
console.log('Your task has been started.');
break;
case 'task_output':
console.log('Your task has been started and printing output log.');
console.log('Log: ', msgJSON.message);
break;
case 'task_error':
console.log('Your task has been started and printing error log.');
console.log('Log: ', msgJSON.message);
break;
case 'task_output_full':
console.log('Your task has been completed and printing full output log.');
break;
case 'task_error_full':
console.log('Your task has been completed and printing full error log.');
break;
case 'task_end':
console.log('Your task has been completed.');
break;
case 'task_postprocess_start':
console.log('Your task postprocess has been started.');
break;
case 'task_postprocess_end':
console.log('Your task postprocess has been completed.');
console.log('Outputs: ', msgJSON.message);
//output files will add ui
msgJSON.message.forEach(function(currentValue, index, arr){
console.log(currentValue);
var filesHtml = document.getElementById('files');
filesHtml.innerHTML = filesHtml.innerHTML + '<img src="' + currentValue.url + '" style="height:300px;">'
});
break;
}
}
} catch (e) {
console.log('e: ', e);
console.log('msg: ', msg);
}
};
ws.onclose = function() {
alert("Connection is closed...");
};
} else {
alert("WebSocket NOT supported by your Browser!");
}
}
</script>
Prepare UI Elements Inside Body Tag
<div id="files"></div>
<pre id="debug"></pre>
Model Card for EuroLLM-9B-Instruct
This is the model card for EuroLLM-9B-Instruct. You can also check the pre-trained version: EuroLLM-9B.
- Developed by: Unbabel, Instituto Superior Técnico, Instituto de Telecomunicações, University of Edinburgh, Aveni, University of Paris-Saclay, University of Amsterdam, Naver Labs, Sorbonne Université.
- Funded by: European Union.
- Model type: A 9B parameter multilingual transfomer LLM.
- 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.
EuroLLM-9B is a 9B parameter model trained on 4 trillion tokens divided across the considered languages and several data sources: Web data, parallel data (en-xx and xx-en), and high-quality datasets.
EuroLLM-9B-Instruct was further instruction tuned on EuroBlocks, an instruction tuning dataset with focus on general instruction-following and machine translation.
Model Description
EuroLLM uses a standard, dense Transformer architecture:
- We use grouped query attention (GQA) with 8 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 400 Nvidia H100 GPUs of the Marenostrum 5 supercomputer, training the model with a constant batch size of 2,800 sequences, which corresponds to approximately 12 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 | 42 |
Embedding Size | 4,096 |
FFN Hidden Size | 12,288 |
Number of Heads | 32 |
Number of KV Heads (GQA) | 8 |
Activation Function | SwiGLU |
Position Encodings | RoPE (\Theta=10,000) |
Layer Norm | RMSNorm |
Tied Embeddings | No |
Embedding Parameters | 0.524B |
LM Head Parameters | 0.524B |
Non-embedding Parameters | 8.105B |
Total Parameters | 9.154B |
Run the model
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "utter-project/EuroLLM-9B-Instruct"
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))
Results
EU Languages
Table 1: Comparison of open-weight LLMs on multilingual benchmarks. The borda count corresponds to the average ranking of the models (see (Colombo et al., 2022)). For Arc-challenge, Hellaswag, and MMLU we are using Okapi datasets (Lai et al., 2023) which include 11 languages. For MMLU-Pro and MUSR we translate the English version with Tower (Alves et al., 2024) to 6 EU languages.
* As there are no public versions of the pre-trained models, we evaluated them using the post-trained versions.
The results in Table 1 highlight EuroLLM-9B's superior performance on multilingual tasks compared to other European-developed models (as shown by the Borda count of 1.0), as well as its strong competitiveness with non-European models, achieving results comparable to Gemma-2-9B and outperforming the rest on most benchmarks.
English
Table 2: Comparison of open-weight LLMs on English general benchmarks.
* As there are no public versions of the pre-trained models, we evaluated them using the post-trained versions.
The results in Table 2 demonstrate EuroLLM's strong performance on English tasks, surpassing most European-developed models and matching the performance of Mistral-7B (obtaining the same Borda count).
Bias, Risks, and Limitations
EuroLLM-9B has not been aligned to human preferences, so the model may generate problematic outputs (e.g., hallucinations, harmful content, or false statements).
Tools
View All
