Text Generation
Transformers
Safetensors
English
qwen3_5
image-text-to-text
aging
longevity
biomedical
biology
qwen3.5
lora-merged
insilicomedicine
conversational
Instructions to use insilicomedicine/longevity-llm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use insilicomedicine/longevity-llm with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="insilicomedicine/longevity-llm") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("insilicomedicine/longevity-llm") model = AutoModelForMultimodalLM.from_pretrained("insilicomedicine/longevity-llm", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use insilicomedicine/longevity-llm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "insilicomedicine/longevity-llm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "insilicomedicine/longevity-llm", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/insilicomedicine/longevity-llm
- SGLang
How to use insilicomedicine/longevity-llm 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 "insilicomedicine/longevity-llm" \ --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": "insilicomedicine/longevity-llm", "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 "insilicomedicine/longevity-llm" \ --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": "insilicomedicine/longevity-llm", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use insilicomedicine/longevity-llm with Docker Model Runner:
docker model run hf.co/insilicomedicine/longevity-llm
Update README.md
Browse files
README.md
CHANGED
|
@@ -16,78 +16,57 @@ tags:
|
|
| 16 |
- insilicomedicine
|
| 17 |
language:
|
| 18 |
- en
|
| 19 |
-
model-index:
|
| 20 |
-
- name: longevity-llm
|
| 21 |
-
results:
|
| 22 |
-
- task:
|
| 23 |
-
type: text-generation
|
| 24 |
-
dataset:
|
| 25 |
-
name: LongeBench (aging clocks, methylation, proteomics, NHANES)
|
| 26 |
-
type: in-house
|
| 27 |
-
metrics:
|
| 28 |
-
- type: accuracy
|
| 29 |
-
value: 0.565
|
| 30 |
-
name: Classification avg accuracy (29 tasks)
|
| 31 |
-
- type: mae
|
| 32 |
-
value: 21.71
|
| 33 |
-
name: Regression avg MAE (8 tasks)
|
| 34 |
-
- type: jaccard
|
| 35 |
-
value: 0.510
|
| 36 |
-
name: Generation avg Jaccard (7 tasks)
|
| 37 |
---
|
| 38 |
|
| 39 |
# Longevity-LLM (L-LLM)
|
| 40 |
|
| 41 |
-
A domain-adapted **Qwen3.5-9B** for aging and longevity biology. L-LLM is
|
| 42 |
-
|
| 43 |
-
reasoning-augmented continuation pass
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
|
| 49 |
## Methods
|
| 50 |
|
| 51 |
L-LLM was built by LoRA fine-tuning Qwen3.5-9B, a 9B-parameter hybrid
|
| 52 |
transformer that interleaves Gated DeltaNet linear-attention layers with
|
| 53 |
-
standard self-attention in a 3:1 ratio.
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
1. **Continued pretraining**
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
2. **Supervised fine-tuning**
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
3
|
| 80 |
-
|
| 81 |
-
the 286K reasoning-augmented corpus, LR 3 × 10⁻⁵, 3% warmup, context
|
| 82 |
-
32,768 with example packing, effective BS 16.
|
| 83 |
|
| 84 |
All adapters targeted the 12 linear projections including the GatedDeltaNet
|
| 85 |
-
modules
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
stage), flash-attention 2 for self-attention layers.
|
| 91 |
|
| 92 |
## Example usage
|
| 93 |
|
|
|
|
| 16 |
- insilicomedicine
|
| 17 |
language:
|
| 18 |
- en
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
---
|
| 20 |
|
| 21 |
# Longevity-LLM (L-LLM)
|
| 22 |
|
| 23 |
+
A domain-adapted **Qwen3.5-9B** for aging and longevity biology. L-LLM is
|
| 24 |
+
the result of continued pretraining + supervised fine-tuning + a
|
| 25 |
+
reasoning-augmented continuation pass on a multi-domain corpus spanning
|
| 26 |
+
clinical aging, epigenomics, transcriptomics, proteomics, and genetics.
|
| 27 |
+
The two trained LoRA adapters were concatenated into a single rank-64 LoRA
|
| 28 |
+
and merged into the base weights to produce this standalone bf16
|
| 29 |
+
checkpoint.
|
| 30 |
|
| 31 |
## Methods
|
| 32 |
|
| 33 |
L-LLM was built by LoRA fine-tuning Qwen3.5-9B, a 9B-parameter hybrid
|
| 34 |
transformer that interleaves Gated DeltaNet linear-attention layers with
|
| 35 |
+
standard self-attention in a 3:1 ratio. Training data was assembled across
|
| 36 |
+
three main domains:
|
| 37 |
+
|
| 38 |
+
| Domain | Sources |
|
| 39 |
+
|---|---|
|
| 40 |
+
| Knowledge priors | UniProt protein/gene annotations, Gene Ontology, protein–protein interactions, pathway membership; published aging-clock formulas and CpG-site coefficients (Biolearn) |
|
| 41 |
+
| Clinical & epidemiology | NHANES (age, mortality) |
|
| 42 |
+
| Epigenomics | GEO DNA-methylation cohorts, CpG methylation profiles, aging-clock proxy tasks |
|
| 43 |
+
| Transcriptomics | GTEx (tissue age), TCGA (cancer survival), expression-profile generation |
|
| 44 |
+
| Proteomics | Olink plasma-proteomics panels, proteomic clock proxy tasks |
|
| 45 |
+
| Genetics & longevity | OpenGenes (expression directionality), SynergyAge (lifespan), CellAge (senescence), anti-aging target classification |
|
| 46 |
+
| Reasoning corpus | Prediction tasks augmented with frontier-model chain-of-thought traces |
|
| 47 |
+
|
| 48 |
+
Approximate scale across all domains: ≈10⁶ training prompts at the order of
|
| 49 |
+
several billion tokens total. Exact composition, prompt counts, and token
|
| 50 |
+
counts will be reported in the forthcoming preprint.
|
| 51 |
+
|
| 52 |
+
Training proceeded in three stages on Qwen3.5-9B:
|
| 53 |
+
|
| 54 |
+
1. **Continued pretraining** — knowledge priors only, raw text packed into
|
| 55 |
+
4,096-token blocks. Rank-32 LoRA with rsLoRA scaling, LR 2 × 10⁻⁵,
|
| 56 |
+
3 epochs.
|
| 57 |
+
2. **Supervised fine-tuning** — aging prediction tasks in conversation
|
| 58 |
+
format. Rank-32 LoRA initialized from the phase-1 adapter, standard α/r
|
| 59 |
+
scaling, LR 1 × 10⁻⁴, 3 epochs.
|
| 60 |
+
3. **Reasoning continuation** — continued the SFT adapter on the reasoning
|
| 61 |
+
corpus, LR 3 × 10⁻⁵, ≈1 epoch, context length 32,768 with example
|
| 62 |
+
packing.
|
|
|
|
|
|
|
| 63 |
|
| 64 |
All adapters targeted the 12 linear projections including the GatedDeltaNet
|
| 65 |
+
modules. After training, the CPT and continued-SFT adapters were
|
| 66 |
+
concatenated into a single rank-64 LoRA and merged into the base weights to
|
| 67 |
+
produce this checkpoint. DeepSpeed ZeRO-2 on 2× NVIDIA H100 NVL 94 GB,
|
| 68 |
+
bf16, flash-attention 2 on self-attention layers. Full details in the
|
| 69 |
+
forthcoming preprint.
|
|
|
|
| 70 |
|
| 71 |
## Example usage
|
| 72 |
|