Instructions to use Lyon28/caca-650M-untrained with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Lyon28/caca-650M-untrained with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Lyon28/caca-650M-untrained", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Lyon28/caca-650M-untrained", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Lyon28/caca-650M-untrained with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Lyon28/caca-650M-untrained" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Lyon28/caca-650M-untrained", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Lyon28/caca-650M-untrained
- SGLang
How to use Lyon28/caca-650M-untrained 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 "Lyon28/caca-650M-untrained" \ --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": "Lyon28/caca-650M-untrained", "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 "Lyon28/caca-650M-untrained" \ --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": "Lyon28/caca-650M-untrained", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Lyon28/caca-650M-untrained with Docker Model Runner:
docker model run hf.co/Lyon28/caca-650M-untrained
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 "Lyon28/caca-650M-untrained" \
--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": "Lyon28/caca-650M-untrained",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'
๐ค caca-650M-untrained
Arsitektur Transformer dengan Multi-head Latent Attention (MLA)
526,860,267 parameters โข 527M โข 20 layers โข 8,192 tokens (efektif 32,768 dgn YaRN)
๐ Dokumentasi โข ๐ป Usage โข โ๏ธ Konfigurasi โข ๐ฌ Arsitektur
โ ๏ธ PENTING: Model Belum Dilatih (Untrained)
Status Model:
- ๐ด Belum dilatih โ Bobot masih random init (
initializer_range=0.02) - ๐ก Untuk riset & eksperimen โ Arsitektur sudah siap, tinggal train dari nol
- ๐ข Base architecture release โ Titik awal pretraining
| โ Bisa | โ Belum Bisa |
|---|---|
| Load model architecture | Generate teks bermakna |
| Test forward pass | Menjawab pertanyaan |
| Measure memory & speed | Reasoning & understanding |
| Mulai pretraining dari nol | Production deployment |
๐ Deskripsi
Caca adalah arsitektur Large Language Model (LLM) yang menggabungkan Multi-head Latent Attention (MLA) ala DeepSeek-V2/V3, Multi-Token Prediction (MTP), QK-Normalization, dan sliding window attention berselang-seling โ dirancang untuk efisiensi KV cache dan skalabilitas dari model kecil (~650M) sampai sangat besar (1T+).
๐ Tentang Project Caca
Caca adalah eksperimen open-source Indonesian LLM yang dibuat dari nol secara individual dan bertahap. Bukan kompetitor siapa-siapa, cuma pengen eksplorasi apa yang bisa dilakukan dengan budget terbatas, passion unlimited, dan mindset collaborative.
Kalau berguna buat orang lain, alhamdulillah. Kalau enggak, ya tetap fun kok.
โ Lyon, Creator
๐ Mengapa Caca?
- ๐ฎ๐ฉ Fokus pada Bahasa Indonesia โ dirancang bilingual ID/EN
- ๐พ KV Cache Sangat Hemat โ MLA menekan KV cache ~81% dibanding attention standar setara
- ๐ฏ Multi-Token Prediction โ prediksi 1 token ke depan sekaligus, potensi throughput lebih baik
- ๐ Long Context via YaRN โ RoPE scaling dari 8,192 ke 32,768 token
- ๐ช Sliding Window Berselang-seling โ 10 full-attention layer + 10 sliding-window layer
๐ Spesifikasi Model
| Parameter | Value | Parameter | Value |
| Total Parameters | 526,860,267 | Vocab Size | 32,000 |
| Hidden Size | 1280 | Intermediate Size | 5120 |
| Num Layers | 20 | Attention Heads | 10 |
| Max Context Length | 8,192 | Efektif (YaRN) | 32,768 |
| RoPE Base (ฮธ) | 10,000 | Tie Embeddings | True |
| Model Size (FP16) | 1.05 GB | Formatted Size | 527M |
๐พ Kebutuhan Memory
Training Requirements
| Configuration | Model Weights | + Optimizer States | Total Training |
|---|---|---|---|
| FP32 (AdamW) | 2.11 GB | +6.32 GB | 8.43 GB |
| Mixed Precision | 1.05 GB | +7.38 GB | 8.43 GB |
| + Gradient Checkpointing | Menghemat ~30-50% activation memory | ~5.06 GB | |
Inference Requirements (MLA KV Cache)
| Precision | Model Size | KV Cache (2K ctx) | Total Memory |
|---|---|---|---|
| FP16 / BF16 | 1.05 GB | 0.020 GB | 1.07 GB |
| INT8 | 0.53 GB | 0.020 GB | 0.55 GB |
| INT4 (NF4) | 0.26 GB | 0.020 GB | 0.28 GB |
๐ก KV cache MLA jauh lebih kecil drpd attention standar karena cuma nyimpen
kv_lora_rank + qk_rope_head_dim(245 dim) per token, bukannum_heads ร head_dimpenuh. Pada 8K context, KV cache ~0.080 GB.
Performance Estimates
| Metric | Value | Notes |
|---|---|---|
| FLOPs per Token | 1,053,720,534 | Forward pass only |
| TFLOPs per Token | 0.0011 | โ 6ร untuk backward |
๐ป Cara Penggunaan
Basic Loading
from transformers import AutoConfig, AutoModelForCausalLM
import torch
config = AutoConfig.from_pretrained("Lyon28/caca-650M-untrained", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
"Lyon28/caca-650M-untrained",
config=config,
trust_remote_code=True,
torch_dtype=torch.bfloat16,
device_map="auto"
)
print(f"Model loaded: {model.num_parameters():,} parameters")
print("โ ๏ธ Model ini UNTRAINED โ output belum bermakna")
Quantized Loading (4-bit)
from transformers import AutoModelForCausalLM, BitsAndBytesConfig
import torch
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_use_double_quant=True
)
model = AutoModelForCausalLM.from_pretrained(
"Lyon28/caca-650M-untrained",
trust_remote_code=True,
quantization_config=bnb_config,
device_map="auto"
)
print(f"Memory footprint: ~0.28GB (4-bit)")
Mulai Pretraining
from transformers import TrainingArguments, Trainer
training_args = TrainingArguments(
output_dir="./output",
per_device_train_batch_size=1,
gradient_accumulation_steps=16,
learning_rate=3e-4,
max_steps=10000,
lr_scheduler_type="cosine",
warmup_steps=500,
bf16=True,
gradient_checkpointing=True,
)
trainer = Trainer(model=model, args=training_args, train_dataset=train_dataset)
trainer.train()
๐ฆ Isi Repo
Weight tersimpan dalam satu file model.safetensors.
๐๏ธ Status Training
Tidak ada metrik training (loss, wandb, tensorboard) โ ini adalah base architecture release untuk dipakai sebagai titik awal pretraining dari nol.
๐ License
Model ini dirilis di bawah Apache License 2.0 โ bebas dipakai, dimodifikasi, dan didistribusikan (dengan attribution), disediakan "as is" tanpa warranty.
๐ฅ Team & Contact
- Lyon โ Architecture design & implementation
- ๐ง [email protected]
- ๐ฌ Discussions
Dibuat oleh @Lyon28 | Licensed under Apache 2.0 | Built with ๐ค Transformers
๐ "Dari nol, untuk semua" ๐
- Downloads last month
- 45
Install from pip and serve model
# Install SGLang from pip: pip install sglang# Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Lyon28/caca-650M-untrained" \ --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": "Lyon28/caca-650M-untrained", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'