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
|
Download README.md from micrictor/LFM2.5-350M-ShellAI: direct link, hf CLI and curl.
- Browser
- Download file 1.88 kB
-
https://huggingface.co/micrictor/LFM2.5-350M-ShellAI/resolve/main/README.md
- Command line
-
hf download hf://micrictor/LFM2.5-350M-ShellAI/README.md
-
curl -L -o README.md https://huggingface.co/micrictor/LFM2.5-350M-ShellAI/resolve/main/README.md
1.88 kB
| 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. | |