Image-Text-to-Text
MLX
Safetensors
English
pixtral
apple-silicon
multimodal
vision-language
llava
quantized
6bit
conversational
6-bit
Instructions to use mlx-community/Apriel-1.5-15b-Thinker-6bit-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/Apriel-1.5-15b-Thinker-6bit-MLX 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("mlx-community/Apriel-1.5-15b-Thinker-6bit-MLX") config = load_config("mlx-community/Apriel-1.5-15b-Thinker-6bit-MLX") # 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 mlx-community/Apriel-1.5-15b-Thinker-6bit-MLX with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "mlx-community/Apriel-1.5-15b-Thinker-6bit-MLX"
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": "mlx-community/Apriel-1.5-15b-Thinker-6bit-MLX" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use mlx-community/Apriel-1.5-15b-Thinker-6bit-MLX 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 "mlx-community/Apriel-1.5-15b-Thinker-6bit-MLX"
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 mlx-community/Apriel-1.5-15b-Thinker-6bit-MLX
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use mlx-community/Apriel-1.5-15b-Thinker-6bit-MLX with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "mlx-community/Apriel-1.5-15b-Thinker-6bit-MLX"
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 "mlx-community/Apriel-1.5-15b-Thinker-6bit-MLX" \ --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"
| { | |
| "chat_template": "{%- set available_tools_string, thought_instructions, add_tool_id, tool_output_format = '', '', true, \"default\" -%}\n\n{%- if tools is not none and tools|length > 0 -%}\n {%- set available_tools_string -%}\nYou are provided with function signatures within <available_tools></available_tools> XML tags. You may call one or more functions to assist with the user query. Don't make assumptions about the arguments. You should infer the argument values from previous user responses and the system message. Here are the available tools:\n<available_tools>\n{% for tool in tools %}\n{{ tool|string }}\n{% endfor %}\n</available_tools>\n{%- endset -%}\n{%- endif -%}\n{%- if tool_output_format is none or tool_output_format == \"default\" -%}\n{%- set tool_output_instructions -%}\nReturn all function calls as a list of json objects within <tool_call></tool_call> XML tags. Each json object should contain a function name and arguments as follows:\n<tool_calls>[{\"name\": <function-name-1>, \"arguments\": <args-dict-1>}, {\"name\": <function-name-2>, \"arguments\": <args-dict-2>},...]</tool_calls>\n{%- endset -%}\n{%- elif tool_output_format == \"yaml\" -%}\n{%- set tool_output_instructions -%}\nReturn all function calls as a list of yaml objects within <tool_call></tool_call> XML tags. Each yaml object should contain a function name and arguments as follows:\n<tool_calls>\n- name: <function-name-1>\n arguments: <args-dict-1>\n- name: <function-name-2>\n arguments: <args-dict-2>\n...\n</tool_calls>\n{%- endset -%}\n{%- endif -%}\n{%- if add_thoughts -%}\n{%- set thought_instructions -%}\nPrior to generating the function calls, you should generate the reasoning for why you're calling the function. Please generate these reasoning thoughts between <thinking> and </thinking> XML tags.\n{%- endset -%}\n{%- endif -%}\n{{- bos_token -}}\n{%- set reasoning_prompt='You are a thoughtful and systematic AI assistant built by ServiceNow Language Models (SLAM) lab. Before providing an answer, analyze the problem carefully and present your reasoning step by step. After explaining your thought process, provide the final solution in the following format: [BEGIN FINAL RESPONSE] ... [END FINAL RESPONSE].' -%}\n{%- if messages[0]['role'] != 'system' and tools is not none and tools|length > 0 -%}\n {{- '<|system|>\\n' + reasoning_prompt + available_tools_string + \"\\n\" + tool_output_instructions + '\\n<|end|>\\n' -}}\n{%- endif -%}\n{%- if messages|selectattr('role', 'equalto', 'system')|list|length == 0 -%}\n{{- '<|system|>\\n' + reasoning_prompt + '\\n<|end|>\\n' -}}\n{%- endif -%}\n{%- for message in messages -%}\n {%- if message['role'] == 'user' -%}\n {{- '<|user|>\\n' }}\n {%- if message['content'] is not string %}\n {%- for chunk in message['content'] %}\n {%- if chunk['type'] == 'text' %}\n {{- chunk['text'] }}\n {%- elif chunk['type'] == 'image' or chunk['type'] == 'image_url'%}\n {{- '[IMG]' }}\n {%- else %}\n {{- raise_exception('Unrecognized content type!') }}\n {%- endif %}\n {%- endfor %}\n {%- else %}\n {{- message['content'] }}\n {%- endif %}\n {{- '\\n<|end|>\\n' }}\n {%- elif message['role'] == 'content' -%}\n {%- if message['content'] is not string %}\n {{- '<|content|>\\n' + message['content'][0]['text'] + '\\n<|end|>\\n' -}}\n {%- else %}\n {{- '<|content|>\\n' + message['content'] + '\\n<|end|>\\n' -}}\n {%- endif -%}\n {%- elif message['role'] == 'system' -%}\n {%- if message['content'] is not none and message['content']|length > 0 %}\n {%- if message['content'] is string %}\n {%- set system_message = message['content'] %}\n {%- else %}\n {%- set system_message = message['content'][0]['text'] %}\n {%- endif %}\n {%- else %}\n {%- set system_message = '' %}\n {%- endif %}\n {%- if tools is not none and tools|length > 0 -%}\n {{- '<|system|>\\n' + reasoning_prompt + system_message + '\\n' + available_tools_string + '\\n<|end|>\\n' -}}\n {%- else -%}\n {{- '<|system|>\\n' + reasoning_prompt + system_message + '\\n<|end|>\\n' -}}\n {%- endif -%}\n {%- elif message['role'] == 'assistant' -%}\n {%- if loop.last -%}\n {%- set add_tool_id = false -%}\n {%- endif -%}\n {{- '<|assistant|>\\n' -}}\n {%- if message['content'] is not none and message['content']|length > 0 -%}\n {%- if message['content'] is not string and message['content'][0]['text'] is not none %}\n {{- message['content'][0]['text'] }}\n {%- else %}\n {{- message['content'] -}}\n {%- endif -%}\n {%- elif message['chosen'] is not none and message['chosen']|length > 0 -%}\n {{- message['chosen'][0] -}}\n {%- endif -%}\n {%- if add_thoughts and 'thought' in message and message['thought'] is not none -%}\n {{- '<thinking>' + message['thought'] + '</thinking>' -}}\n {%- endif -%}\n {%- if message['tool_calls'] is not none and message['tool_calls']|length > 0 -%}\n {{- '\\n<tool_calls>[' -}}\n {%- for tool_call in message[\"tool_calls\"] -%}\n {{- '{\"name\": \"' + tool_call['function']['name'] + '\", \"arguments\": ' + tool_call['function']['arguments']|string -}}\n {%- if add_tool_id == true -%}\n {{- ', \"id\": \"' + tool_call['id'] + '\"' -}}\n {%- endif -%}\n {{- '}' -}}\n {%- if not loop.last -%}{{- ', ' -}}{%- endif -%}\n {%- endfor -%}\n {{- ']</tool_calls>' -}}\n {%- endif -%}\n {{- '\\n<|end|>\\n' + eos_token -}}\n {%- elif message['role'] == 'tool' -%}\n {%- if message['content'] is string %}\n {%- set tool_message = message['content'] %}\n {%- else %}\n {%- set tool_message = message['content'][0]['text'] %}\n {%- endif -%}\n {{- '<|tool_result|>\\n' + tool_message|string + '\\n<|end|>\\n' -}}\n {%- endif -%}\n {%- if loop.last and add_generation_prompt and message['role'] != 'assistant' -%}\n {{- '<|assistant|>\\n' -}}\n {%- endif -%}\n{%- endfor -%}" | |
| } | |