hzlo0 commited on
Commit
14da36b
·
verified ·
1 Parent(s): 4383315

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +122 -0
README.md ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: gemma
3
+ library_name: transformers
4
+ tags:
5
+ - gguf
6
+ - gemma
7
+ - lilo
8
+ - cybersecurity
9
+ - indonesian
10
+ - llama-cpp
11
+ language:
12
+ - id
13
+ - en
14
+ ---
15
+
16
+ # Lilo Cyber
17
+
18
+ Model bahasa Indonesia untuk **keamanan siber, pemrograman, dan analisis teknis**.
19
+ Fine-tune dari `google/gemma-3-4b-it` (arsitektur gemma2) memakai dataset
20
+ [`zelapi/lilo-cyber`](https://huggingface.co/datasets/zelapi/lilo-cyber), lalu di-merge ke
21
+ bf16 dan dikuantisasi ke **GGUF Q4_K_M** — ringan untuk inferensi CPU.
22
+
23
+ ## Spesifikasi
24
+
25
+ | Item | Nilai |
26
+ |---|---|
27
+ | Base | `google/gemma-3-4b-it` (gated, manual approval) |
28
+ | Adaptor | LoRA r=32, alpha=64, dropout=0.05, target `q,k,v,o,gate,up,down` |
29
+ | Trainable params | 65.6M (1.50%) |
30
+ | Presisi training | 4-bit NF4 QLoRA (bf16 compute), GPU T4 |
31
+ | Sequence length | 384, batch 1, grad-accum 8, lr 2e-4 (OneCycle, cosine) |
32
+ | Data | 10.163 train / 207 val dari `zelapi/lilo-cyber` |
33
+ | Merge | LoRA di-merge ke bf16 via `peft`, lalu `convert_hf_to_gguf.py --outtype f16` |
34
+ | Kuantisasi | `llama-quantize … Q4_K_M` |
35
+ | Ukuran file | ~2.4 GB |
36
+
37
+ Adaptor LoRA mentah tersedia di repo [`zelapi/lilo-cyber-rasxlite-lora`](https://huggingface.co/zelapi/lilo-cyber-rasxlite-lora).
38
+
39
+ ## Struktur data latih
40
+
41
+ `zelapi/lilo-cyber` berisi kolom `messages` (list of `{role, content}`) dan `source`:
42
+
43
+ | source | jumlah |
44
+ |---|---|
45
+ | `evol-instruct-id` | 3.000 |
46
+ | `intisari-chat` | 3.000 |
47
+ | `alpaca-gpt4-id` | 3.000 |
48
+ | `slang-lexicon` | 988 |
49
+ | `formalization` | 198 |
50
+ | `lilo-cyber-cybersecurity-id` | 72 |
51
+ | `lilo-cyber-chat-id` | 59 |
52
+ | `lilo-cyber-coding-id` | 53 |
53
+
54
+ Total: 10.163 baris train, 207 baris val.
55
+
56
+ ## Pemakaian
57
+
58
+ ### llama.cpp
59
+
60
+ ```bash
61
+ ./llama-cli -m lilo-cyber-Q4_K_M.gguf \
62
+ -c 1024 -t 2 -n 256 \
63
+ --chat-template gemma \
64
+ -p "Buat checklist hardening untuk server Ubuntu"
65
+ ```
66
+
67
+ ### Ollama
68
+
69
+ Buat `Modelfile`:
70
+
71
+ ```
72
+ FROM ./lilo-cyber-Q4_K_M.gguf
73
+ PARAMETER stop "<start_of_turn>"
74
+ PARAMETER stop "<end_of_turn>"
75
+ PARAMETER num_ctx 1024
76
+ PARAMETER num_thread 2
77
+ PARAMETER num_batch 128
78
+ PARAMETER temperature 0.7
79
+ PARAMETER top_p 0.9
80
+ PARAMETER repeat_penalty 1.1
81
+ TEMPLATE """<start_of_turn>user
82
+ {{ .Prompt }}<end_of_turn>
83
+ <start_of_turn>model
84
+ {{ .Response }}<end_of_turn>"""
85
+ ```
86
+
87
+ Lalu:
88
+
89
+ ```bash
90
+ ollama create lilo-cyber -f Modelfile
91
+ ollama run lilo-cyber
92
+ ```
93
+
94
+ ### Prompt template (gemma)
95
+
96
+ ```
97
+ <start_of_turn>user
98
+ {prompt}<end_of_turn>
99
+ <start_of_turn>model
100
+ ```
101
+
102
+ ## Pipeline yang dipakai
103
+
104
+ 1. Dataset dari `zelapi/lilo-cyber` → pasangan user/assistant, dibersihkan whitespace, dibatasi panjang
105
+ 2. QLoRA training di Colab T4 (burst pendek + checkpoint ke Hub, karena runtime sering di-recycle)
106
+ 3. Merge adaptor LoRA ke base bf16
107
+ 4. `convert_hf_to_gguf.py --outtype f16`
108
+ 5. `llama-quantize … Q4_K_M`
109
+
110
+ ## Catatan & batasan
111
+
112
+ - `num_ctx 1024` sengaja rendah supaya tidak OOM di RAM kecil. Naikkan hanya jika RAM cukup.
113
+ - `temperature 0.7`, `top_p 0.9` menjaga jawaban ringkas; naikkan `repeat_penalty` kalau model mengulang.
114
+ - Q4_K_M sedikit menurunkan kualitas dibanding f16 — pertahankan versi f16 bila butuh kualitas maksimum.
115
+ - Diuji pada CPU 2 vCPU, sehingga throughput rendah. Untuk produksi gunakan GPU dan `num_ctx` lebih besar.
116
+ - Model ini bisa saja membuat rekomendasi keamanan yang keliru. Verifikasi selalu sebelum dipakai di sistem nyata.
117
+
118
+ ## Lisensi & kredit
119
+
120
+ - Base: [`google/gemma-3-4b-it`](https://huggingface.co/google/gemma-3-4b-it) — Gemma Terms of Use
121
+ - Dataset: [`zelapi/lilo-cyber`](https://huggingface.co/datasets/zelapi/lilo-cyber)
122
+ - Referensi style/identitas: [`rizkiagungid/rasxlite`](https://ollama.com/rizkiagungid/rasxlite)