Image-Text-to-Text
MLX
Safetensors
inkling_mm_model
Mixture of Experts
multimodal
inkling
thinking-machines
conversational
Instructions to use pipenetwork/Inkling-MLX-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use pipenetwork/Inkling-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("pipenetwork/Inkling-MLX-4bit") config = load_config("pipenetwork/Inkling-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 pipenetwork/Inkling-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 "pipenetwork/Inkling-MLX-4bit"
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": "pipenetwork/Inkling-MLX-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use pipenetwork/Inkling-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 "pipenetwork/Inkling-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 pipenetwork/Inkling-MLX-4bit
Run Hermes
hermes
- OpenClaw new
How to use pipenetwork/Inkling-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 "pipenetwork/Inkling-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 "pipenetwork/Inkling-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"
| """Load a (possibly quantized) Inkling MLX model produced by ``convert_model``.""" | |
| from __future__ import annotations | |
| import glob | |
| import json | |
| import os | |
| import mlx.core as mx | |
| import mlx.nn as nn | |
| from mlx.utils import tree_flatten | |
| from .config import InklingConfig | |
| from .model import InklingForConditionalGeneration | |
| def quant_predicate(group_size: int, recipe: str = "uniform"): | |
| """Quantize exactly the modules the converter did, by delegating to | |
| ``convert.is_quant_target`` with the same ``recipe``. Guarantees the loaded | |
| module set matches the checkpoint (e.g. under ``experts_only``, attention and | |
| embed/unembed stay bf16 and must NOT be re-quantized here).""" | |
| from .convert import is_quant_target | |
| def pred(path, module): | |
| if not hasattr(module, "to_quantized"): | |
| return False | |
| w = getattr(module, "weight", None) | |
| if w is None: | |
| return False | |
| return is_quant_target(path + ".weight", w.shape[-1], group_size, recipe) | |
| return pred | |
| def load(path: str, lazy: bool = False): | |
| cfg_dict = json.load(open(os.path.join(path, "config.json"))) | |
| config = InklingConfig.from_dict(cfg_dict) | |
| model = InklingForConditionalGeneration(config) | |
| q = cfg_dict.get("quantization") | |
| if q: | |
| nn.quantize(model, group_size=q["group_size"], bits=q["bits"], | |
| class_predicate=quant_predicate(q["group_size"], q.get("recipe", "uniform"))) | |
| # Stream shards: assign each, then release its handle. We do NOT eagerly | |
| # mx.eval() the whole parameter tree — for a ~500 GB model that builds one | |
| # enormous eval graph and trips a Metal resource limit. Weights stay lazy | |
| # (mmap-backed) and materialize on demand during the forward pass, exactly | |
| # like mlx-lm loads large models. | |
| loaded = set() | |
| shards = sorted(glob.glob(os.path.join(path, "*.safetensors"))) | |
| for shard in shards: | |
| w = mx.load(shard) | |
| model.load_weights(list(w.items()), strict=False) | |
| if not lazy: | |
| # materialize THIS shard's tensors now (bounded graph) and keep them | |
| # resident. Avoids one enormous eval over all ~500 GB of params, which | |
| # trips a Metal resource limit; also prevents per-token disk paging. | |
| mx.eval(list(w.values())) | |
| loaded.update(w.keys()) | |
| del w | |
| expected = {k for k, _ in tree_flatten(model.parameters())} | |
| missing = expected - loaded | |
| if missing: | |
| raise ValueError(f"{len(missing)} params not found in checkpoint, e.g. {sorted(missing)[:3]}") | |
| model.eval() | |
| return model, config | |