Instructions to use Eureka-COM/MistralMosaic-24B-v2-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Eureka-COM/MistralMosaic-24B-v2-4bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Eureka-COM/MistralMosaic-24B-v2-4bit", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Eureka-COM/MistralMosaic-24B-v2-4bit", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Eureka-COM/MistralMosaic-24B-v2-4bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Eureka-COM/MistralMosaic-24B-v2-4bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Eureka-COM/MistralMosaic-24B-v2-4bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Eureka-COM/MistralMosaic-24B-v2-4bit
- SGLang
How to use Eureka-COM/MistralMosaic-24B-v2-4bit 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 "Eureka-COM/MistralMosaic-24B-v2-4bit" \ --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": "Eureka-COM/MistralMosaic-24B-v2-4bit", "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 "Eureka-COM/MistralMosaic-24B-v2-4bit" \ --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": "Eureka-COM/MistralMosaic-24B-v2-4bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Eureka-COM/MistralMosaic-24B-v2-4bit with Docker Model Runner:
docker model run hf.co/Eureka-COM/MistralMosaic-24B-v2-4bit
MistralMosaic-24B-v2-4bit
A 4-bit version of MistralMosaic-24B-v2, quantized with bitsandbytes (NF4 with double quantization, bf16 compute). The model, its results and its limitations are described on that page; this page only covers what differs.
| bf16 (MistralMosaic-24B-v2) | this model | |
|---|---|---|
| Weights on the GPU | 63.0 GB | 18.3 GB |
| Files (safetensors) | 62.3 GB | 18.1 GB |
| Loss per token, change from bf16 | โ | +0.0417 |
| Same top-1 token as bf16 | โ | 91.5% |
| Generation speed (A100, tokens/s) | 1.51 | 1.37 |
Loss and top-1 agreement were measured on 8 Wikipedia articles (4 English, 4 Japanese, 4,096 tokens each). After saving, the model was loaded again from the saved files and gave the same logits.
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
name = "Eureka-COM/MistralMosaic-24B-v2-4bit"
tok = AutoTokenizer.from_pretrained(name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(name, trust_remote_code=True, device_map="cuda")
ids = tok("The capital of Japan is", return_tensors="pt").input_ids.to(model.device)
out = model.generate(ids, max_new_tokens=32, do_sample=False)
print(tok.decode(out[0]))
Requirements: bitsandbytes (built with 0.50.2) and a CUDA GPU, plus what MistralMosaic-24B-v2 needs. Do not pass fix_mistral_regex (see the main page).
License and sources
Apache-2.0 (LICENSE, NOTICE); see MistralMosaic-24B-v2 for the base weights, the official code and the data. Every number here was copied by a script from the measured result files; evidence.json lists each value and its file.
- Downloads last month
- -
Model tree for Eureka-COM/MistralMosaic-24B-v2-4bit
Base model
mistralai/Mistral-Small-24B-Base-2501