Instructions to use loll070303/one-apple-a-day-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use loll070303/one-apple-a-day-mlx with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # if on a CUDA device, also pip install mlx[cuda] # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("loll070303/one-apple-a-day-mlx") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use loll070303/one-apple-a-day-mlx with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "loll070303/one-apple-a-day-mlx" --prompt "Once upon a time"
One Apple a Day MLX
This repository contains a lightweight LoRA adapter for mlx-community/Qwen3.5-4B-MLX-4bit, fine-tuned for local MLX inference and low-token medical triage-style responses.
The project was designed around a simple idea: instead of making the model larger, make the response policy more efficient. The adapter pushes the base model toward short, structured, actionable outputs that are easier to run locally, easier to parse, and better suited for edge-oriented workflows.
Project Focus
This model was created as a local-first MLX experiment:
- LoRA fine-tuning performed locally;
- inference tested locally;
- target hardware: MacBook with M4 Pro and 24 GB unified memory;
- framework: MLX / mlx-lm;
- target behavior: concise emergency/triage-style clinical responses.
The goal is not long-form medical reasoning. The goal is a compact assistant that can produce a rapid first-pass clinical response with a predictable schema and a much smaller generation budget.
Why This Is Edge-Oriented
This adapter is designed for edge deployment experiments on Apple-device workflows:
- it is a small LoRA adapter rather than a full model checkpoint;
- it uses a 4-bit MLX base model;
- it encourages short generations;
- it uses a rigid response schema;
- it avoids long explanatory chains unless needed;
- it is intended for local inference rather than cloud inference.
The adapter file is approximately 1.8 MB. The base model remains external and is loaded from:
mlx-community/Qwen3.5-4B-MLX-4bit
This makes the release lightweight while keeping it tied to a reproducible MLX base model.
Response Format
The model is trained to produce compact clinical triage cards:
**Top Presumed Diagnosis:** [specific diagnosis]
**Immediate Next Steps:**
- [specific action]
- [specific action]
- [specific action]
The intended behavior is:
- identify the likely high-priority diagnosis;
- avoid generic filler;
- name concrete tests, treatments, or immediate actions;
- stay brief;
- minimize generated tokens.
Dataset Construction
The fine-tuning dataset was created from samples originating in previously tested medical datasets. These samples were rewritten/summarized into a standardized response format, then reviewed and corrected before training.
Each sample was shaped toward:
- a concise diagnostic reasoning style;
- a single top presumed diagnosis;
- a short list of immediate next steps;
- reduced verbosity;
- consistent formatting.
The final training format used chat-style messages with prompt masking, so the model was optimized mainly on the assistant response rather than on reproducing the system prompt or user case.
Training Setup
Training was performed locally with MLX / mlx-lm.
Key configuration:
model: mlx-community/Qwen3.5-4B-MLX-4bit
fine_tune_type: lora
data: data/manual_reviewed_messages
mask_prompt: true
iters: 1400
batch_size: 1
grad_accumulation_steps: 4
learning_rate: 0.000015
max_seq_length: 576
grad_checkpoint: true
lora_parameters:
keys: ["self_attn.q_proj", "self_attn.v_proj"]
rank: 8
scale: 16.0
dropout: 0.05
Hardware used:
MacBook with M4 Pro
24 GB unified memory
MLX / Apple Silicon local training
Benchmark Snapshot
Small internal benchmark: 6 emergency-style medical cases, comparing the base model with this LoRA adapter.
Generation limit:
max_tokens = 320
Measured output:
| Metric | Base model | Fine-tuned adapter | Change |
|---|---|---|---|
| Average generation time | 4.40s | 1.88s | 2.34x faster |
| Average output tokens | 311.3 | 84.8 | 72.8% fewer tokens |
| Average output words | 180.2 | 46.5 | 3.87x more compact |
Interpretation:
The fine-tuned adapter does not make the base model inherently faster per token. Instead, it makes the model generate far fewer tokens while preserving a useful triage-style answer structure. This is the core optimization target of the project.
Example Behavior
Input:
A 34-year-old marathon runner collapses at mile 22. He is confused and seizing.
Na+ is 118 mEq/L. He had been drinking large amounts of water throughout the race.
Expected style:
**Top Presumed Diagnosis:** Severe symptomatic hyponatremic encephalopathy
**Immediate Next Steps:**
- Administer hypertonic saline immediately.
- Give 100 mL of 3% NaCl bolus over 10 minutes for seizure or coma.
- Monitor serum sodium closely and avoid overly rapid correction.
Loading with MLX
from huggingface_hub import snapshot_download
from mlx_lm import load, generate
from mlx_lm.sample_utils import make_logits_processors, make_sampler
adapter_path = snapshot_download("loll070303/one-apple-a-day-mlx")
model, tokenizer = load(
"mlx-community/Qwen3.5-4B-MLX-4bit",
adapter_path=adapter_path,
)
prompt = """<|im_start|>system
You are an ER physician. Provide rapid, accurate, and highly specific clinical decisions.
RULES:
1. Objective data overrides subjective narrative.
2. Do not hallucinate.
3. NO GENERIC FILLER: name specific tests and medications.
4. Outside reasoning tags, output only diagnosis and immediate next steps.<|im_end|>
<|im_start|>user
A 45-year-old male with alcohol use disorder presents with confusion, ataxia, and ophthalmoplegia.<|im_end|>
<|im_start|>assistant
"""
sampler = make_sampler(temp=0.0)
logits_processors = make_logits_processors(
repetition_penalty=1.08,
repetition_context_size=128,
)
response = generate(
model=model,
tokenizer=tokenizer,
prompt=prompt,
max_tokens=320,
sampler=sampler,
logits_processors=logits_processors,
)
print(response)
Recommended Use Cases
This adapter is best suited for:
- local-first MLX demos;
- edge-oriented medical AI prototypes;
- rapid triage-style summarization;
- structured clinical response generation;
- low-token inference experiments;
- Apple Silicon local AI workflows.
It is not optimized for:
- long medical explanations;
- exhaustive differential diagnosis;
- autonomous medical decision-making;
- replacing professional clinical judgment.
Files
adapters.safetensors: final LoRA adapter weightsadapter_config.json: MLX adapter configurationlora.yaml: training configuration
Important Medical Disclaimer
This is an experimental research model. It is not a medical device. It is not certified for clinical use. It can make incorrect, incomplete, or unsafe medical suggestions.
The model may:
- miss important diagnoses;
- omit urgent management steps;
- produce incorrect medication or dosing suggestions;
- over-compress complex cases;
- perform poorly on rare or ambiguous presentations.
Do not use this model for autonomous diagnosis, treatment, emergency care, or clinical decision-making without review by a qualified healthcare professional.
This release is intended for research, prototyping, local AI experimentation, and evaluation of low-token medical response behavior with MLX.
- Downloads last month
- 64
Quantized
Model tree for loll070303/one-apple-a-day-mlx
Base model
Qwen/Qwen3.5-4B-Base