Image-Text-to-Text
MLX
Safetensors
English
qwen3_5
qwen3.5
nutrition
food.com
conversational
4-bit precision
Instructions to use alexsofonea/Qwen3.5_2B_MLX_Nutrition with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use alexsofonea/Qwen3.5_2B_MLX_Nutrition with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("alexsofonea/Qwen3.5_2B_MLX_Nutrition") config = load_config("alexsofonea/Qwen3.5_2B_MLX_Nutrition") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use alexsofonea/Qwen3.5_2B_MLX_Nutrition with 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 @mariozechner/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
- Hermes Agent new
How to use alexsofonea/Qwen3.5_2B_MLX_Nutrition with Hermes Agent:
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 Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default alexsofonea/Qwen3.5_2B_MLX_Nutrition
Run Hermes
hermes
- OpenClaw new
How to use alexsofonea/Qwen3.5_2B_MLX_Nutrition with OpenClaw:
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 OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "alexsofonea/Qwen3.5_2B_MLX_Nutrition" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
| language: en | |
| tags: | |
| - mlx | |
| - qwen3.5 | |
| - nutrition | |
| - food.com | |
| pipeline_tag: image-text-to-text | |
| library_name: mlx | |
| license: apache-2.0 | |
| base_model: | |
| - Qwen/Qwen3.5-2B | |
| # 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](https://huggingface.co/Qwen) (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](https://www.kaggle.com/datasets/irkaal/foodcom-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](https://www.apache.org/licenses/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) | |
| ```python | |
| 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 | |
| ```JSON | |
| { | |
| "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: | |
| - [alex@alexsofonea.com](mailto:alex@alexsofonea.com) | |
| - [LinkedIn](https://www.linkedin.com/in/alexsofonea/) | |
| - [Website](https://alexsofonea.com) | |