Instructions to use tokimoa/apertus-v1.5-8b-mlx-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use tokimoa/apertus-v1.5-8b-mlx-8bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("tokimoa/apertus-v1.5-8b-mlx-8bit") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use tokimoa/apertus-v1.5-8b-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 "tokimoa/apertus-v1.5-8b-mlx-8bit"
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": "tokimoa/apertus-v1.5-8b-mlx-8bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use tokimoa/apertus-v1.5-8b-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 "tokimoa/apertus-v1.5-8b-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 tokimoa/apertus-v1.5-8b-mlx-8bit
Run Hermes
hermes
- OpenClaw new
How to use tokimoa/apertus-v1.5-8b-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 "tokimoa/apertus-v1.5-8b-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 "tokimoa/apertus-v1.5-8b-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"
- MLX LM
How to use tokimoa/apertus-v1.5-8b-mlx-8bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "tokimoa/apertus-v1.5-8b-mlx-8bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "tokimoa/apertus-v1.5-8b-mlx-8bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tokimoa/apertus-v1.5-8b-mlx-8bit", "messages": [ {"role": "user", "content": "Hello"} ] }'
| { | |
| "add_prefix_space": false, | |
| "added_tokens_count": 135368, | |
| "audio_begin_token": [ | |
| 131080 | |
| ], | |
| "audio_end_token": [ | |
| 131081 | |
| ], | |
| "audio_token": "<|audio|>", | |
| "audio_tokenizer": { | |
| "codebook_size": 4096, | |
| "type": "wavtokenizer" | |
| }, | |
| "backend": "tokenizers", | |
| "base_vocab_size": 131072, | |
| "boa_token": "<|audio_start|>", | |
| "boi_token": "<|img_start|>", | |
| "bos_token": "<s>", | |
| "clean_up_tokenization_spaces": false, | |
| "eoa_token": "<|audio_end|>", | |
| "eoi_token": "<|img_end|>", | |
| "eol_token": "<|img_end_of_row|>", | |
| "eos_token": "</s>", | |
| "image_token": "<|image|>", | |
| "image_wrapper_token": "<|img_token_start|>", | |
| "is_local": true, | |
| "local_files_only": true, | |
| "model_input_names": [ | |
| "input_ids", | |
| "attention_mask" | |
| ], | |
| "model_max_length": 1000000000000000019884624838656, | |
| "model_specific_special_tokens": { | |
| "audio_token": "<|audio|>", | |
| "boa_token": "<|audio_start|>", | |
| "boi_token": "<|img_start|>", | |
| "eoa_token": "<|audio_end|>", | |
| "eoi_token": "<|img_end|>", | |
| "eol_token": "<|img_end_of_row|>", | |
| "image_token": "<|image|>", | |
| "image_wrapper_token": "<|img_token_start|>" | |
| }, | |
| "omnimodal_config": { | |
| "modalities": [ | |
| { | |
| "end_token": 131074, | |
| "name": "vision", | |
| "offset": 131272, | |
| "start_token": 131073, | |
| "vocab_size": 131072 | |
| }, | |
| { | |
| "end_token": 131081, | |
| "name": "audio", | |
| "offset": 262344, | |
| "start_token": 131080, | |
| "vocab_size": 4096 | |
| } | |
| ], | |
| "omni_special_token_offset": 131072 | |
| }, | |
| "pad_token": "<pad>", | |
| "padding_side": "left", | |
| "processor_class": "Apertus1p5Processor", | |
| "sft_assistant_begin_sequence": [ | |
| 67 | |
| ], | |
| "sft_eot_token": [ | |
| 68 | |
| ], | |
| "sft_user_begin_sequence": [ | |
| 65 | |
| ], | |
| "tokenizer_class": "TokenizersBackend", | |
| "unk_token": "<unk>", | |
| "vision_begin_token": [ | |
| 131073 | |
| ], | |
| "vision_end_token": [ | |
| 131074 | |
| ], | |
| "vision_tokenizer": { | |
| "codebook_size": 131072, | |
| "path": "/capstor/store/cscs/swissai/infra01/MLLM/tokenizer/Emu3.5-VisionTokenizer", | |
| "type": "Emu3.5" | |
| }, | |
| "vocab_size": 131072 | |
| } | |