Instructions to use rtsh13/epigenetics-slm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use rtsh13/epigenetics-slm with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="rtsh13/epigenetics-slm", filename="slm.q4_k_m.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use rtsh13/epigenetics-slm with 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
- LM Studio
- Jan
- Ollama
How to use rtsh13/epigenetics-slm with Ollama:
ollama run hf.co/rtsh13/epigenetics-slm:Q4_K_M
- Unsloth Studio
How to use rtsh13/epigenetics-slm with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for rtsh13/epigenetics-slm to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for rtsh13/epigenetics-slm to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for rtsh13/epigenetics-slm to start chatting
- Pi
How to use rtsh13/epigenetics-slm with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf rtsh13/epigenetics-slm:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "rtsh13/epigenetics-slm:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use rtsh13/epigenetics-slm with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf rtsh13/epigenetics-slm:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default rtsh13/epigenetics-slm:Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use rtsh13/epigenetics-slm with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf rtsh13/epigenetics-slm:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "rtsh13/epigenetics-slm:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Docker Model Runner
How to use rtsh13/epigenetics-slm with Docker Model Runner:
docker model run hf.co/rtsh13/epigenetics-slm:Q4_K_M
- Lemonade
How to use rtsh13/epigenetics-slm with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull rtsh13/epigenetics-slm:Q4_K_M
Run and chat with the model
lemonade run user.epigenetics-slm-Q4_K_M
List all available models
lemonade list
license: llama3.2
base_model: unsloth/Llama-3.2-1B-Instruct
tags:
- llama
- lora
- qlora
- gguf
- health
- biological-age
- epigenetics
- rag
language:
- en
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)