Instructions to use num1notsvn/wicara-56m-chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use num1notsvn/wicara-56m-chat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="num1notsvn/wicara-56m-chat") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("num1notsvn/wicara-56m-chat") model = AutoModelForCausalLM.from_pretrained("num1notsvn/wicara-56m-chat", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use num1notsvn/wicara-56m-chat with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "num1notsvn/wicara-56m-chat" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "num1notsvn/wicara-56m-chat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/num1notsvn/wicara-56m-chat
- SGLang
How to use num1notsvn/wicara-56m-chat 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 "num1notsvn/wicara-56m-chat" \ --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": "num1notsvn/wicara-56m-chat", "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 "num1notsvn/wicara-56m-chat" \ --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": "num1notsvn/wicara-56m-chat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use num1notsvn/wicara-56m-chat with Docker Model Runner:
docker model run hf.co/num1notsvn/wicara-56m-chat
Wicara 56M Chat
Weight-efficient Indonesian Conversational Architecture, Research Artifact
A 56-million-parameter Indonesian conversational model that we trained from scratch on a single consumer laptop (NVIDIA RTX 4050 6 GB).
Wicara (from Sanskrit vicāra): speech, discourse.
Data, tokenizer, architecture, training, and SFT pipeline were built directly in PyTorch — no off-the-shelf model, no external API. This model is the conversational and instruction-tuned version (SFT v5), fine-tuned directly on top of our base model: num1notsvn/wicara-56m-base.
- Author: Bagus Ardin Prayoga (@num1notsvn)
- Base Model: num1notsvn/wicara-56m-base
- Language: Indonesian (
id) - Parameters: 56.0M (45.5M non-embedding)
- Architecture: LLaMA-style (Pre-norm RMSNorm, RoPE, SwiGLU, Grouped-Query Attention, Tied Embeddings)
- Type: Conversational / Instruction-tuned (SFT v5)
- License: Apache-2.0
- Source Code: GitHub - bagusardin25/WicaraLLM
Architecture Specifications
| Component | Specification |
|---|---|
| Total Parameters | 56,027,520 |
| Non-Embedding Parameters | 45,541,120 |
Layers (n_layer) |
10 |
Hidden Dimension (d_model) |
640 |
| Attention Mechanism | Grouped-Query Attention (10 query heads / 5 KV heads, GQA 2:1) |
Feed-Forward Dimension (d_ffn) |
1,728 (SwiGLU) |
Head Dimension (head_dim) |
64 |
| Context Length | 512 tokens |
| Vocabulary Size | 16,384 byte-level BPE (4.26 chars/token on Indonesian text) |
| Positional Embedding | RoPE ($\theta = 10000.0$) |
| Normalization | Pre-norm RMSNorm ($\epsilon = 10^{-5}$) |
| Embedding Tying | Yes (lm_head.weight == tok_emb.weight) |
Training Details
Pretraining (wicara-56m-base)
- Data: 1.12 billion tokens (3,985,535 documents) curated exclusively from Indonesian texts:
- OpenSubtitles v2024 (43.2%)
- FineWeb-2
ind_Latn(18.7%) - Indonesian Wikipedia (15.5%)
- Cendol v2 (11.5%)
- Aya Collection (10.8%)
- TED2020 (0.3%)
- Compute: Single RTX 4050 6 GB laptop (~11.1 hours, 28,017 tokens/sec).
- Validation Loss: 3.0505 (Perplexity: 21.2).
Supervised Fine-Tuning (SFT v5 - wicara-56m-chat)
- Base Checkpoint: Initialized directly from
wicara-56m-base(step 17,010). - Data: ~40,000 conversational and instruction examples mined from Aya Collection, Cendol v2, and subtitles, augmented with 591 curated handwritten samples to anchor persona ("Wicara") and constrain hallucinations.
- Loss Masking: Masked cross-entropy loss computed strictly over assistant turn tokens (user and system prompts are unmasked).
- Safety: Built-in deterministic guardrails for crisis prompts and special-token input sanitization (
src/infer/pencegat.py).
Quickstart & Usage
You can run Wicara using the Hugging Face transformers library directly:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "num1notsvn/wicara-56m-chat"
device = "cuda" if torch.cuda.is_available() else "cpu"
# Load tokenizer and model
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16).to(device)
# Prepare conversation
messages = [
{"role": "system", "content": "Kamu adalah asisten AI berbahasa Indonesia yang ramah."},
{"role": "user", "content": "Halo! Siapa namamu dan kamu bisa apa?"},
]
# Apply chat template
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(device)
# Generate response
outputs = model.generate(
**inputs,
max_new_tokens=160,
temperature=0.7,
top_p=0.9,
repetition_penalty=1.15,
do_sample=True,
eos_token_id=[tokenizer.eos_token_id, 2],
)
response = tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
print(response)
Limitations & Intended Use
- Resource-Constrained Research: Wicara 56M is designed to demonstrate efficient small-language-model architecture for Indonesian dialogue running locally on edge and consumer devices.
- Factual Knowledge: Due to its compact size (56M parameters), the model should not be used as an authoritative factual reference without external verification or RAG (Retrieval-Augmented Generation).
- Context Length: The context window is 512 tokens.
Citation & License
Released under the Apache-2.0 License.
@misc{ardin2026wicara,
title={Wicara: A Weight-efficient Indonesian Conversational Architecture Built from Scratch},
author={Bagus Ardin Prayoga},
year={2026},
publisher={Hugging Face},
howpublished={\url{https://huggingface.co/num1notsvn/wicara-56m-chat}}
}
- Downloads last month
- 663