Instructions to use Sharjeelbaig/ShaziLLM-1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Sharjeelbaig/ShaziLLM-1B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Sharjeelbaig/ShaziLLM-1B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Sharjeelbaig/ShaziLLM-1B") model = AutoModelForCausalLM.from_pretrained("Sharjeelbaig/ShaziLLM-1B") 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 Sharjeelbaig/ShaziLLM-1B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Sharjeelbaig/ShaziLLM-1B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Sharjeelbaig/ShaziLLM-1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Sharjeelbaig/ShaziLLM-1B
- SGLang
How to use Sharjeelbaig/ShaziLLM-1B 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 "Sharjeelbaig/ShaziLLM-1B" \ --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": "Sharjeelbaig/ShaziLLM-1B", "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 "Sharjeelbaig/ShaziLLM-1B" \ --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": "Sharjeelbaig/ShaziLLM-1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Sharjeelbaig/ShaziLLM-1B with Docker Model Runner:
docker model run hf.co/Sharjeelbaig/ShaziLLM-1B
ShaziLLM-1B
ShaziLLM-1B is a compact 1.08B-parameter instruction and reasoning language model designed for coding, structured instruction following, tool use, and local deployment. This repository contains the normal BF16 Transformers checkpoint.
For lower-memory CPU and browser inference, use ShaziLLM-1B-ONNX.
Quick start
pip install -U transformers torch accelerate
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Sharjeelbaig/ShaziLLM-1B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
dtype=torch.bfloat16,
device_map="auto",
)
messages = [{"role": "user", "content": "Write a Python function to merge two sorted lists."}]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
with torch.inference_mode():
output = model.generate(
**inputs,
max_new_tokens=256,
do_sample=False,
)
new_tokens = output[0, inputs.input_ids.shape[1]:]
print(tokenizer.decode(new_tokens, skip_special_tokens=True))
Model details
| Item | Value |
|---|---|
| Parameters | 1.08B |
| Layers | 24 |
| Hidden size | 1536 |
| Attention heads / KV heads | 16 / 2 |
| Vocabulary | 130,560 |
| Maximum configured context | 131,072 tokens |
| Weight format | BF16 Safetensors |
| Architecture | Llama-compatible causal language model |
The configured context limit is not a practical memory recommendation. Start with a much shorter context on low-memory hardware and increase it only after measuring KV-cache usage.
ShaziLLM alignment
The release received a focused identity-alignment and capability-retention pass before export. A rank-8 LoRA adapter targeting the query and value projections was trained for four epochs at a 1e-4 learning rate on 48 short examples, with 1,032,192 trainable parameters. The adapter was merged into the BF16 checkpoint. Validation probes covered model identity, arithmetic, coding, and factual recall.
Capabilities
- Code generation and debugging
- Instruction following and structured responses
- Reasoning-style responses
- XML-formatted tool calls through the included chat template
- English and Chinese text generation
Low-hardware deployment
The BF16 checkpoint requires roughly 2.1 GB for weights alone, plus runtime and KV-cache memory. The separate ONNX INT8 release reduces weight storage and CPU inference memory substantially. Limit context and generated-token counts on constrained devices.
Limitations
ShaziLLM-1B can hallucinate, produce incorrect code, and expose reasoning-like text. Do not treat its output as professional, security, legal, medical, or financial advice. Validate generated code before execution and isolate tool access behind deterministic authorization checks.
License and attribution
Released under Apache License 2.0; see LICENSE. ShaziLLM-1B is a fine-tuned derivative of OpenBMB/MiniCPM5-1B. The ShaziLLM name identifies this release and does not imply authorship of the upstream base architecture.
- Downloads last month
- 169