Image-Text-to-Text
Transformers
Safetensors
MLX
inkling2_loop
conversational
Mixture of Experts
4-bit precision
Instructions to use lmstudio-community/Inkling-2-Mini-MLX-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lmstudio-community/Inkling-2-Mini-MLX-8bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="lmstudio-community/Inkling-2-Mini-MLX-8bit") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("lmstudio-community/Inkling-2-Mini-MLX-8bit") model = AutoModelForMultimodalLM.from_pretrained("lmstudio-community/Inkling-2-Mini-MLX-8bit", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - MLX
How to use lmstudio-community/Inkling-2-Mini-MLX-8bit 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("lmstudio-community/Inkling-2-Mini-MLX-8bit") config = load_config("lmstudio-community/Inkling-2-Mini-MLX-8bit") # 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
- vLLM
How to use lmstudio-community/Inkling-2-Mini-MLX-8bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lmstudio-community/Inkling-2-Mini-MLX-8bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lmstudio-community/Inkling-2-Mini-MLX-8bit", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/lmstudio-community/Inkling-2-Mini-MLX-8bit
- SGLang
How to use lmstudio-community/Inkling-2-Mini-MLX-8bit with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "lmstudio-community/Inkling-2-Mini-MLX-8bit" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lmstudio-community/Inkling-2-Mini-MLX-8bit", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "lmstudio-community/Inkling-2-Mini-MLX-8bit" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lmstudio-community/Inkling-2-Mini-MLX-8bit", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Pi
How to use lmstudio-community/Inkling-2-Mini-MLX-8bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "lmstudio-community/Inkling-2-Mini-MLX-8bit"
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": "lmstudio-community/Inkling-2-Mini-MLX-8bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use lmstudio-community/Inkling-2-Mini-MLX-8bit with Docker Model Runner:
docker model run hf.co/lmstudio-community/Inkling-2-Mini-MLX-8bit
- Hermes Agent
How to use lmstudio-community/Inkling-2-Mini-MLX-8bit 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 "lmstudio-community/Inkling-2-Mini-MLX-8bit"
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 lmstudio-community/Inkling-2-Mini-MLX-8bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use lmstudio-community/Inkling-2-Mini-MLX-8bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "lmstudio-community/Inkling-2-Mini-MLX-8bit"
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 "lmstudio-community/Inkling-2-Mini-MLX-8bit" \ --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"
Download tokenizer_config.json from lmstudio-community/Inkling-2-Mini-MLX-8bit: direct link, hf CLI and curl.
- Browser
- Download file 10.1 kB
-
https://huggingface.co/lmstudio-community/Inkling-2-Mini-MLX-8bit/resolve/main/tokenizer_config.json
- Command line
-
hf download hf://lmstudio-community/Inkling-2-Mini-MLX-8bit/tokenizer_config.json
-
curl -L -o tokenizer_config.json https://huggingface.co/lmstudio-community/Inkling-2-Mini-MLX-8bit/resolve/main/tokenizer_config.json
10.1 kB
| { | |
| "backend": "tokenizers", | |
| "begin_of_text": "<|begin_of_text|>", | |
| "clean_up_tokenization_spaces": false, | |
| "content_image": "<|content_image|>", | |
| "content_invoke_tool_json": "<|content_invoke_tool_json|>", | |
| "content_invoke_tool_text": "<|content_invoke_tool_text|>", | |
| "content_model_end_sampling": "<|content_model_end_sampling|>", | |
| "content_text": "<|content_text|>", | |
| "content_thinking": "<|content_thinking|>", | |
| "content_tool_error": "<|content_tool_error|>", | |
| "content_xml": "<|content_xml|>", | |
| "end_message": "<|end_message|>", | |
| "endoftext": "<|endoftext|>", | |
| "eos_token": "<|content_model_end_sampling|>", | |
| "fix_mistral_regex": false, | |
| "is_local": true, | |
| "local_files_only": true, | |
| "message_model": "<|message_model|>", | |
| "message_system": "<|message_system|>", | |
| "message_tool": "<|message_tool|>", | |
| "message_user": "<|message_user|>", | |
| "model_max_length": 1048576, | |
| "model_specific_special_tokens": { | |
| "begin_of_text": "<|begin_of_text|>", | |
| "content_image": "<|content_image|>", | |
| "content_invoke_tool_json": "<|content_invoke_tool_json|>", | |
| "content_invoke_tool_text": "<|content_invoke_tool_text|>", | |
| "content_model_end_sampling": "<|content_model_end_sampling|>", | |
| "content_text": "<|content_text|>", | |
| "content_thinking": "<|content_thinking|>", | |
| "content_tool_error": "<|content_tool_error|>", | |
| "content_xml": "<|content_xml|>", | |
| "end_message": "<|end_message|>", | |
| "endoftext": "<|endoftext|>", | |
| "message_model": "<|message_model|>", | |
| "message_system": "<|message_system|>", | |
| "message_tool": "<|message_tool|>", | |
| "message_user": "<|message_user|>" | |
| }, | |
| "pad_token": "<|endoftext|>", | |
| "processor_class": "Inkling2Processor", | |
| "response_template": { | |
| "defaults": { | |
| "role": "assistant" | |
| }, | |
| "fields": { | |
| "content": { | |
| "close": "<|end_message|>", | |
| "content": "text", | |
| "content_args": { | |
| "strip": false | |
| }, | |
| "join": "", | |
| "open_pattern": "(?:<\\|message_model\\|>[^<]*)?<\\|content_(?:text|tool_error|invoke_tool_text)\\|>", | |
| "repeats": true | |
| }, | |
| "reasoning_content": { | |
| "close": "<|end_message|>", | |
| "content": "text", | |
| "content_args": { | |
| "strip": false | |
| }, | |
| "join": "", | |
| "open_pattern": "(?:<\\|message_model\\|>[^<]*)?<\\|content_thinking\\|>", | |
| "repeats": true | |
| }, | |
| "tool_calls": { | |
| "close": "<|end_message|>", | |
| "content": "json", | |
| "open_pattern": "(?:<\\|message_model\\|>[^<]*)?<\\|content_invoke_tool_json\\|>", | |
| "repeats": true, | |
| "transform": { | |
| "function": { | |
| "arguments": "{content.args}", | |
| "name": "{content.name}" | |
| }, | |
| "type": "function" | |
| } | |
| } | |
| }, | |
| "start_anchor_pattern": "<\\|end_message\\|>|<\\|content_model_end_sampling\\|>" | |
| }, | |
| "tokenizer_class": "TokenizersBackend", | |
| "chat_template": "{%- set effort_map = {\"none\": 0.0, \"minimal\": 0.1, \"low\": 0.2, \"medium\": 0.7, \"high\": 0.9, \"xhigh\": 0.99, \"max\": 0.99} -%}\n{%- set role_token = {\"user\": \"<|message_user|>\", \"assistant\": \"<|message_model|>\", \"system\": \"<|message_system|>\", \"tool\": \"<|message_tool|>\"} -%}\n\n{%- macro emit_thinking_effort() -%}\n {%- set eff = reasoning_effort if reasoning_effort is defined and reasoning_effort is not none else 0.9 -%}\n {%- if eff is string -%}\n {%- set key = eff | trim -%}\n {%- if key not in effort_map -%}\n {{- raise_exception(\"Unknown reasoning_effort: \" ~ eff) -}}\n {%- endif -%}\n {%- set num = effort_map[key] -%}\n {%- else -%}\n {%- set num = eff | float -%}\n {%- endif -%}\n {%- if num < 0.0 or num > 0.99 -%}\n {{- raise_exception(\"reasoning_effort must be in [0.0, 0.99]\") -}}\n {%- endif -%}\n {{- \"<|message_system|><|content_text|>Thinking effort level: \" -}}\n {%- if num == 0.0 -%}0{%- else -%}{{ num }}{%- endif -%}\n {{- \"<|end_message|>\" -}}\n{%- endmacro -%}\n\n{%- if tools -%}\n {%- set tool_state = namespace(specs=[]) -%}\n {%- for tool in tools -%}\n {%- set fn = tool.function if tool.function is defined else tool -%}\n {%- set spec = {\n \"description\": (fn.description if fn.description is defined and fn.description else \"\"),\n \"name\": fn.name,\n \"parameters\": (fn.parameters if fn.parameters is defined and fn.parameters else {}),\n \"type\": (tool.type if tool.type is defined and tool.type else \"function\"),\n } -%}\n {%- set tool_state.specs = tool_state.specs + [spec] -%}\n {%- endfor -%}\n {{- \"<|message_system|>tool_declare<|content_xml|>\" -}}\n {{- tool_state.specs | tojson(sort_keys=true, separators=(\",\", \":\")) -}}\n {{- \"<|end_message|>\" -}}\n{%- endif -%}\n\n{%- set state = namespace(effort_emitted=false) -%}\n{%- for message in messages -%}\n {%- if message.role not in role_token -%}\n {{- raise_exception(\"Unknown message role: \" ~ message.role) -}}\n {%- endif -%}\n {%- if not state.effort_emitted and message.role != \"system\" -%}\n {{- emit_thinking_effort() -}}\n {%- set state.effort_emitted = true -%}\n {%- endif -%}\n\n {%- set header = namespace(text=role_token[message.role]) -%}\n {%- if message.role == \"tool\" -%}\n {%- if message.name is defined and message.name -%}\n {%- set header.text = header.text ~ message.name -%}\n {%- elif message.tool_call_id is defined and message.tool_call_id -%}\n {%- for prev in messages -%}\n {%- if prev.role == \"assistant\" and prev.tool_calls -%}\n {%- for tc in prev.tool_calls -%}\n {%- if tc.id is defined and tc.id == message.tool_call_id and tc.function.name is defined -%}\n {%- set header.text = header.text ~ tc.function.name -%}\n {%- endif -%}\n {%- endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {%- endif -%}\n {%- elif message.role == \"assistant\" and message.name is defined and message.name -%}\n {%- set header.text = header.text ~ message.name -%}\n {%- endif -%}\n {%- set rtok = header.text -%}\n {%- set rendered -%}\n\n {%- if message.role == \"assistant\" and message.reasoning_content is defined and message.reasoning_content -%}\n {{- rtok ~ \"<|content_thinking|>\" ~ message.reasoning_content ~ \"<|end_message|>\" -}}\n {%- endif -%}\n\n {%- if message.content is string and (message.content or not (message.role == \"assistant\" and (message.tool_calls or message.reasoning_content))) -%}\n {{- rtok ~ \"<|content_text|>\" ~ message.content ~ \"<|end_message|>\" -}}\n {%- elif message.content -%}\n {%- for part in message.content -%}\n {%- if part is string -%}\n {{- rtok ~ \"<|content_text|>\" ~ part ~ \"<|end_message|>\" -}}\n {%- elif part.type is not defined or part.type in (\"text\", \"input_text\") -%}\n {%- set text_part = (part.text if part.text is defined and part.text is string else \"\") -%}\n {{- rtok ~ \"<|content_text|>\" ~ text_part ~ \"<|end_message|>\" -}}\n {%- elif part.type in (\"image\", \"input_image\", \"image_url\") -%}\n {%- if message.role not in (\"user\", \"tool\") -%}\n {{- raise_exception(\"Image content is only supported for user and tool messages\") -}}\n {%- endif -%}\n {{- rtok ~ \"<|content_image|><|unused_200054|><|end_message|>\" -}}\n {%- elif part.type in (\"audio\", \"input_audio\", \"audio_url\") -%}\n {{- raise_exception(\"Inkling 2 does not accept audio input\") -}}\n {%- else -%}\n {{- raise_exception(\"Unsupported content part type: \" ~ part.type) -}}\n {%- endif -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if message.role == \"assistant\" and message.tool_calls -%}\n {%- for tc in message.tool_calls -%}\n {%- set fn = tc.function -%}\n {%- if fn.name is not defined or fn.name is not string -%}\n {{- raise_exception(\"tool call function name must be a string\") -}}\n {%- endif -%}\n {%- if message.name is defined and message.name and message.name != fn.name -%}\n {{- raise_exception(\"assistant name \" ~ message.name ~ \" does not match its tool call \" ~ fn.name) -}}\n {%- endif -%}\n {%- set args = fn.arguments if fn.arguments is defined and fn.arguments else {} -%}\n {%- if args is string -%}\n {{- raise_exception(\"tool call arguments must be a parsed object, not a JSON string; canonicalize upstream\") -}}\n {%- endif -%}\n {%- if args is not mapping -%}\n {{- raise_exception(\"tool call arguments must be an object\") -}}\n {%- endif -%}\n {{- \"<|message_model|>\" ~ fn.name ~ \"<|content_invoke_tool_json|>\" -}}\n {{- '{\"name\":' ~ (fn.name | tojson(sort_keys=true, separators=(\",\", \":\"))) ~ ',\"args\":' -}}\n {{- \"{\" -}}\n {%- for key, value in args | dictsort(case_sensitive=true) -%}\n {{- (key | tojson) ~ \":\" ~ (value | tojson(separators=(\",\", \":\"))) -}}\n {%- if not loop.last -%},{%- endif -%}\n {%- endfor -%}\n {{- \"}}<|end_message|>\" -}}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if message.role == \"assistant\" -%}\n {{- \"<|content_model_end_sampling|>\" -}}\n {%- endif -%}\n {%- endset -%}\n {%- if message.role == \"assistant\" -%}\n {%- generation -%}{{- rendered -}}{%- endgeneration -%}\n {%- else -%}\n {{- rendered -}}\n {%- endif -%}\n{%- endfor -%}\n\n{%- if not state.effort_emitted -%}\n {{- emit_thinking_effort() -}}\n{%- endif -%}\n" | |
| } |