Instructions to use lewisdog/lfm2.5-350m-cogs-ask with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lewisdog/lfm2.5-350m-cogs-ask with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lewisdog/lfm2.5-350m-cogs-ask") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("lewisdog/lfm2.5-350m-cogs-ask") model = AutoModelForCausalLM.from_pretrained("lewisdog/lfm2.5-350m-cogs-ask") 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 lewisdog/lfm2.5-350m-cogs-ask with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lewisdog/lfm2.5-350m-cogs-ask" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lewisdog/lfm2.5-350m-cogs-ask", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/lewisdog/lfm2.5-350m-cogs-ask
- SGLang
How to use lewisdog/lfm2.5-350m-cogs-ask 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 "lewisdog/lfm2.5-350m-cogs-ask" \ --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": "lewisdog/lfm2.5-350m-cogs-ask", "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 "lewisdog/lfm2.5-350m-cogs-ask" \ --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": "lewisdog/lfm2.5-350m-cogs-ask", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use lewisdog/lfm2.5-350m-cogs-ask with Docker Model Runner:
docker model run hf.co/lewisdog/lfm2.5-350m-cogs-ask
lfm2.5-350m-cogs-ask
A 350M ask student for Cogitarium retrieval-QA. Two tasks:
- decompose: split a question into 1-4 retrieval sub-questions โ
{"subquestions":[...]} - synth: answer strictly from provided wiki notes with inline
[note-id]citations โ{"answer","citations","abstained"}
Trained on the real cogs serialization โ slash note-ids (concepts/planner) and
[[wikilinks]] in note bodies โ plus frontier-teacher-distilled grounded Q&A
generated over the real vault. Correct on the deployment distribution; needs
no serving hacks.
Serving pins
- temperature 0, repeat_penalty 1.0.
- Emits exact slash note-ids and handles
[[wikilinks]]in bodies natively โ you do NOT need to strip wikilinks or fuzzy-match citations (both were required by the earlier hyphen-id variant). Feed evidence as `### [note-id] Title` exactly as `cogs ask` builds it. - Gate abstention upstream. The
abstainedflag is only moderately reliable; decide "is this answerable?" from retrieval score / the decompose step and don't depend on the field.
Eval (real vault serialization; grounded citation validity)
Distilled from ~600 frontier-teacher-generated grounded Q&A over the real vault (plus the re-serialized base set). Grounded-citation validity:
| set | decompose | grounded exact | grounded lenient | abstain |
|---|---|---|---|---|
| deployment vault (aoa, notes seen in training) | 100% | 89% | 89% | 6/11 |
| out-of-domain (unseen clusters) | 100% | 58% | 65% | 3/5 |
Progression as teacher data scaled (out-of-domain grounded strict): vault-aligned only 38% โ +204 teacher 50% โ +570 teacher 58%. On the vault it is actually trained over, grounded citation is ~89%. Data quality/quantity โ not model size โ was the binding constraint. Feed evidence as `### [note-id] Title
; citations come back as exact slash-ids, no serving hacks. Gate abstention upstream (the abstained` flag is only moderately reliable). A
strong fast tier; the Qwen3-1.7B student remains the quality tier.
Recommended quant: Q8_0 (379 MB, 509 tok/s on GB10). decompose is flawless at
any quant incl. Q4_K_M (229 MB).
Base model & license
Fine-tuned from LiquidAI/LFM2.5-350M. Use is governed by the LFM Open License
v1.0 (lfm1.0) โ see the LICENSE in the base repo. This derivative complies with
and inherits those terms; attribution to LiquidAI is retained above.
Provenance
LoRA SFT (TRL) on the Cogitarium distillation datasets, DGX Spark (GB10). Full
methodology, loss curves, eval harnesses and per-quant results: see the project
RESULTS.md. This is the "fast/small tier" of the Cogitarium model picker; the
Qwen3-1.7B students remain the quality tier.
- Downloads last month
- 1,005