Instructions to use netprojects/Granite-Vision-5.0-4B-LayerFit-MLX-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use netprojects/Granite-Vision-5.0-4B-LayerFit-MLX-4bit 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("netprojects/Granite-Vision-5.0-4B-LayerFit-MLX-4bit") config = load_config("netprojects/Granite-Vision-5.0-4B-LayerFit-MLX-4bit") # 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 netprojects/Granite-Vision-5.0-4B-LayerFit-MLX-4bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "netprojects/Granite-Vision-5.0-4B-LayerFit-MLX-4bit"
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": "netprojects/Granite-Vision-5.0-4B-LayerFit-MLX-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use netprojects/Granite-Vision-5.0-4B-LayerFit-MLX-4bit 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 "netprojects/Granite-Vision-5.0-4B-LayerFit-MLX-4bit"
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 netprojects/Granite-Vision-5.0-4B-LayerFit-MLX-4bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use netprojects/Granite-Vision-5.0-4B-LayerFit-MLX-4bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "netprojects/Granite-Vision-5.0-4B-LayerFit-MLX-4bit"
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 "netprojects/Granite-Vision-5.0-4B-LayerFit-MLX-4bit" \ --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"
Granite Vision 5.0 4B — LayerFit MLX 4-bit
NetProjects conversion of IBM Granite Vision 5.0 4B for Apple Silicon. It uses LayerFit mixed-bit quantization at a 4-bit language-weight budget with the vision tower and projectors excluded from quantization, and retains IBM's chat template byte-for-byte. The weight file is 3.25 GB.
This is a chart and table specialist, not a full-document layout pipeline. Verify any extracted numbers before using them downstream.
Run a chart extraction
Tested with mlx-vlm==0.7.11, mlx==0.32.4, and transformers==5.20.0. In this environment the processor did not automatically pick up the external Jinja template, so the example passes it explicitly.
from pathlib import Path
from mlx_vlm import generate, load
from mlx_vlm.utils import get_model_path
path = Path(get_model_path("netprojects/Granite-Vision-5.0-4B-LayerFit-MLX-4bit"))
model, processor = load(str(path))
messages = [{"role": "user", "content": [
{"type": "image"}, {"type": "text", "text": "<chart2csv>"}
]}]
prompt = processor.apply_chat_template(
messages, chat_template=(path / "chat_template.jinja").read_text(),
tokenize=False, add_generation_prompt=True,
)
result = generate(model, processor, prompt, image=["chart.jpg"],
temperature=0, max_tokens=1536, verbose=False)
print(result.text)
Use <tables_html> with a table image for HTML extraction.
Validation on Apple Silicon
- Exact BF16 output matches on IBM's example chart-to-CSV and table-to-HTML samples.
- 24 held-out ChartNet charts: 58.9% positional CSV cell accuracy, 4/24 exact, versus 54.4%, 4/24 exact for standard uniform 4-bit. One case was capped in each run. The mean is sensitive to alternate layouts: one chart's layout change accounts for most of the positional gain over uniform 4-bit. This is not IBM's published benchmark metric.
- 12 FinTabNetQA financial-table questions: 9/12 exact, versus 8/12 for uniform 4-bit, MLX 6-bit, and BF16. This small sample does not establish a general quality advantage.
- Peak MLX allocation on the chart run: 5.07 GB, versus 5.79 GB for 6-bit. This is not a minimum system RAM requirement.
This is the compact option. 6-bit remains the recommended default and 8-bit is the higher-precision option. For GGUF, use IBM's official builds.
Apache-2.0. Original checkpoint, processor, tokenizer and chat template by IBM Granite; MLX quantization by NetProjects. See LICENSE and IBM's model card for attribution.
- Downloads last month
- -
Quantized
Model tree for netprojects/Granite-Vision-5.0-4B-LayerFit-MLX-4bit
Base model
google/siglip2-so400m-patch16-384