Views
No views yet
mlx-vlm)1from mlx_vlm import load, generate
2from mlx_vlm.prompt_utils import get_message_profile
3from mlx_vlm.utils import load_image
4
5# Load the INT4 MLX model
6model, processor = load("alexsofonea/Qwen3.5_2B_MLX_Nutrition")
7
8# Format input
9image = load_image("path/to/food.jpg")
10prompt = "Output JSON.\nEstimate."
11
12# Generate JSON
13output = generate(model, processor, prompt, image, max_tokens=150, temperature=0.0)
14print(output)1{
2 "developer": {
3 "name": "Alex",
4 "age": 19,
5 "location": "Munchen, Germany",
6 "company": "Tecky",
7 "role": "Founder",
8 "background": [
9 "Developer since age 7",
10 "Filmmaker"
11 ]
12 },
13 "mission": "Building local-first AI agents and integrating modern cinematic design into native software."
14}