Health Food Classifier (GGUF)
A lightweight fine-tuned Llama-based language model that classifies foods as either Healthy or Unhealthy.
This model was trained on a custom food classification dataset using supervised fine-tuning and exported to GGUF format for compatibility with local inference tools like LM Studio and llama.cpp.
Model Details
- Base Architecture: LlamaForCausalLM
- Format: GGUF
- Quantization: Q4_K_M
- Intended Use: Educational/demo food classification model
- Inference Compatible With:
- LM Studio
- llama.cpp
- Ollama (with conversion)
- KoboldCpp
- Text Generation WebUI
Healthy Foods Dataset
Dataset:
healthyfoods
Healthy Foods Spaces
Spaces:
health_food_demo
The health_food_demo in spaces may not yeild better results as it is a quantized model.
Example Prompt
### Question:
Is Apples healthy or unhealthy?
### Answer:
Healthy
### Question:
Is French Fries healthy or unhealthy?
### Answer:
Unhealthy
LM Studio API Example
This model can be served locally using LM Studio's OpenAI-compatible API server.
Start the LM Studio server and load the model, then test it with:
curl http://localhost:1234/v1/completions \
-H "Content-Type: application/json" \
-d '{
"model": "health_food_demo-Q4_K_M",
"prompt": "Is Cucumber healthy or unhealthy?\n### Answer:\n",
"temperature": 0,
"top_p": 1,
"max_tokens": 5
}'
Example response:
{
"choices": [
{
"text": "Unhealthy"
}
]
}
Example Python Usage
from llama_cpp import Llama
llm = Llama(
model_path="health-food-demo-Q4_K_M.gguf",
n_ctx=2048,
)
prompt = '''
### Question:
Is Pizza healthy or unhealthy?
### Answer:
'''
output = llm(
prompt,
max_tokens=10,
stop=["<|endoftext|>"]
)
print(output["choices"][0]["text"])
Training
The model was fine-tuned on a custom dataset containing food-related prompts and labels.
Example training format:
### Question:
Is Salmon healthy or unhealthy?
### Answer:
Healthy
The training dataset included both healthy and unhealthy foods.
Files
Table with columns: File, Description| File | Description |
|---|
health_food_demo.gguf | Full precision GGUF model |
health_food_demo-Q4_K_M.gguf | Quantized Q4_K_M version for lower RAM usage |
README.md | Model documentation |
Recommended
Use:
health_food_demo-Q4_K_M.gguf
for:
- LM Studio
- llama.cpp
- low-memory local inference
Use:
for:
- highest quality inference
- further quantization
- experimentation
Notes
This is a small educational/demo model and should not be used for medical or nutritional advice.
License
MIT