Instructions to use sabari2005/cyberslm-33m-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sabari2005/cyberslm-33m-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sabari2005/cyberslm-33m-instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sabari2005/cyberslm-33m-instruct") model = AutoModelForCausalLM.from_pretrained("sabari2005/cyberslm-33m-instruct") 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 sabari2005/cyberslm-33m-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sabari2005/cyberslm-33m-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sabari2005/cyberslm-33m-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sabari2005/cyberslm-33m-instruct
- SGLang
How to use sabari2005/cyberslm-33m-instruct 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 "sabari2005/cyberslm-33m-instruct" \ --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": "sabari2005/cyberslm-33m-instruct", "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 "sabari2005/cyberslm-33m-instruct" \ --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": "sabari2005/cyberslm-33m-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use sabari2005/cyberslm-33m-instruct with Docker Model Runner:
docker model run hf.co/sabari2005/cyberslm-33m-instruct
CyberSLM-33M-Instruct
Instruction-tuned version of
cyberslm-33m-base —
a 33.5M-parameter cybersecurity-focused small language model trained from
scratch, then supervised-finetuned on 24,980 cybersecurity Q&A
conversations with loss masking on assistant tokens only.
Architecture
Decoder-only transformer (Llama-style, loadable with LlamaForCausalLM):
384 hidden / 12 layers / 6 heads / SwiGLU 1024 / RMSNorm / RoPE θ=10,000 /
4096 context / 32k SentencePiece vocab / tied embeddings.
Total: 33,531,264 parameters.
Chat format
The model was finetuned with this template (built into tokenizer.chat_template):
<s>### User:
{question}
### Assistant:
{answer}</s>
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("sabari2005/cyberslm-33m-instruct")
model = AutoModelForCausalLM.from_pretrained("sabari2005/cyberslm-33m-instruct")
messages = [{"role": "user", "content": "Explain what a SQL injection attack is and how to prevent it."}]
ids = tok.apply_chat_template(messages, add_generation_prompt=True,
return_tensors="pt", add_special_tokens=False)
out = model.generate(ids, max_new_tokens=256, do_sample=True,
temperature=0.7, top_p=0.9, eos_token_id=3, pad_token_id=0)
print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True))
Note: the
<s>/</s>markers in the template are literal text (the SentencePiece vocab uses<bos>/<eos>pieces), matching exactly how the model was trained. Useapply_chat_templateand you don't need to think about it.
Training
- SFT on 24,980 cyber Q&A samples (multi-turn conversation format)
- 3 epochs, LR 2e-5 cosine, AdamW β=(0.9, 0.95), wd 0.01, loss on assistant tokens only
- Final val loss: 2.66
Limitations
33M parameters: strong at short cybersecurity explanations and Q&A; not suited for long-horizon reasoning, code generation, or general assistant duties. May hallucinate specifics (CVE numbers, tool flags) — verify facts. English only.
- Downloads last month
- -
Model tree for sabari2005/cyberslm-33m-instruct
Base model
sabari2005/cyberslm-33m-base