Text Generation
MLX
Safetensors
lfm2
mxfp8
jang
quantized
apple-silicon
lfm2.5
liquid
edge
reasoning
osaurus
conversational
8-bit precision
Instructions to use OsaurusAI/LFM2.5-2.6B-MXFP8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use OsaurusAI/LFM2.5-2.6B-MXFP8 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("OsaurusAI/LFM2.5-2.6B-MXFP8") 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 OsaurusAI/LFM2.5-2.6B-MXFP8 with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "OsaurusAI/LFM2.5-2.6B-MXFP8"
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": "OsaurusAI/LFM2.5-2.6B-MXFP8" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use OsaurusAI/LFM2.5-2.6B-MXFP8 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 "OsaurusAI/LFM2.5-2.6B-MXFP8"
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 OsaurusAI/LFM2.5-2.6B-MXFP8
Run Hermes
hermes
- OpenClaw new
How to use OsaurusAI/LFM2.5-2.6B-MXFP8 with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "OsaurusAI/LFM2.5-2.6B-MXFP8"
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 "OsaurusAI/LFM2.5-2.6B-MXFP8" \ --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 OsaurusAI/LFM2.5-2.6B-MXFP8 with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "OsaurusAI/LFM2.5-2.6B-MXFP8"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "OsaurusAI/LFM2.5-2.6B-MXFP8" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OsaurusAI/LFM2.5-2.6B-MXFP8", "messages": [ {"role": "user", "content": "Hello"} ] }'
| { | |
| "backend": "tokenizers", | |
| "bos_token": "<|startoftext|>", | |
| "clean_up_tokenization_spaces": false, | |
| "eos_token": "<|im_end|>", | |
| "is_local": true, | |
| "legacy": false, | |
| "local_files_only": false, | |
| "model_max_length": 1000000000000000019884624838656, | |
| "pad_token": "<|pad|>", | |
| "tokenizer_class": "TokenizersBackend", | |
| "use_default_system_prompt": false, | |
| "chat_template": "{{- bos_token -}}\n{%- set preserve_thinking = preserve_thinking | default(false) -%}\n\n{%- macro format_arg_value(arg_value) -%}\n {%- if arg_value is string -%}\n {{- \"'\" + (arg_value | replace(\"\\\\\", \"\\\\\\\\\") | replace(\"'\", \"\\\\'\") | replace(\"\\n\", \"\\\\n\") | replace(\"\\r\", \"\\\\r\")) + \"'\" -}}\n {%- elif arg_value is mapping or arg_value is iterable -%}\n {{- arg_value | tojson -}}\n {%- else -%}\n {{- arg_value | string -}}\n {%- endif -%}\n{%- endmacro -%}\n\n{%- macro parse_content(content) -%}\n {%- if content is string -%}\n {{- content -}}\n {%- elif content is mapping -%}\n {{- content | tojson -}}\n {%- elif content is iterable -%}\n {%- set _ns = namespace(result=\"\") -%}\n {%- for item in content -%}\n {%- if item is string -%}\n {%- set _ns.result = _ns.result + item -%}\n {%- elif item is mapping and item.get(\"type\") == \"image\" -%}\n {%- set _ns.result = _ns.result + \"<image>\" -%}\n {%- elif item is mapping and item.get(\"type\") == \"text\" -%}\n {%- set _ns.result = _ns.result + ((item.get(\"text\") or \"\") | string) -%}\n {%- else -%}\n {%- set _ns.result = _ns.result + (item | tojson) -%}\n {%- endif -%}\n {%- endfor -%}\n {{- _ns.result -}}\n {%- endif -%}\n{%- endmacro -%}\n\n{%- macro render_tool_calls(tool_calls) -%}\n {%- set tool_calls_ns = namespace(tool_calls=[]) -%}\n {%- for tool_call in tool_calls -%}\n {%- set func = tool_call[\"function\"] if \"function\" in tool_call else tool_call -%}\n {%- set func_name = func[\"name\"] -%}\n {%- set func_args = func.get(\"arguments\") -%}\n {%- set args_ns = namespace(arg_strings=[]) -%}\n {%- if func_args is mapping -%}\n {%- for arg_name, arg_value in func_args.items() -%}\n {%- set args_ns.arg_strings = args_ns.arg_strings + [arg_name + \"=\" + format_arg_value(arg_value)] -%}\n {%- endfor -%}\n {%- elif func_args is string and (func_args | trim) not in [\"\", \"{}\", \"null\"] -%}\n {{- raise_exception(\"Tool call arguments must be a mapping, got a JSON-encoded string: parse arguments with json.loads() before applying the chat template\") -}}\n {%- endif -%}\n {%- set tool_calls_ns.tool_calls = tool_calls_ns.tool_calls + [func_name + \"(\" + (args_ns.arg_strings | join(\", \")) + \")\"] -%}\n {%- endfor -%}\n {{- \"<|tool_call_start|>[\" + (tool_calls_ns.tool_calls | join(\", \")) + \"]<|tool_call_end|>\" -}}\n{%- endmacro -%}\n\n{%- set ns = namespace(system_prompt=\"\", last_user_index=-1) -%}\n{%- if messages and messages[0][\"role\"] == \"system\" -%}\n {%- if messages[0].get(\"content\") -%}\n {%- set ns.system_prompt = parse_content(messages[0][\"content\"]) -%}\n {%- endif -%}\n {%- set messages = messages[1:] -%}\n{%- endif -%}\n{%- if tools -%}\n {%- set ns.system_prompt = ns.system_prompt + (\"\\n\" if ns.system_prompt else \"\") + \"List of tools: [\" -%}\n {%- for tool in tools -%}\n {%- if tool is not string -%}\n {%- set tool = tool | tojson -%}\n {%- endif -%}\n {%- set ns.system_prompt = ns.system_prompt + tool -%}\n {%- if not loop.last -%}\n {%- set ns.system_prompt = ns.system_prompt + \", \" -%}\n {%- endif -%}\n {%- endfor -%}\n {%- set ns.system_prompt = ns.system_prompt + \"]\" -%}\n{%- endif -%}\n{%- if ns.system_prompt -%}\n {{- \"<|im_start|>system\\n\" + ns.system_prompt + \"<|im_end|>\\n\" -}}\n{%- endif -%}\n{%- for message in messages -%}\n {%- if message[\"role\"] == \"user\" -%}\n {%- set ns.last_user_index = loop.index0 -%}\n {%- endif -%}\n{%- endfor -%}\n{%- for message in messages -%}\n {{- \"<|im_start|>\" + message.role + \"\\n\" -}}\n {%- if message.role == \"assistant\" -%}\n {%- generation -%}\n {%- set keep_thinking = preserve_thinking or loop.index0 > ns.last_user_index -%}\n {%- set thinking = message.thinking or message.reasoning or message.reasoning_content -%}\n {%- set thinking = thinking if thinking is string else \"\" -%}\n {%- if thinking and keep_thinking -%}\n {{- \"<think>\" + thinking + \"</think>\" -}}\n {%- endif -%}\n {%- set _cfm_tag = \"CONTINUE_FINAL_MESSAGE_TAG \" -%}\n {%- set _has_cfm = false -%}\n {%- set content = \"\" -%}\n {%- if message.get(\"content\") -%}\n {%- set content = parse_content(message.content) -%}\n {%- endif -%}\n {%- if not keep_thinking and \"</think>\" in content -%}\n {%- set content = content.split(\"</think>\")[-1] | trim -%}\n {%- endif -%}\n {%- if content.endswith(_cfm_tag) -%}\n {%- set _has_cfm = true -%}\n {%- set _trunc_len = (content | length) - (_cfm_tag | length) -%}\n {%- set content = content[:_trunc_len] -%}\n {%- endif -%}\n {{- content -}}\n {%- if message.tool_calls -%}\n {{- render_tool_calls(message.tool_calls) -}}\n {%- endif -%}\n {%- if _has_cfm -%}\n {{- _cfm_tag -}}\n {%- endif -%}\n {{- \"<|im_end|>\\n\" -}}\n {%- endgeneration -%}\n {%- else %}\n {%- if message.get(\"content\") -%}\n {{- parse_content(message[\"content\"]) -}}\n {%- endif -%}\n {{- \"<|im_end|>\\n\" -}}\n {%- endif %}\n{%- endfor -%}\n{%- if add_generation_prompt -%}\n {{- \"<|im_start|>assistant\\n<think>\" -}}\n{%- endif -%}\n" | |
| } |