h4bbo commited on
Commit
fd3e9b4
·
verified ·
1 Parent(s): fbfa699

Initial upload: FuseLLM-112M base causal LM + tokenizer/chat_template + fp16/Q4_K_M GGUF

Browse files
.gitattributes CHANGED
@@ -33,3 +33,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ gguf/FuseLLM-112M.Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
37
+ gguf/FuseLLM-112M.fp16.gguf filter=lfs diff=lfs merge=lfs -text
38
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ license: other # TODO: set the license you want to release this model under
4
+ language:
5
+ - code
6
+ tags:
7
+ - qwen3
8
+ - causal-lm
9
+ - code-completion
10
+ - habbo
11
+ - from-scratch
12
+ ---
13
+
14
+ # FuseLLM-112M
15
+
16
+ A small **112M-parameter decoder-only language model trained from scratch** (no base
17
+ checkpoint, no LoRA) on a corpus of Habbo emulator / game-server source code. The
18
+ goal is a tiny, fast model for **code completion** in that Java codebase, not a
19
+ general-purpose or instruction-following model.
20
+
21
+ ## Model details
22
+
23
+ | | |
24
+ |---|---|
25
+ | Architecture | Qwen3 (decoder-only causal LM) |
26
+ | Parameters | ~112M (tied input/output embeddings) |
27
+ | Hidden size | 512 |
28
+ | Layers | 8 (all full attention) |
29
+ | Attention heads | 8 (8 KV heads) |
30
+ | Vocab size | 151,936 |
31
+ | Max context | 2048 |
32
+ | Precision | float32 (safetensors) |
33
+ | Training | From scratch, 4 epochs, 16,188 steps |
34
+ | Final train loss | ~0.58 |
35
+
36
+ `tie_word_embeddings: true` — the output `lm_head` shares the input embedding
37
+ matrix, so checkpoints store only one copy. This is expected, not a missing weight.
38
+
39
+ ## Intended use
40
+
41
+ - **Code completion** for Habbo-style Java server code (raw prompt → continuation).
42
+ - Local experimentation / distillation base.
43
+
44
+ ## What it is NOT
45
+
46
+ - **Not instruction-tuned / not a chat model.** It was trained only on raw source
47
+ code, never on chat/instruction data.
48
+ - The Qwen3 ChatML chat template is included (it ships with the tokenizer) for
49
+ tokenizer/tool compatibility, but the model has **not** learned to follow chat
50
+ turns. Passing chat-formatted prompts will produce poor, often repetitive output.
51
+ Use it in **completion mode**, not conversation mode.
52
+
53
+ ## Usage
54
+
55
+ ### transformers (recommended for completion)
56
+
57
+ ```python
58
+ from transformers import AutoModelForCausalLM, AutoTokenizer
59
+
60
+ m = AutoModelForCausalLM.from_pretrained("h4bbo/FuseLLM-112M")
61
+ tok = AutoTokenizer.from_pretrained("h4bbo/FuseLLM-112M")
62
+
63
+ prompt = "public class Room {\n public void onEnter(Player p) {\n "
64
+ ids = tok(prompt, return_tensors="pt").input_ids
65
+ out = m.generate(ids, max_new_tokens=64, do_sample=False,
66
+ repetition_penalty=1.1, pad_token_id=tok.eos_token_id)
67
+ print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True))
68
+ ```
69
+
70
+ ### llama.cpp (completion mode)
71
+
72
+ The repo includes GGUF files (`FuseLLM-112M.fp16.gguf`, `FuseLLM-112M.Q4_K_M.gguf`)
73
+ verified to load and generate in `llama.cpp`.
74
+
75
+ ```bash
76
+ # Completion mode — pass the raw code seed, do NOT use chat/conversation mode.
77
+ llama-cli -m FuseLLM-112M.Q4_K_M.gguf -cnv -st --no-jinja \
78
+ -f seed.txt -n 64 --temp 0.0 --repeat-penalty 1.1 --no-display-prompt < /dev/null
79
+ ```
80
+
81
+ `--no-jinja` keeps the prompt raw (the embedded chat template exists but the model
82
+ isn't chat-tuned, so conversation mode is not meaningful for this model).
83
+
84
+ ## Files
85
+
86
+ - `model.safetensors`, `config.json`, `generation_config.json` — HF model
87
+ - `tokenizer.json`, `tokenizer_config.json`, `chat_template.jinja` — tokenizer + ChatML template
88
+ - `FuseLLM-112M.fp16.gguf` — lossless fp16 GGUF (~220 MB)
89
+ - `FuseLLM-112M.Q4_K_M.gguf` — 4-bit quantized GGUF (~88 MB), the practical llama.cpp file
90
+
91
+ ## Notes
92
+
93
+ - Small model + limited-domain corpus: expect repetition on long generations; use
94
+ a repetition penalty and keep continuations short.
95
+ - Trained from scratch, so this is fully independent of any upstream Qwen weights.
96
+ The Qwen3 architecture/tokenizer are reused for compatibility.
chat_template.jinja ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if tools %}
2
+ {{- '<|im_start|>system\n' }}
3
+ {%- if messages[0].role == 'system' %}
4
+ {{- messages[0].content + '\n\n' }}
5
+ {%- endif %}
6
+ {{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
7
+ {%- for tool in tools %}
8
+ {{- "\n" }}
9
+ {{- tool | tojson }}
10
+ {%- endfor %}
11
+ {{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
12
+ {%- else %}
13
+ {%- if messages[0].role == 'system' %}
14
+ {{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
15
+ {%- endif %}
16
+ {%- endif %}
17
+ {%- for message in messages %}
18
+ {%- if message.content is string %}
19
+ {%- set content = message.content %}
20
+ {%- else %}
21
+ {%- set content = '' %}
22
+ {%- endif %}
23
+ {%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
24
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
25
+ {%- elif message.role == "assistant" %}
26
+ {{- '<|im_start|>' + message.role + '\n' + content }}
27
+ {%- if message.tool_calls %}
28
+ {%- for tool_call in message.tool_calls %}
29
+ {%- if (loop.first and content) or (not loop.first) %}
30
+ {{- '\n' }}
31
+ {%- endif %}
32
+ {%- if tool_call.function %}
33
+ {%- set tool_call = tool_call.function %}
34
+ {%- endif %}
35
+ {{- '<tool_call>\n{"name": "' }}
36
+ {{- tool_call.name }}
37
+ {{- '", "arguments": ' }}
38
+ {%- if tool_call.arguments is string %}
39
+ {{- tool_call.arguments }}
40
+ {%- else %}
41
+ {{- tool_call.arguments | tojson }}
42
+ {%- endif %}
43
+ {{- '}\n</tool_call>' }}
44
+ {%- endfor %}
45
+ {%- endif %}
46
+ {{- '<|im_end|>\n' }}
47
+ {%- elif message.role == "tool" %}
48
+ {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
49
+ {{- '<|im_start|>user' }}
50
+ {%- endif %}
51
+ {{- '\n<tool_response>\n' }}
52
+ {{- content }}
53
+ {{- '\n</tool_response>' }}
54
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
55
+ {{- '<|im_end|>\n' }}
56
+ {%- endif %}
57
+ {%- endif %}
58
+ {%- endfor %}
59
+ {%- if add_generation_prompt %}
60
+ {{- '<|im_start|>assistant\n' }}
61
+ {%- endif %}
config.json ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen3ForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": null,
8
+ "dtype": "float32",
9
+ "eos_token_id": 151645,
10
+ "head_dim": 128,
11
+ "hidden_act": "silu",
12
+ "hidden_size": 512,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 1408,
15
+ "layer_types": [
16
+ "full_attention",
17
+ "full_attention",
18
+ "full_attention",
19
+ "full_attention",
20
+ "full_attention",
21
+ "full_attention",
22
+ "full_attention",
23
+ "full_attention"
24
+ ],
25
+ "max_position_embeddings": 2048,
26
+ "max_window_layers": 28,
27
+ "model_type": "qwen3",
28
+ "num_attention_heads": 8,
29
+ "num_hidden_layers": 8,
30
+ "num_key_value_heads": 8,
31
+ "pad_token_id": 151643,
32
+ "rms_norm_eps": 1e-06,
33
+ "rope_parameters": {
34
+ "rope_theta": 10000.0,
35
+ "rope_type": "default"
36
+ },
37
+ "sliding_window": null,
38
+ "tie_word_embeddings": true,
39
+ "transformers_version": "5.13.0",
40
+ "use_cache": false,
41
+ "use_sliding_window": false,
42
+ "vocab_size": 151936,
43
+ "_name_or_path": "FuseLLM-112M"
44
+ }
generation_config.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "eos_token_id": [
4
+ 151645
5
+ ],
6
+ "output_attentions": false,
7
+ "output_hidden_states": false,
8
+ "pad_token_id": 151643,
9
+ "transformers_version": "5.13.0",
10
+ "use_cache": false
11
+ }
gguf/FuseLLM-112M.Q4_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a97a2cbfb373b092e12dc7de9d0c9a9f555962fe9f4a22fa124bffae930420db
3
+ size 91304832
gguf/FuseLLM-112M.fp16.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:94a71078a8e5379be43466f2889dbf6214ce2e2a110469deb4c78d4488ce71bf
3
+ size 229719424
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d3ebdb08b1e9f44ccf2bf768c7425bbb3971ecfd4f08fc59b5083b718a0d63fb
3
+ size 447532792
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:be75606093db2094d7cd20f3c2f385c212750648bd6ea4fb2bf507a6a4c55506
3
+ size 11422650
tokenizer_config.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": null,
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "<|im_end|>",
7
+ "errors": "replace",
8
+ "extra_special_tokens": [
9
+ "<|im_start|>",
10
+ "<|im_end|>",
11
+ "<|object_ref_start|>",
12
+ "<|object_ref_end|>",
13
+ "<|box_start|>",
14
+ "<|box_end|>",
15
+ "<|quad_start|>",
16
+ "<|quad_end|>",
17
+ "<|vision_start|>",
18
+ "<|vision_end|>",
19
+ "<|vision_pad|>",
20
+ "<|image_pad|>",
21
+ "<|video_pad|>"
22
+ ],
23
+ "is_local": false,
24
+ "local_files_only": false,
25
+ "model_max_length": 1010000,
26
+ "pad_token": "<|endoftext|>",
27
+ "split_special_tokens": false,
28
+ "tokenizer_class": "Qwen2Tokenizer",
29
+ "unk_token": null
30
+ }