Instructions to use Trentz/IndoLM-L-v0.1-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Trentz/IndoLM-L-v0.1-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Trentz/IndoLM-L-v0.1-Instruct") 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("Trentz/IndoLM-L-v0.1-Instruct") model = AutoModelForCausalLM.from_pretrained("Trentz/IndoLM-L-v0.1-Instruct", 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 Trentz/IndoLM-L-v0.1-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Trentz/IndoLM-L-v0.1-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Trentz/IndoLM-L-v0.1-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Trentz/IndoLM-L-v0.1-Instruct
- SGLang
How to use Trentz/IndoLM-L-v0.1-Instruct 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 "Trentz/IndoLM-L-v0.1-Instruct" \ --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": "Trentz/IndoLM-L-v0.1-Instruct", "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 "Trentz/IndoLM-L-v0.1-Instruct" \ --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": "Trentz/IndoLM-L-v0.1-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Trentz/IndoLM-L-v0.1-Instruct with Docker Model Runner:
docker model run hf.co/Trentz/IndoLM-L-v0.1-Instruct
IndoLM-L-v0.1-Instruct
IndoLM-L-v0.1-Instruct (release name IndoLM-L-v0.1-SFT) is a 148.7M-parameter single-turn Indonesian
instruction-tuned model based on Trentz/IndoLM-L-v0.1
(LlamaForCausalLM with GQA 14:2 and a 2,048-token context window). It is fine-tuned on IndoSFT-v0.1 (32,834
curated Indonesian examples) with 50% pretraining replay from IndoCorpus-v3.0 to prevent catastrophic forgetting.
Research model notice: At 148.7M parameters, this model follows chat formatting well (98% stop rate, 93.4% relevant), but still hallucinates facts frequently (35.4% wrong/fabricated answers in blind evaluation). Do not use it as a factual source or in production.
Model Details
| Specification | Value |
|---|---|
| Base model | Trentz/IndoLM-L-v0.1 (148.67M params, GQA 14:2, ctx 2,048) |
| SFT dataset | IndoSFT-v0.1 (32,834 examples packed at ctx 2,048) + 50% IndoCorpus-v3.0 replay |
| Checkpoint | rep50_lr2e-4_e3, best val step 700 (~1.91 SFT epochs, val loss 1.5202 vs M-SFT 1.6578) |
| Chat format | Single-turn: <|endoftext|><|user|>{prompt}<|end|><|assistant|>{answer}<|end|> |
| Stop token | <|end|> (id 7); unused special tokens suppressed in generation_config.json |
| Weights precision | fp32 (model.safetensors, 594.7 MB) |
| License | CC BY-SA 4.0 |
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo_id = "Trentz/IndoLM-L-v0.1-Instruct"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForCausalLM.from_pretrained(
repo_id,
dtype=torch.bfloat16,
device_map="auto",
)
prompt = tokenizer.apply_chat_template(
[{"role": "user", "content": "Jelaskan secara singkat apa itu fotosintesis."}],
tokenize=False,
add_generation_prompt=True,
)
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to(model.device)
with torch.no_grad():
out = model.generate(
**inputs,
max_new_tokens=160,
do_sample=True,
temperature=0.7,
top_k=50,
)
print(tokenizer.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Evaluation
Evaluated blindly in a single shuffled batch on IndoEval-chat-v0.1 (198 prompts Γ 4 models = 792 answers):
| Model | baik (good) |
Relevant | Fully correct (=2) |
Wrong / hallucinated (=0) |
Instr (0β2) | Factuality (0β2) | Language (0β2) |
|---|---|---|---|---|---|---|---|
IndoLM-L-v0.1-Instruct |
63.1% | 93.4% | 17.2% | 35.4% | 1.27 | 0.82 | 1.46 |
IndoLM-M-v0.2-Instruct (70M) |
58.6% | 87.9% | 14.6% | 39.4% | 1.13 | 0.75 | 1.38 |
IndoLM-L-v0.1 base (3-shot) |
5.1% | 14.1% | 0.5% | 94.4% | 0.14 | 0.06 | 1.29 |
- Strongest categories (
baik):saran_langkah93.3%,ringkas88.9%,tulis_singkat88.9%,tanya_teks(grounded QA) 83.3% (+22.2% vs M-Instruct),klasifikasi83.3%,tolak77.8%,tanya_jawab50.0% (+16.7% vs M-Instruct). - Weakest category:
aya(open-ended/translation prompts) at 25.0% (under-represented inIndoSFT-v0.1). - Forgetting (
IndoEval-heldout-v2@ 2,048):0.8680bpb vs base0.8602(+0.0078bpb, well below the+0.03gate).<|end|>stop rate: 98.0%. - HF conversion parity:
β1.54e-09bpb diff across all 3,387heldout-v2docs (fp32) and 5/5 exact token-for-token greedy chat parity with PyTorch.
Limitations
- Single-turn only: multi-turn dialogue and system prompts are not trained yet.
- Unreliable factuality: 35.4% of evaluation answers contain errors or fabrications; strongest on grounded tasks where context is provided in the prompt.
- Not a translator & limited safety: translation is untrained and refusal is inconsistent (77.8% on
tolak).
License
Released under CC BY-SA 4.0 (inherited from Indonesian Wikipedia and IndoLM-L-v0.1).
- Downloads last month
- 331
Model tree for Trentz/IndoLM-L-v0.1-Instruct
Base model
Trentz/IndoLM-L-v0.1