How to use from
llama.cpp
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf rtsh13/epigenetics-slm:Q4_K_M
# Run inference directly in the terminal:
llama cli -hf rtsh13/epigenetics-slm:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf rtsh13/epigenetics-slm:Q4_K_M
# Run inference directly in the terminal:
llama cli -hf rtsh13/epigenetics-slm:Q4_K_M
Use pre-built binary
# Download pre-built binary from:
# https://github.com/ggerganov/llama.cpp/releases
# Start a local OpenAI-compatible server with a web UI:
./llama-server -hf rtsh13/epigenetics-slm:Q4_K_M
# Run inference directly in the terminal:
./llama-cli -hf rtsh13/epigenetics-slm:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
cmake -B build
cmake --build build -j --target llama-server llama-cli
# Start a local OpenAI-compatible server with a web UI:
./build/bin/llama-server -hf rtsh13/epigenetics-slm:Q4_K_M
# Run inference directly in the terminal:
./build/bin/llama-cli -hf rtsh13/epigenetics-slm:Q4_K_M
Use Docker
docker model run hf.co/rtsh13/epigenetics-slm:Q4_K_M
Quick Links

epigenetics-slm

A Llama 3.2 1B Instruct model fine-tuned via QLoRA to generate five-category epigenetic health assessments from wearable/biomarker data, grounded in a Bio-RAG evidence retrieval pipeline.

Given a patient's biomarkers (HbA1c, NLR, circadian rest-activity metrics, sleep architecture, CosinorAge acceleration) and retrieved evidence chunks, the model produces a structured report with five sections: AGING, STRESS, METABOLISM, INFLAMMATION, SLEEP — each citing the evidence it was given.

Files in this repo

File Description
slm.q4_k_m.gguf Quantized model (q4_k_m), ~771MB, for CPU inference via llama-cpp-python
slm_lora/ Full LoRA adapter + tokenizer + all training checkpoints (100–1491 steps), with optimizer/scheduler state for resuming training
chroma_db/ Populated Bio-RAG vector store (47 chunks, all-MiniLM-L6-v2 embeddings) — required alongside the model for grounded generation

Training details

  • Base model: unsloth/llama-3.2-1b-instruct-unsloth-bnb-4bit
  • Method: QLoRA via Unsloth + TRL SFTTrainer
  • Trainable params: 11.2M / 1.25B (0.90%)
  • Dataset: 4,415 examples derived from NHANES 2011-2012 biomarkers + Bio-RAG evidence (3,973 train / 442 eval)
  • Epochs: 3 (1,491 steps), effective batch size 8
  • Hardware: RTX 4070 Laptop GPU (8GB VRAM), WSL2 Ubuntu 22.04
  • Precision: bf16 training, fp32 LoRA adapter weights

Eval results (442-row held-out split)

Metric Score
Category coverage (all 5 headers present) 99.8%
Classification match rate 98.5%
ROUGE-L 0.822

These metrics check structural adherence (all five sections present) and classification-label accuracy against the training data's target responses. They do not measure citation faithfulness — see Limitations.

Usage

Requires the model to be prompted via the exact training-time template (see slm_prompt.py in the source repo for the canonical build_prompt()/build_inference_prompt() functions — byte-identical prompt formatting between training and inference is required for output quality).

from llama_cpp import Llama

llm = Llama(model_path="slm.q4_k_m.gguf", n_ctx=4096, verbose=False)

# prompt must be built via build_prompt() + build_inference_prompt()
# from the source repo — see link above
out = llm(prompt, max_tokens=512, temperature=0.2, stop=["<|eot_id|>"])
print(out["choices"][0]["text"])

For full end-to-end usage (XGBoost baseline + Bio-RAG retrieval + this SLM), see scripts/demo.py in the source repo.

Limitations

  • Requires Bio-RAG evidence to ground citations. When run without retrieved evidence chunks (empty RAG context), the model fabricates plausible-sounding but nonexistent citations (invented author names, journals, and DOIs). Always pass real retrieved evidence chunks.
  • Citation precision, not just presence. Even with real evidence available, the model sometimes reuses the same citation pair across multiple report sections rather than mapping each specific claim to its most relevant source chunk. This is an attribution-precision issue, not fabrication.
  • 1B parameter model. Domain-specific acronym/definition accuracy (e.g. circadian rest-activity metrics) is not guaranteed to be robust; spot-check outputs before use in any downstream decision-making context.
  • Not a medical device. This is a research/prototype system trained on NHANES survey data. Outputs should not be used for clinical decision-making.

Source code

Training, export, and evaluation pipeline: github.com/rtsh13/epigenetics-slm (branch feat/week7-slm-finetuning)

Downloads last month
15
GGUF
Model size
1B params
Architecture
llama
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for rtsh13/epigenetics-slm

Adapter
(409)
this model

Space using rtsh13/epigenetics-slm 1