Instructions to use Keanual/MiRAI-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Keanual/MiRAI-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Keanual/MiRAI-4B") 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("Keanual/MiRAI-4B") model = AutoModelForCausalLM.from_pretrained("Keanual/MiRAI-4B", 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 Keanual/MiRAI-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Keanual/MiRAI-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Keanual/MiRAI-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Keanual/MiRAI-4B
- SGLang
How to use Keanual/MiRAI-4B 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 "Keanual/MiRAI-4B" \ --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": "Keanual/MiRAI-4B", "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 "Keanual/MiRAI-4B" \ --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": "Keanual/MiRAI-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Desktop
- Docker Model Runner
How to use Keanual/MiRAI-4B with Docker Model Runner:
docker model run hf.co/Keanual/MiRAI-4B
MiRAI-4B (v0.1)
MiRAI is a model from the K-AI family. It is a small multilingual AI assistant that chats in English, Bahasa Indonesia, and Japanese (日本語).
MiRAI-4B is a fine-tune of Qwen3-4B.
Contoh / Examples
| Prompt | MiRAI |
|---|---|
| Who are you? | I'm MiRAI, a small multilingual AI assistant that speaks English, Indonesian, and Japanese. |
| Kamu siapa? | Aku MiRAI, asisten AI multibahasa yang bisa berbicara bahasa Inggris, Indonesia, dan Jepang. |
| あなたは誰ですか? | 私はMiRAIです。英語、インドネシア語、日本語で話せる多言語AIアシスタントです。 |
Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
name = "Keanual/MiRAI-4B"
tok = AutoTokenizer.from_pretrained(name)
model = AutoModelForCausalLM.from_pretrained(name, torch_dtype="auto", device_map="auto")
msgs = [{"role": "user", "content": "Kamu siapa?"}]
inp = tok.apply_chat_template(msgs, add_generation_prompt=True,
enable_thinking=False,
return_tensors="pt", return_dict=True).to(model.device)
out = model.generate(**inp, max_new_tokens=256, temperature=0.7, top_p=0.9, do_sample=True)
print(tok.decode(out[0][inp["input_ids"].shape[1]:], skip_special_tokens=True))
Training details
- Base model: Qwen3-4B
- Method: QLoRA (4-bit) with Unsloth, LoRA r=16, merged to 16-bit
- Hardware: Google Colab, free T4 GPU
- Steps: 400 (batch 2, gradient accumulation 4, learning rate 2e-4)
- Data (about 1,500 examples per language, plus identity data):
- English:
yahma/alpaca-cleaned - Indonesian:
FreedomIntelligence/alpaca-gpt4-indonesian - Japanese:
FreedomIntelligence/alpaca-gpt4-japanese - Hand-written identity examples (EN / ID / JA) so the model introduces itself as MiRAI
- English:
Limitations
- This is an early version (v0.1) and a small 4B model, so it can make mistakes and state wrong facts with confidence.
- Training data is relatively small and partly machine-generated, so answers can sound generic and quality varies by language.
- It was not trained for tool calling.
- Not suitable for medical, legal, or financial decisions.
License
The model weights follow the base model license (Apache 2.0). Check the licenses of the datasets listed above before commercial use.
Credits
Part of the K-AI model family.
About K-AI
MiRAI is built by K-AI, an Indonesian AI Startup. Learn more about K-AI, our team, and our other projects on our website: kai-official.netlify.app
Ringkasan (Bahasa Indonesia)
MiRAI-4B adalah model dari keluarga K-AI: asisten AI multibahasa (Inggris, Indonesia, Jepang) hasil fine-tuning dari Qwen3-4B. Ini versi awal (v0.1): ukurannya kecil, jadi bisa keliru dan jawabannya belum selalu sempurna. Jangan dipakai untuk keputusan medis, hukum, atau keuangan.
- Downloads last month
- 470