Text Generation
Transformers
Safetensors
kestrel
titans
titans-mag
looped-transformer
small-language-model
conversational
custom_code
Instructions to use lillycham/Kestrel-34M-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lillycham/Kestrel-34M-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lillycham/Kestrel-34M-base", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("lillycham/Kestrel-34M-base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use lillycham/Kestrel-34M-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lillycham/Kestrel-34M-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lillycham/Kestrel-34M-base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/lillycham/Kestrel-34M-base
- SGLang
How to use lillycham/Kestrel-34M-base 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 "lillycham/Kestrel-34M-base" \ --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": "lillycham/Kestrel-34M-base", "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 "lillycham/Kestrel-34M-base" \ --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": "lillycham/Kestrel-34M-base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use lillycham/Kestrel-34M-base with Docker Model Runner:
docker model run hf.co/lillycham/Kestrel-34M-base
Download experiment.json from lillycham/Kestrel-34M-base: direct link, hf CLI and curl.
- Browser
- Download file 1.91 kB
-
https://huggingface.co/lillycham/Kestrel-34M-base/resolve/main/experiment.json
- Command line
-
hf download hf://lillycham/Kestrel-34M-base/experiment.json
-
curl -L -o experiment.json https://huggingface.co/lillycham/Kestrel-34M-base/resolve/main/experiment.json
1.91 kB
| { | |
| "config": { | |
| "model": { | |
| "vocab_size": 16384, | |
| "hidden_size": 512, | |
| "intermediate_size": 1408, | |
| "num_hidden_layers": 4, | |
| "num_attention_heads": 8, | |
| "num_key_value_heads": 2, | |
| "head_dim": 64, | |
| "max_position_embeddings": 1024, | |
| "tie_word_embeddings": true, | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "rms_norm_eps": 1e-06, | |
| "rope_theta": 10000.0, | |
| "memory_chunk_size": 64, | |
| "memory_hidden_size": 512, | |
| "memory_heads": 4, | |
| "memory_forget_bias": 0.0, | |
| "memory_min_forget": 0.02, | |
| "norm_attn_branch": true, | |
| "attention_window": 256, | |
| "prelude_layers": 1, | |
| "num_loops": 3, | |
| "coda_layers": 1 | |
| }, | |
| "train": { | |
| "steps": 25000, | |
| "batch_size": 8, | |
| "sequence_length": 1024, | |
| "gradient_accumulation": 4, | |
| "warmup_steps": 500, | |
| "decay_steps": 5000, | |
| "muon_lr": 0.02, | |
| "adamw_lr": 0.001, | |
| "weight_decay": 0.01, | |
| "clip_norm": 1.0, | |
| "eval_every": 250, | |
| "eval_batches": 16, | |
| "save_every": 1000, | |
| "keep_checkpoints": true, | |
| "seed": 42, | |
| "precision": "auto", | |
| "compile": true | |
| } | |
| }, | |
| "manifest": { | |
| "vocab_size": 16384, | |
| "splits": { | |
| "train": { | |
| "tokens": 556657192, | |
| "source_sha256": "e5982b166460561a6fe131e008c31304a6c204e44e54e740dd567ce9a01a0cc5", | |
| "sha256": "d1ea8a998855a65204941c99bf186697c5058962fe4b72551ac9674fdc81ac74" | |
| }, | |
| "validation": { | |
| "tokens": 5621083, | |
| "source_sha256": "3b088ec428aa77f60a3dd8d27130d8174da6aa6d55e7367469917f9c5adbb675", | |
| "sha256": "02e329833076ea8ddac414ebe82980211871a9a0199594a6770939d330dde329" | |
| } | |
| }, | |
| "tokenizer_sha256": "ffa31c767a673b10a4d4329db62c0bc937c965f2d3bbccfdaf1ee1f91cfbb4d5" | |
| }, | |
| "torch": "2.14.1+cu130", | |
| "device": "cuda", | |
| "precision": "bf16", | |
| "compile": true | |
| } | |