Run this model with HF Jobs
Run LiquidAI/LFM2-2.6B-Longevity on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/LiquidAI/LFM2-2.6B-Longevity. Ask me which dataset to train on, then push the LoRA adapter to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs and Transformers to run batch inference with https://huggingface.co/LiquidAI/LFM2-2.6B-Longevity on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the predictions back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs and Lighteval to evaluate https://huggingface.co/LiquidAI/LFM2-2.6B-Longevity. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/LiquidAI/LFM2-2.6B-Longevity with Transformers and bitsandbytes. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use LiquidAI/LFM2-2.6B-Longevity with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LiquidAI/LFM2-2.6B-Longevity with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LiquidAI/LFM2-2.6B-Longevity") 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("LiquidAI/LFM2-2.6B-Longevity") model = AutoModelForCausalLM.from_pretrained("LiquidAI/LFM2-2.6B-Longevity", 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 LiquidAI/LFM2-2.6B-Longevity with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LiquidAI/LFM2-2.6B-Longevity" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LiquidAI/LFM2-2.6B-Longevity", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LiquidAI/LFM2-2.6B-Longevity
- SGLang
How to use LiquidAI/LFM2-2.6B-Longevity 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 "LiquidAI/LFM2-2.6B-Longevity" \ --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": "LiquidAI/LFM2-2.6B-Longevity", "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 "LiquidAI/LFM2-2.6B-Longevity" \ --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": "LiquidAI/LFM2-2.6B-Longevity", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use LiquidAI/LFM2-2.6B-Longevity with Docker Model Runner:
docker model run hf.co/LiquidAI/LFM2-2.6B-Longevity
Update README.md
Browse files17 unmodified lines1819202122232425262728293031322 unmodified lines35363738394041424344454647484950518 unmodified lines6061626364656667686970717273747576777879808182838485868788899045 unmodified lines13613713813914014114214317 unmodified linesstyle="width: 100%; max-width: 100%; height: auto; display: inline-block; margin-bottom: 0.5em; margin-top: 0.5em;"/><div style="display: flex; justify-content: center; gap: 0.5em; margin-bottom: 1em;"><a href="https://playground.liquid.ai/"><strong>Try LFM</strong></a> •<a href="https://docs.liquid.ai/lfm/getting-started/welcome"><strong>Docs</strong></a> •<a href="https://leap.liquid.ai/"><strong>LEAP</strong></a> •<a href="https://discord.com/invite/liquid-ai"><strong>Discord</strong></a></div></div>## Longevity-LLM · LFM2-2.6B**Longevity-LLM (L-LLM)** is a family of compact, domain-adapted language models for interpreting heterogeneous aging biology data, available in two sizes:- [**LFM2-1.2B-Longevity**](https://huggingface.co/LiquidAI/LFM2-1.2B-Longevity/)- **LFM2-2.6B-Longevity** *(this model)*2 unmodified linesThe family was developed jointly by [**Insilico Medicine**](https://insilico.com) and [**Liquid AI**](https://www.liquid.ai) and accompanies the study "An Open Benchmark and Language Models for AI in Aging Biology" (Zhavoronkov et al., 2026).## 📄 Model details- **Base model**: [LiquidAI/LFM2-2.6B](https://huggingface.co/LiquidAI/LFM2-2.6B)- **Architecture**: Hybrid Liquid model with multiplicative gates and short convolutions.- **Context length**: 32,768 tokens**Training data**. The model was trained on the shared L-LLM corpus spanning aging biology. See [LongevityBench](https://huggingface.co/datasets/insilicomedicine/longebench) for more details.**Training procedure.** L-LFM2-2.6B was trained with full-parameter supervised fine-tuning. Prompts were formatted in ChatML with a dynamic-thinking template (user turns suffixed with `/think` or `/no_think` to select response mode at inference).We recommend using it for research on aging biology and omics interpretation. Outputs are model predictions, not clinical advice, and should be validated experimentally. Performance is strongest on the modalities represented in the training corpus.### Chat TemplateLFM2 uses a ChatML-like format. See the [Chat Template documentation](https://docs.liquid.ai/lfm/key-concepts/chat-template) for details. Example:8 unmodified linesYou can use [`tokenizer.apply_chat_template()`](https://huggingface.co/docs/transformers/en/chat_templating#using-applychattemplate) to format your messages automatically.### Tool UseLFM2.5 supports function calling in four steps:1. **Function definition**: Provide the list of tools as a JSON object in the system prompt, or use [`tokenizer.apply_chat_template()`](https://huggingface.co/docs/transformers/en/chat_extras#passing-tools) with `tools=...`.2. **Function call**: By default, LFM2 writes Pythonic function calls (a Python list between `<|tool_call_start|>` and `<|tool_call_end|>` special tokens), as the assistant answer. You can override this behavior by asking the model to output JSON function calls in the system prompt.3. **Function execution**: Execute the call and return the result with the `tool` role.4. **Final answer**: LFM2 interprets the tool output and returns a plain-text answer addressing the original prompt.See the [Tool Use documentation](https://docs.liquid.ai/lfm/key-concepts/tool-use) for the full guide. Example:```<|startoftext|><|im_start|>systemList of tools: [{"name": "get_candidate_status", "description": "Retrieves the current status of a candidate in the recruitment process", "parameters": {"type": "object", "properties": {"candidate_id": {"type": "string", "description": "Unique identifier for the candidate"}}, "required": ["candidate_id"]}}]<|im_end|><|im_start|>userWhat is the current status of candidate ID 12345?<|im_end|><|im_start|>assistant<|tool_call_start|>[get_candidate_status(candidate_id="12345")]<|tool_call_end|>Checking the current status of candidate ID 12345.<|im_end|><|im_start|>tool[{"candidate_id": "12345", "status": "Interview Scheduled", "position": "Clinical Research Associate", "date": "2023-11-20"}]<|im_end|><|im_start|>assistantThe candidate with ID 12345 is currently in the "Interview Scheduled" stage for the position of Clinical Research Associate, with an interview date set for 2023-11-20.<|im_end|>```## 🏃 InferenceLFM2 is supported by many inference frameworks. See the [Inference documentation](https://docs.liquid.ai/lfm/inference/transformers) for the full list.45 unmodified linesprint(tokenizer.decode(output[0], skip_special_tokens=False))```## 📬 Contact- Got questions or want to connect? [Join our Discord community](https://discord.com/invite/liquid-ai)- If you are interested in custom solutions with edge deployment, please contact [our sales team](https://www.liquid.ai/contact).17 unmodified lines181920212223242526272829302 unmodified lines333435363738394041424344454647488 unmodified lines575859606162636445 unmodified lines11011111211311411511611711811917 unmodified linesstyle="width: 100%; max-width: 100%; height: auto; display: inline-block; margin-bottom: 0.5em; margin-top: 0.5em;"/><div style="display: flex; justify-content: center; gap: 0.5em; margin-bottom: 1em;"><a href="https://docs.liquid.ai/lfm/getting-started/welcome"><strong>Docs</strong></a> •<a href="https://discord.com/invite/liquid-ai"><strong>Discord</strong></a></div></div>## Longevity-LLM - LFM2-2.6B**Longevity-LLM (L-LLM)** is a family of compact, domain-adapted language models for interpreting heterogeneous aging biology data. Longevity LFMs are available in two sizes:- [**LFM2-1.2B-Longevity**](https://huggingface.co/LiquidAI/LFM2-1.2B-Longevity/)- **LFM2-2.6B-Longevity** *(this model)*2 unmodified linesThe family was developed jointly by [**Insilico Medicine**](https://insilico.com) and [**Liquid AI**](https://www.liquid.ai) and accompanies the study "An Open Benchmark and Language Models for AI in Aging Biology" (Zhavoronkov et al., 2026).## Model details- **Base model**: [LiquidAI/LFM2-2.6B](https://huggingface.co/LiquidAI/LFM2-2.6B)- **Architecture**: Hybrid Liquid model with multiplicative gates and short convolutions.- **Context length**: 32,768 tokens- **Language**: English**Training data**. The model was trained on the shared L-LLM corpus spanning aging biology. See [LongevityBench](https://huggingface.co/datasets/insilicomedicine/longebench) for more details.**Training procedure.** L-LFM2-2.6B was trained with full-parameter supervised fine-tuning. Prompts were formatted in ChatML with a dynamic-thinking template (user turns suffixed with `/think` or `/no_think` to select response mode at inference).### Chat TemplateLFM2 uses a ChatML-like format. See the [Chat Template documentation](https://docs.liquid.ai/lfm/key-concepts/chat-template) for details. Example:8 unmodified linesYou can use [`tokenizer.apply_chat_template()`](https://huggingface.co/docs/transformers/en/chat_templating#using-applychattemplate) to format your messages automatically.## InferenceLFM2 is supported by many inference frameworks. See the [Inference documentation](https://docs.liquid.ai/lfm/inference/transformers) for the full list.45 unmodified linesprint(tokenizer.decode(output[0], skip_special_tokens=False))```## Intended use and limitationsIntended for research on aging biology and omics interpretation. Outputs are model predictions, not clinical advice, and should be validated experimentally. Performance is strongest on the modalities represented in the training corpus.## Contact- Got questions or want to connect? [Join our Discord community](https://discord.com/invite/liquid-ai)- If you are interested in custom solutions with edge deployment, please contact [our sales team](https://www.liquid.ai/contact).
README.md+8-32