Instructions to use inferencerlabs/granite-vision-4.1-4b-MLX-Q9 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use inferencerlabs/granite-vision-4.1-4b-MLX-Q9 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("inferencerlabs/granite-vision-4.1-4b-MLX-Q9") config = load_config("inferencerlabs/granite-vision-4.1-4b-MLX-Q9") # 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 inferencerlabs/granite-vision-4.1-4b-MLX-Q9 with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "inferencerlabs/granite-vision-4.1-4b-MLX-Q9"
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": "inferencerlabs/granite-vision-4.1-4b-MLX-Q9" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use inferencerlabs/granite-vision-4.1-4b-MLX-Q9 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 "inferencerlabs/granite-vision-4.1-4b-MLX-Q9"
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 inferencerlabs/granite-vision-4.1-4b-MLX-Q9
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use inferencerlabs/granite-vision-4.1-4b-MLX-Q9 with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "inferencerlabs/granite-vision-4.1-4b-MLX-Q9"
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 "inferencerlabs/granite-vision-4.1-4b-MLX-Q9" \ --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"
Upload model file
Browse files- preprocessor_config.json +143 -0
preprocessor_config.json
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"crop_size": {
|
| 3 |
+
"height": 384,
|
| 4 |
+
"width": 384
|
| 5 |
+
},
|
| 6 |
+
"do_center_crop": true,
|
| 7 |
+
"do_convert_rgb": true,
|
| 8 |
+
"do_normalize": true,
|
| 9 |
+
"do_pad": true,
|
| 10 |
+
"do_rescale": true,
|
| 11 |
+
"do_resize": true,
|
| 12 |
+
"image_grid_pinpoints": [
|
| 13 |
+
[
|
| 14 |
+
384,
|
| 15 |
+
384
|
| 16 |
+
],
|
| 17 |
+
[
|
| 18 |
+
384,
|
| 19 |
+
768
|
| 20 |
+
],
|
| 21 |
+
[
|
| 22 |
+
384,
|
| 23 |
+
1152
|
| 24 |
+
],
|
| 25 |
+
[
|
| 26 |
+
384,
|
| 27 |
+
1536
|
| 28 |
+
],
|
| 29 |
+
[
|
| 30 |
+
384,
|
| 31 |
+
1920
|
| 32 |
+
],
|
| 33 |
+
[
|
| 34 |
+
384,
|
| 35 |
+
2304
|
| 36 |
+
],
|
| 37 |
+
[
|
| 38 |
+
384,
|
| 39 |
+
2688
|
| 40 |
+
],
|
| 41 |
+
[
|
| 42 |
+
384,
|
| 43 |
+
3072
|
| 44 |
+
],
|
| 45 |
+
[
|
| 46 |
+
384,
|
| 47 |
+
3456
|
| 48 |
+
],
|
| 49 |
+
[
|
| 50 |
+
384,
|
| 51 |
+
3840
|
| 52 |
+
],
|
| 53 |
+
[
|
| 54 |
+
768,
|
| 55 |
+
384
|
| 56 |
+
],
|
| 57 |
+
[
|
| 58 |
+
768,
|
| 59 |
+
768
|
| 60 |
+
],
|
| 61 |
+
[
|
| 62 |
+
768,
|
| 63 |
+
1152
|
| 64 |
+
],
|
| 65 |
+
[
|
| 66 |
+
768,
|
| 67 |
+
1536
|
| 68 |
+
],
|
| 69 |
+
[
|
| 70 |
+
768,
|
| 71 |
+
1920
|
| 72 |
+
],
|
| 73 |
+
[
|
| 74 |
+
1152,
|
| 75 |
+
384
|
| 76 |
+
],
|
| 77 |
+
[
|
| 78 |
+
1152,
|
| 79 |
+
768
|
| 80 |
+
],
|
| 81 |
+
[
|
| 82 |
+
1152,
|
| 83 |
+
1152
|
| 84 |
+
],
|
| 85 |
+
[
|
| 86 |
+
1536,
|
| 87 |
+
384
|
| 88 |
+
],
|
| 89 |
+
[
|
| 90 |
+
1536,
|
| 91 |
+
768
|
| 92 |
+
],
|
| 93 |
+
[
|
| 94 |
+
1920,
|
| 95 |
+
384
|
| 96 |
+
],
|
| 97 |
+
[
|
| 98 |
+
1920,
|
| 99 |
+
768
|
| 100 |
+
],
|
| 101 |
+
[
|
| 102 |
+
2304,
|
| 103 |
+
384
|
| 104 |
+
],
|
| 105 |
+
[
|
| 106 |
+
2688,
|
| 107 |
+
384
|
| 108 |
+
],
|
| 109 |
+
[
|
| 110 |
+
3072,
|
| 111 |
+
384
|
| 112 |
+
],
|
| 113 |
+
[
|
| 114 |
+
3456,
|
| 115 |
+
384
|
| 116 |
+
],
|
| 117 |
+
[
|
| 118 |
+
3840,
|
| 119 |
+
384
|
| 120 |
+
]
|
| 121 |
+
],
|
| 122 |
+
"image_mean": [
|
| 123 |
+
0.5,
|
| 124 |
+
0.5,
|
| 125 |
+
0.5
|
| 126 |
+
],
|
| 127 |
+
"image_processor_type": "LlavaNextImageProcessor",
|
| 128 |
+
"image_std": [
|
| 129 |
+
0.5,
|
| 130 |
+
0.5,
|
| 131 |
+
0.5
|
| 132 |
+
],
|
| 133 |
+
"processor_class": "Granite4VisionProcessor",
|
| 134 |
+
"auto_map": {
|
| 135 |
+
"AutoProcessor": "processing.Granite4VisionProcessor"
|
| 136 |
+
},
|
| 137 |
+
"resample": 3,
|
| 138 |
+
"rescale_factor": 0.00392156862745098,
|
| 139 |
+
"size": {
|
| 140 |
+
"height": 384,
|
| 141 |
+
"width": 384
|
| 142 |
+
}
|
| 143 |
+
}
|