How to use from
Pi
Start the MLX server
# Install MLX LM:
uv tool install mlx-lm
# Start a local OpenAI-compatible server:
mlx_lm.server --model "alexsofonea/Qwen3.5_2B_MLX_Nutrition"
Configure the model in Pi
# Install Pi:
npm install -g @earendil-works/pi-coding-agent
# Add to ~/.pi/agent/models.json:
{
  "providers": {
    "mlx-lm": {
      "baseUrl": "http://localhost:8080/v1",
      "api": "openai-completions",
      "apiKey": "none",
      "models": [
        {
          "id": "alexsofonea/Qwen3.5_2B_MLX_Nutrition"
        }
      ]
    }
  }
}
Run Pi
# Start Pi in your project directory:
pi
Quick Links

Qwen3.5 Nutrition Finte Tune

This is a highly specialized, local-first Vision-Language Model (VLM) designed to estimate nutritional macros and physical weight from images of food. The model is fine-tuned to output strict, minified JSON payloads containing calories, macros (protein, fat, carbohydrates), and estimated dry/physical weight in grams.

It has been natively converted to Apple's MLX format and quantized to 4-bit (INT4), reducing its memory footprint to roughly ~1.5GB. This allows for lightning-fast, entirely offline, on-device inference on Apple Silicon hardware (macOS, iOS, iPadOS) using the Neural Engine.

  • Base Architecture: Qwen3.5-2B (Omni/Unified Vision-Language architecture)
  • Framework: MLX (mlx-vlm)
  • Quantization: INT4 (4-bit)
  • Fine-Tuning Method: LoRA (via Unsloth), merged to 16-bit prior to MLX conversion.
  • Primary Task: Multimodal Image-to-JSON parsing.

Intended Use

  • Primary Use Case: Seamless integration into native Swift/Apple ecosystem applications requiring on-device visual food analysis without relying on cloud APIs.
  • Input: A user prompt (e.g. food description) + a standard RGB food image.
  • Output: A standardized JSON schema containing absolute nutritional values.

Training Data & Credit

This model was fine-tuned on a custom dataset synthesized from a massive corpus of recipe data and user-uploaded images.

  • Dataset Source: Modified from the Food.com Recipes and Reviews dataset. The text macros were mathematically processed to derive estimated physical weights, combined with dynamically downloaded web images, and formatted into an OpenAI-style JSONL conversation structure.
  • Dataset License: Public Domain (CC0)

Licensing & Attribution

  • Model License: Apache License 2.0 (Inherited from the Qwen 3.5 2B base model).
  • Attribution: All base architectural credit belongs to the Qwen team at Alibaba Cloud.

Usage Example (MLX)

from mlx_vlm import load, generate
from mlx_vlm.prompt_utils import get_message_profile
from mlx_vlm.utils import load_image

# Load the INT4 MLX model
model, processor = load("alexsofonea/Qwen3.5_2B_MLX_Nutrition")

# Format input
image = load_image("path/to/food.jpg")
prompt = "Output JSON.\nEstimate."

# Generate JSON
output = generate(model, processor, prompt, image, max_tokens=150, temperature=0.0)
print(output)

About Developer

{
  "developer": {
    "name": "Alex",
    "age": 19,
    "location": "Munchen, Germany",
    "company": "Tecky",
    "role": "Founder",
    "background": [
      "Developer since age 7",
      "Filmmaker"
    ]
  },
  "mission": "Building local-first AI agents and integrating modern cinematic design into native software."
}

Contact:

Downloads last month
11
Safetensors
Model size
2B params
Tensor type
U32
BF16
F32
MLX
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 alexsofonea/Qwen3.5_2B_MLX_Nutrition

Finetuned
Qwen/Qwen3.5-2B
Quantized
(189)
this model