Model Details
- Parameters: 16M (15.7M with tied embeddings, 12.6M without)
- Architecture: Qwen3, 8 layers, hidden size 384, 6 attention heads, 2 KV heads, head dim 64, SwiGLU MLP 1024
- Vocabulary: 8,192 tokens (custom BPE)
- Context length: 1024 tokens
- Language: English only
- Format: custom chat tags (
<|user|>, <|assistant|>, <|end|>)
- License: Apache 2.0
Usage
from transformers import AutoTokenizer, AutoModelForCausalLMimport torch model_path = "pvlabs/Hlupak-14M-Instruct" tokenizer = AutoTokenizer.from_pretrained(model_path)model = AutoModelForCausalLM.from_pretrained(model_path, dtype=torch.float16)model.eval() prompt = "<|user|>What is the capital of France?<|end|><|assistant|>"inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False) with torch.no_grad(): output = model.generate( **inputs, max_new_tokens=200, do_sample=True, temperature=0.5, top_k=40, top_p=0.9, eos_token_id=[tokenizer.convert_tokens_to_ids("<|end|>"), tokenizer.convert_tokens_to_ids("<|end_of_text|>")], pad_token_id=tokenizer.pad_token_id, ) # short factual questions work best, longer answers driftprint(tokenizer.decode(output[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
The bundled chat template builds the same prompt for you: tokenizer.apply_chat_template(messages, add_generation_prompt=True).
Avoid repetition penalties. They also penalise repeated digits, which breaks arithmetic.
Each turn is wrapped in a role tag and closed with <|end|>, with no newlines between turns:
<|user|>Your message here<|end|><|assistant|>
For multi-turn chats, add each previous reply as <|assistant|>reply<|end|> before the next <|user|> turn. The model stops by emitting <|end|>.
ONNX
onnx/model.onnx (fp32, 63 MB) and onnx/model_int8.onnx (dynamic int8, 26 MB) take an explicit KV cache:
- Inputs:
input_ids int64 [1, T], past_k and past_v float32 [8, 1, 2, P, 64] (use P = 0 for the first call)
- Outputs:
logits for the last position [1, 8192], present_k and present_v [8, 1, 2, P+T, 64]
The fp32 export matches the PyTorch model's outputs. The int8 export is smaller, but its longer answers differ noticeably from the original.
Limitations
- Very limited knowledge, and it often invents facts, names and dates
- Short answers only. Long replies repeat themselves or wander off topic
- English only. Not suited to code, real maths beyond small sums, or anything safety-critical
Made by PingVortex.