Text Generation
Transformers
Safetensors
English
Italian
ita
italian
anita
magistral
24b
uniba
bari
italy
italia
Conversational
LLaMantino
Instructions to use m-polignano/ANITA-NEXT-24B-Magistral-2506-ITA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use m-polignano/ANITA-NEXT-24B-Magistral-2506-ITA with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="m-polignano/ANITA-NEXT-24B-Magistral-2506-ITA")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("m-polignano/ANITA-NEXT-24B-Magistral-2506-ITA", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use m-polignano/ANITA-NEXT-24B-Magistral-2506-ITA with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "m-polignano/ANITA-NEXT-24B-Magistral-2506-ITA" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "m-polignano/ANITA-NEXT-24B-Magistral-2506-ITA", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/m-polignano/ANITA-NEXT-24B-Magistral-2506-ITA
- SGLang
How to use m-polignano/ANITA-NEXT-24B-Magistral-2506-ITA 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 "m-polignano/ANITA-NEXT-24B-Magistral-2506-ITA" \ --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": "m-polignano/ANITA-NEXT-24B-Magistral-2506-ITA", "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 "m-polignano/ANITA-NEXT-24B-Magistral-2506-ITA" \ --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": "m-polignano/ANITA-NEXT-24B-Magistral-2506-ITA", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use m-polignano/ANITA-NEXT-24B-Magistral-2506-ITA with Docker Model Runner:
docker model run hf.co/m-polignano/ANITA-NEXT-24B-Magistral-2506-ITA
| {{- bos_token }} | |
| {%- if messages[0]['role'] == 'system' %} | |
| {%- if messages[0]['content'] is string %} | |
| {%- set system_message = messages[0]['content'] %} | |
| {%- else %} | |
| {%- set system_message = messages[0]['content'][0]['text'] %} | |
| {%- endif %} | |
| {%- set loop_messages = messages[1:] %} | |
| {%- else %} | |
| {%- set system_message = "Sei un an assistente AI per la lingua italiana di nome ANITA-NEXT (Advanced Natural-based interaction for the ITAlian language Next Generation) creato dal ricercatore Marco Polignano, Università degli Studi di Bari Aldo Moro, Italia. Sei un esperto della lingua, cultura, tradizioni, modo di pensare e storia italiana.\n\nL'utente ti chiederà di risolvere un compito o rispondere ad una domanda. Rispondi e ragiona usando la lingua della domanda, preferendo l'Italiano.\nScrivi il tuo flusso di pensiero (monologo interiore) tra i tag <think></think>. Ragiona in modo disinvolto, scrivendo riflessioni e/o bozze, come se stessi lavorando a un esercizio su un foglio di carta.\nSuccessivamente, scrivi la soluzione in modo chiaro, corretto, semplice ed esaustivo basandoti sul riassunto del tuo flusso di pensiero.\nSe necessario, usa la notazione markdown per formattare la risposta." %} | |
| {%- set loop_messages = messages %} | |
| {%- endif %} | |
| {{- '[SYSTEM_PROMPT]' + system_message + '[/SYSTEM_PROMPT]' }} | |
| {#- Edits made by Unsloth #} | |
| {%- for message in loop_messages %} | |
| {%- if message['role'] == 'user' %} | |
| {%- if message['content'] is string %} | |
| {{- '[INST]' + message['content'] + '[/INST]' }} | |
| {%- else %} | |
| {{- '[INST]' }} | |
| {%- for block in message['content'] %} | |
| {%- if block['type'] == 'text' %} | |
| {{- block['text'] }} | |
| {%- elif block['type'] in ['image', 'image_url'] %} | |
| {{- '[IMG]' }} | |
| {%- else %} | |
| {{- raise_exception('Only text and image blocks are supported in message content!') }} | |
| {%- endif %} | |
| {%- endfor %} | |
| {{- '[/INST]' }} | |
| {%- endif %} | |
| {%- elif message['role'] == 'system' %} | |
| {%- if message['content'] is string %} | |
| {{- '[SYSTEM_PROMPT]' + message['content'] + '[/SYSTEM_PROMPT]' }} | |
| {%- else %} | |
| {{- '[SYSTEM_PROMPT]' + message['content'][0]['text'] + '[/SYSTEM_PROMPT]' }} | |
| {%- endif %} | |
| {%- elif message['role'] == 'assistant' %} | |
| {%- if message['content'] is string %} | |
| {{- message['content'] + eos_token }} | |
| {%- else %} | |
| {{- message['content'][0]['text'] + eos_token }} | |
| {%- endif %} | |
| {%- else %} | |
| {{- raise_exception('Only user, system and assistant roles are supported!') }} | |
| {%- endif %} | |
| {%- endfor %} |