Instructions to use micrictor/LFM2.5-350M-ShellAI with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use micrictor/LFM2.5-350M-ShellAI with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="micrictor/LFM2.5-350M-ShellAI") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("micrictor/LFM2.5-350M-ShellAI") model = AutoModelForCausalLM.from_pretrained("micrictor/LFM2.5-350M-ShellAI", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use micrictor/LFM2.5-350M-ShellAI with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "micrictor/LFM2.5-350M-ShellAI" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "micrictor/LFM2.5-350M-ShellAI", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/micrictor/LFM2.5-350M-ShellAI
- SGLang
How to use micrictor/LFM2.5-350M-ShellAI 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 "micrictor/LFM2.5-350M-ShellAI" \ --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": "micrictor/LFM2.5-350M-ShellAI", "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 "micrictor/LFM2.5-350M-ShellAI" \ --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": "micrictor/LFM2.5-350M-ShellAI", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use micrictor/LFM2.5-350M-ShellAI with Docker Model Runner:
docker model run hf.co/micrictor/LFM2.5-350M-ShellAI
File size: 1,878 Bytes
4666b42 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | ---
license: other
license_name: lfm1.0
base_model: LiquidAI/LFM2.5-350M
tags:
- lfm2
- distillation
- bash
- shellai
- transformers
---
# LFM2.5-350M-ShellAI
ShellAI Bash-command model distilled at the response level from
`LiquidAI/LFM2.5-2.6B` into `LiquidAI/LFM2.5-350M`.
This repository contains the merged BF16 training checkpoint.
The model is trained to emit exactly one command inside:
```text
<shellai-command>command</shellai-command>
```
General chat anchors, assistant-only loss, LoRA, one training epoch, early stopping,
and a pre-publication retention gate are used to reduce catastrophic forgetting.
No generated command was executed during dataset construction or evaluation.
## Distillation
The two models have different vocabularies (128K teacher versus 65,536 student),
so this uses sequence-level response distillation rather than token-logit KL.
Teacher candidates that fail the command envelope, primary-utility, or reference-
similarity gates fall back to the verified dataset reference.
## Evaluation
Held-out repository test split (300 examples, BF16 Transformers):
| Model | Exact | Utility match | Token F1 | Valid envelope |
|---|---:|---:|---:|---:|
| Base 350M | 5.7% | 23.0% | 0.225 | 100.0% |
| Distilled 350M | 4.0% | 39.7% | 0.305 | 100.0% |
Chat retention used 50 non-shell prompts: shell-envelope leakage remained 0.0%; anchor similarity retained 84.9% of baseline.
Q8_0 llama.cpp CPU test (same 50-example subset):
| Threads | Token F1 | Utility match | Median latency | Decode |
|---:|---:|---:|---:|---:|
| 1 | 0.268 | 36.0% | 1278 ms | 16.6 tok/s |
| 2 | 0.268 | 36.0% | 641 ms | 32.5 tok/s |
## License
This is a modified derivative of Liquid AI's LFM2.5 weights and is distributed
under the included LFM Open License v1.0. See `NOTICE` for modification details.
|