Run this model with HF Jobs
Run K-Ai-Official/MiRAI-2.5 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/K-Ai-Official/MiRAI-2.5. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/K-Ai-Official/MiRAI-2.5 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/K-Ai-Official/MiRAI-2.5. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/K-Ai-Official/MiRAI-2.5. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use K-Ai-Official/MiRAI-2.5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use K-Ai-Official/MiRAI-2.5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="K-Ai-Official/MiRAI-2.5") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("K-Ai-Official/MiRAI-2.5") model = AutoModelForCausalLM.from_pretrained("K-Ai-Official/MiRAI-2.5", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use K-Ai-Official/MiRAI-2.5 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "K-Ai-Official/MiRAI-2.5" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "K-Ai-Official/MiRAI-2.5", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/K-Ai-Official/MiRAI-2.5
- SGLang
How to use K-Ai-Official/MiRAI-2.5 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 "K-Ai-Official/MiRAI-2.5" \ --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": "K-Ai-Official/MiRAI-2.5", "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 "K-Ai-Official/MiRAI-2.5" \ --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": "K-Ai-Official/MiRAI-2.5", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use K-Ai-Official/MiRAI-2.5 with Docker Model Runner:
docker model run hf.co/K-Ai-Official/MiRAI-2.5
MiRAI 2.5 7B
Multilingual. Fast. Reasoning. Developed by K-Ai.
MiRAI 2.5 is the successor to MiRAI-4B. It is a 7B decoder-only language model fine-tuned from Mistral-7B-v0.3 for Indonesian, English, and Japanese. It was trained with QLoRA on a single NVIDIA T4, and the adapter was then merged into the base weights.
Model Details
| Developer | K-Ai |
| Predecessor | MiRAI-4B |
| Base model | mistralai/Mistral-7B-v0.3 |
| Parameters | 7B |
| Type | Decoder-only causal language model |
| Languages | Indonesian, English, Japanese |
| Method | Supervised fine-tuning with QLoRA, merged |
| License | Apache-2.0 (see the dataset licenses below) |
Strengths
Based on the small internal evaluation below, compared with the untuned base model:
- Step-by-step math in English: GSM8K subset went from 0.05 to 0.60.
- Reading comprehension: higher in all three languages, with the largest gain in Japanese (0.25 to 0.55).
- Instruction format: trained to answer in a consistent
[INST]prompt format. - Trilingual coverage: one model for Indonesian, English, and Japanese.
- Accessible training recipe: trained on free-tier class hardware.
Intended Use
- Experiments with Indonesian, English, and Japanese instruction following
- Question answering over a provided passage
- Simple English word problems, with answers verified by the user
- A starting point for further fine-tuning
Not intended for medical, legal, financial, or other high-stakes decisions, or for unsupervised public-facing deployment.
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "K-Ai-Official/MiRAI-2.5"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto", device_map="auto")
messages = [{"role": "user", "content": "Jelaskan fotosintesis secara singkat."}]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", return_dict=True).to(model.device)
output = model.generate(**inputs, max_new_tokens=256, do_sample=True, temperature=0.7, top_p=0.9,
pad_token_id=tokenizer.eos_token_id)
print(tokenizer.decode(output[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
On a 16 GB GPU, load the model in 4-bit:
from transformers import BitsAndBytesConfig
quant = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4",
bnb_4bit_use_double_quant=True, bnb_4bit_compute_dtype=torch.float16)
model = AutoModelForCausalLM.from_pretrained(model_id, quantization_config=quant, device_map="auto")
Prompt Format
<s>[INST] question [/INST]answer</s>
Training Data
| Dataset | Role | License | Revision | Examples in mixture |
|---|---|---|---|---|
| CohereLabs/aya_dataset | Human-annotated instructions (ID, EN, JA) | Apache-2.0 | f9ea04583f |
8040 |
| google-research-datasets/tydiqa | Reading comprehension (ID, EN, JA) | Apache-2.0 (Wikipedia text: CC BY-SA) | da78f23f91 |
10489 |
| openai/gsm8k | Math word problems (EN) | MIT | 740312add8 |
3230 |
| google-research-datasets/mbpp | Python coding (EN) | CC-BY-4.0 | 4bb6404fdc |
237 |
Counts are for the sampled mixture and include repeated examples. The short training run saw only about 4,000 of them.
Training Procedure
| Setting | Value |
|---|---|
| Quantization during training | 4-bit NF4 with double quantization |
| LoRA rank | 16 |
| Max sequence length | 1024 |
| Optimizer steps | 250 (about 4,000 examples) |
| Hardware | 1x NVIDIA T4 |
Loss was computed on assistant responses only.
Evaluation
Automatic evaluation on random subsets with n = 20 per task and greedy decoding. These numbers are a rough indication only: one question equals 5 percentage points. They are not official benchmark or leaderboard scores.
| Metric | Base | MiRAI 2.5 |
|---|---|---|
| MMLU Indonesian (MMMLU) | 0.00 | 0.20 |
| MMLU English | 0.40 | 0.25 |
| MMLU Japanese (MMMLU) | 0.10 | 0.20 |
| Math English (GSM8K) | 0.05 | 0.60 |
| Math Japanese (MGSM) | 0.10 | 0.20 |
| Reading Indonesian (TyDi QA, contains answer) | 0.55 | 0.65 |
| Reading English (TyDi QA, contains answer) | 0.50 | 0.70 |
| Reading Japanese (TyDi QA, contains answer) | 0.25 | 0.55 |
| Validation loss | 2.0713 | 0.6613 |
| Perplexity | 7.93 | 1.94 |
| Latency per response (s) | 5.00 | 5.13 |
| Tokens per second | 13.3 | 7.6 |
| Peak VRAM (GB) | 5.43 | 5.51 |
How to read this
- The base model is not instruction-tuned, so part of the gain likely comes from learning the answer format.
- MMLU scores are low: apart from the base model in English, all are at or below the 25% random-guess level. MMLU English dropped after fine-tuning.
- Validation loss is measured on data from the same sources and format as training.
- Speed and memory were measured on a T4 in 4-bit with the LoRA adapter attached, before merging. The merged weights were not benchmarked.
Limitations
- Weak general knowledge: multiple-choice knowledge scores are low in all three languages.
- Short training: 250 steps is very limited for a general-purpose model.
- Math: no native Indonesian or Japanese math data was used, and Japanese math remains weak. Always verify calculations.
- Coding: very little coding data, and coding ability was not evaluated.
- Conversation: little conversational data, especially informal Indonesian. No human evaluation is reported.
- Safety: no dedicated safety alignment. The model may produce incorrect, biased, or harmful content.
- Hallucination: it can state false information with confidence.
- Contamination: overlap with the base model's pretraining data could not be checked.
Roadmap
Possible next steps: longer training, more native Indonesian and Japanese data (math and conversation), larger evaluation sets, human evaluation, and safety tuning.
License and Attribution
The model is released under Apache-2.0, following the base model. Each dataset remains subject to its own license.
- Aya Dataset: Singh et al., 2024
- TyDi QA: Clark et al., 2020 (passages from Wikipedia)
- GSM8K: Cobbe et al., 2021
- MBPP: Austin et al., 2021
- Downloads last month
- 137