Bibek111/SajiloFit-FitnessAndNutrition-Qwen2.5-Finetuned
<!-- --- basemodel: Qwen/Qwen2.5-7B-Instruct libraryname: peft pipeline_tag: text-generation tags:
- qwen
- qwen2.5
- peft
- lora
- qlora
- fitness
- nutrition
- sajilofit ---
SajiloFit AI - Qwen2.5-7B-Instruct QLoRA Adapter
This repository contains the selected QLoRA/LoRA adapter for SajiloFit AI, a fitness and general nutrition assistant.
Base Model
Qwen/Qwen2.5-7B-Instruct
Selected Model
v13 checkpoint-40
The checkpoint was selected after evaluation against:
- Clean Qwen2.5-7B-Instruct base model
- SajiloFit v13 checkpoint-40
- SajiloFit v14-B checkpoint-5
Training
The adapter was trained using parameter-efficient fine-tuning (PEFT/QLoRA).
Main LoRA configuration:
- Rank: 16
- Alpha: 32
- Dropout: 0.05
- Target modules:
- q_proj
- k_proj
- v_proj
- o_proj
Intended Use
The model is intended for:
- General fitness questions
- Exercise explanations
- Workout creation
- Workout modification
- General nutrition information
- Basic nutrition calculations
- Fitness application assistance
Evaluation
The final external evaluation contained 200 questions:
- 100 structured evaluation questions
- 100 realistic user-style questions
The same questions were evaluated on three model variants, producing 600 responses in total.
v13 checkpoint-40 was selected as the final model.
Limitations
The model is not a replacement for a doctor, registered dietitian, physiotherapist, or other qualified professional.
Evaluation identified remaining limitations including:
- occasional nutrition arithmetic errors
- progression reasoning errors
- strict constraint-following errors
- some unsafe or inaccurate allergy and medical responses
The model should therefore not be considered medically validated.
Loading
This repository contains the PEFT adapter only.
Load the base model first:
Qwen/Qwen2.5-7B-Instruct
Then attach this adapter using PEFT.
-->
<!-- --- basemodel: Qwen/Qwen2.5-7B-Instruct libraryname: peft pipeline_tag: text-generation license: apache-2.0 language:
- en tags:
- qwen
- qwen2.5
- peft
- lora
- qlora
- fitness
- nutrition
- sajilofit --- -->
SajiloFit AI — Qwen2.5-7B-Instruct LoRA Adapter
This repository contains the selected PEFT LoRA adapter for SajiloFit AI, an English-language fitness and general nutrition assistant built on top of `Qwen/Qwen2.5-7B-Instruct`.
This is an adapter-only repository. It does not contain the complete Qwen2.5-7B model weights. To use it, load the Qwen base model first and then attach this adapter with PEFT.
Model details
During QLoRA training, the base model is loaded in a quantized form to reduce GPU-memory use while the LoRA parameters are trained. The uploaded artifact is a LoRA adapter and can be attached to either a normal BF16/FP16 base model or a compatible 4-bit base-model load.
Intended use
The adapter is intended to improve Qwen's behaviour for SajiloFit tasks, including:
- answering general fitness questions;
- explaining exercise technique;
- producing and modifying workout plans;
- respecting equipment, schedule and exercise constraints;
- explaining progression, recovery and exercise substitutions;
- providing general nutrition guidance and meal suggestions;
- interpreting verified nutrition values supplied by an application backend;
- asking for essential missing information instead of inventing precise values;
- responding cautiously to safety, medical and allergy-related questions; and
- explaining confirmed SajiloFit application results without claiming actions that did not occur.
The model is designed as one component of an application. Calculations, database operations, authentication, video analysis and plan-saving actions should be performed by trusted backend services. The model should explain their confirmed results rather than pretending to perform those operations itself.
Installation
Install PyTorch for your platform, followed by the required Hugging Face libraries:
pip install -U "transformers>=4.37" peft accelerate safetensorsFor 4-bit loading on a supported NVIDIA CUDA environment, also install BitsAndBytes:
pip install -U "bitsandbytes>=0.46.1"Recommended system prompt
Use the exact system_prompt.txt distributed with the adapter when it is available. A shorter compatible prompt is shown below for demonstration:
You are SajiloFit AI, an English-language fitness and general nutrition assistant. Follow the user's stated profile and constraints, preserve verified values exactly, and ask for essential missing information rather than inventing precise personal values. Do not claim to see videos, access accounts, save plans or complete application actions unless a confirmed backend result is supplied. Do not diagnose illness or replace a qualified healthcare professional. Escalate urgent warning signs appropriately.For reproducible comparisons, keep the system prompt, tokenizer, prompt template and generation configuration identical across the base model and adapter.
Usage: standard BF16/FP16 loading
Use this approach when the GPU has enough memory for the non-quantized base model.
from pathlib import Path
import torch
from huggingface_hub import hf_hub_download
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
BASE_MODEL = "Qwen/Qwen2.5-7B-Instruct"
ADAPTER_MODEL = "Bibek111/sajilofit-qwen2.5-7b-v13-ckpt40-lora"
tokenizer = AutoTokenizer.from_pretrained(
BASE_MODEL,
trust_remote_code=True,
)
if tokenizer.pad_token_id is None:
tokenizer.pad_token = tokenizer.eos_token
compute_dtype = (
torch.bfloat16
if torch.cuda.is_available() and torch.cuda.is_bf16_supported()
else torch.float16
)
base_model = AutoModelForCausalLM.from_pretrained(
BASE_MODEL,
torch_dtype=compute_dtype,
device_map="auto",
trust_remote_code=True,
)
model = PeftModel.from_pretrained(
base_model,
ADAPTER_MODEL,
is_trainable=False,
)
model.eval()
try:
prompt_path = hf_hub_download(
repo_id=ADAPTER_MODEL,
filename="system_prompt.txt",
)
SYSTEM_PROMPT = Path(prompt_path).read_text(encoding="utf-8").strip()
except Exception:
SYSTEM_PROMPT = (
"You are SajiloFit AI, an English-language fitness and general "
"nutrition assistant. Follow explicit constraints, preserve verified "
"values exactly, ask for essential missing information, and do not "
"provide medical diagnosis or invent application results."
)
def ask_sajilofit(question: str, max_new_tokens: int = 500) -> str:
messages = [
{"role": "system", "content": SYSTEM_PROMPT},
{"role": "user", "content": question},
]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
inputs = tokenizer(
prompt,
return_tensors="pt",
add_special_tokens=False,
).to(model.device)
with torch.inference_mode():
output = model.generate(
**inputs,
max_new_tokens=max_new_tokens,
do_sample=False,
repetition_penalty=1.0,
use_cache=True,
eos_token_id=tokenizer.eos_token_id,
pad_token_id=tokenizer.pad_token_id,
)
generated_ids = output[0, inputs["input_ids"].shape[1]:]
return tokenizer.decode(
generated_ids,
skip_special_tokens=True,
).strip()
answer = ask_sajilofit(
"Create a beginner three-day full-body routine using adjustable "
"dumbbells, with about 40 minutes available per workout."
)
print(answer)Usage: 4-bit loading
This version reduces GPU-memory use. BitsAndBytes 4-bit loading is primarily intended for a supported NVIDIA CUDA environment.
import torch
from peft import PeftModel
from transformers import (
AutoModelForCausalLM,
AutoTokenizer,
BitsAndBytesConfig,
)
BASE_MODEL = "Qwen/Qwen2.5-7B-Instruct"
ADAPTER_MODEL = "Bibek111/sajilofit-qwen2.5-7b-v13-ckpt40-lora"
assert torch.cuda.is_available(), "Use a CUDA GPU for this 4-bit example."
compute_dtype = (
torch.bfloat16
if torch.cuda.is_bf16_supported()
else torch.float16
)
quantization_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=compute_dtype,
bnb_4bit_use_double_quant=True,
)
tokenizer = AutoTokenizer.from_pretrained(
BASE_MODEL,
trust_remote_code=True,
)
if tokenizer.pad_token_id is None:
tokenizer.pad_token = tokenizer.eos_token
base_model = AutoModelForCausalLM.from_pretrained(
BASE_MODEL,
quantization_config=quantization_config,
device_map="auto",
torch_dtype=compute_dtype,
trust_remote_code=True,
)
model = PeftModel.from_pretrained(
base_model,
ADAPTER_MODEL,
is_trainable=False,
)
model.eval()
model.config.use_cache = True
model.config.eos_token_id = tokenizer.eos_token_id
model.config.pad_token_id = tokenizer.pad_token_id
messages = [
{
"role": "system",
"content": (
"You are SajiloFit AI, an English-language fitness and general "
"nutrition assistant. Follow constraints, preserve supplied "
"verified values, and do not invent missing information."
),
},
{
"role": "user",
"content": (
"My target range is 8 to 12 repetitions. I completed "
"12, 10 and 9 repetitions. Should I increase the weight?"
),
},
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
inputs = tokenizer(
text,
return_tensors="pt",
add_special_tokens=False,
).to(model.device)
with torch.inference_mode():
output = model.generate(
**inputs,
max_new_tokens=400,
do_sample=False,
repetition_penalty=1.0,
use_cache=True,
eos_token_id=tokenizer.eos_token_id,
pad_token_id=tokenizer.pad_token_id,
)
new_tokens = output[0, inputs["input_ids"].shape[1]:]
print(tokenizer.decode(new_tokens, skip_special_tokens=True).strip())Multi-turn conversation
Retain earlier messages when continuing a conversation:
messages = [
{"role": "system", "content": SYSTEM_PROMPT},
{
"role": "user",
"content": "I train twice per week and have adjustable dumbbells.",
},
{
"role": "assistant",
"content": "Understood. I will use two weekly sessions and dumbbells.",
},
{
"role": "user",
"content": "Correction: I can train three times per week.",
},
]The application should supply only relevant conversation history and confirmed profile data. Do not rely on the model to retrieve account information by itself.
Deterministic inference settings
The selected checkpoint was evaluated with deterministic decoding. Recommended settings are:
generation_settings = {
"do_sample": False,
"repetition_penalty": 1.0,
"max_new_tokens": 500,
"use_cache": True,
}Do not set temperature, top_p or top_k when do_sample=False. Use the same output-token budget when comparing different model variants.
Optional: merge the adapter
If a standalone merged model is required, load the base model in BF16 or FP16, attach the adapter and merge it. Avoid using a 4-bit-loaded base for this export step.
merged_model = model.merge_and_unload()
merged_model.save_pretrained(
"sajilofit-qwen2.5-7b-v13-ckpt40-merged",
safe_serialization=True,
)
tokenizer.save_pretrained(
"sajilofit-qwen2.5-7b-v13-ckpt40-merged"
)The merged model is much larger than the adapter and remains subject to the base model's licence and distribution requirements.
Training
The adapter was produced through parameter-efficient supervised fine-tuning using a QLoRA-style pipeline. Its purpose is not to teach the base model all fitness knowledge from scratch. Instead, the fine-tuning targets SajiloFit-specific behaviour, response structure, constraint following, safety boundaries and consistency.
Main LoRA configuration:
r: 16
lora_alpha: 32
lora_dropout: 0.05
bias: none
task_type: CAUSAL_LM
target_modules:
- q_proj
- k_proj
- v_proj
- o_projEvaluation — Base Qwen vs SajiloFit Fine-Tuned
Overall Result
SajiloFit fine-tuning produced the clearest improvements in evaluation loss, perplexity, token accuracy, and Top-5 token accuracy, showing stronger alignment with the expected fitness and nutrition response patterns.
The fine-tuned model maintained 100% verified-value preservation and the maximum 4.00/4 audited qualitative score, while nutrition arithmetic remained unchanged at 80%.
The main efficiency trade-off was lower token-generation throughput and a small increase in mean latency, although SajiloFit produced approximately 26% shorter responses and required essentially the same peak GPU memory as the base Qwen2.5-7B model.
Limitations
Known or possible limitations include:
- occasional nutrition arithmetic errors;
- mistakes in progression or recovery reasoning;
- failures on complex or competing constraints;
- inaccurate responses concerning allergies or medical conditions;
- sensitivity to system-prompt and generation-setting changes;
- possible repetition on prompts unlike the training distribution;
- no independent access to user profiles, databases or application state;
- no ability to inspect exercise videos unless analysis results are explicitly supplied; and
- English-focused training and evaluation.
The model should not be treated as medically validated or as a replacement for a doctor, registered dietitian, physiotherapist or other qualified professional.
Safety and application guidance
- Use deterministic decoding for tested production behaviour.
- Validate generated plans and calculations before presenting them as authoritative.
- Perform nutrition arithmetic in backend code and give the verified values to the model for explanation.
- Keep allergy and medical-risk responses conservative.
- Escalate urgent symptoms such as chest pressure, fainting, blue lips, stroke-like symptoms or severe breathing difficulty.
- Do not allow the model to claim that a plan was saved, an account was accessed or a backend operation succeeded without a confirmed application result.
- Log failures and conduct periodic human review using a frozen unseen evaluation set.
Repository files
A usable adapter repository normally includes:
adapter_config.json
adapter_model.safetensors
README.md
system_prompt.txt # recommended
tokenizer_config.json # optional if unchanged
tokenizer.json # optional if unchanged
special_tokens_map.json # optional if unchangedLicence
The base model is distributed under the Apache 2.0 licence. Users must also verify the licensing and permitted use of the fine-tuning data, adapter artifacts and any application data used with the model.
Citation
If you use this adapter, cite the SajiloFit project and the Qwen2.5 base model. A repository citation can be written as:
@misc{sapkota_sajilofit_v13,
author = {Bibek Sapkota},
title = {SajiloFit AI: Qwen2.5-7B-Instruct v13 Checkpoint-40 LoRA Adapter},
year = {2026},
howpublished = {Hugging Face model repository},
url = {https://huggingface.co/Bibek111/sajilofit-qwen2.5-7b-v13-ckpt40-lora}
}Disclaimer
This model is provided for research, educational and application-development purposes. Its output may be incomplete or incorrect. Users are responsible for appropriate validation, monitoring, safety controls and professional review before deployment.
