Instructions to use nativ-community/flint-5bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use nativ-community/flint-5bit 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("nativ-community/flint-5bit") 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 nativ-community/flint-5bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "nativ-community/flint-5bit"
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": "nativ-community/flint-5bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use nativ-community/flint-5bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "nativ-community/flint-5bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "nativ-community/flint-5bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nativ-community/flint-5bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use nativ-community/flint-5bit 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 "nativ-community/flint-5bit"
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 nativ-community/flint-5bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use nativ-community/flint-5bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "nativ-community/flint-5bit"
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 "nativ-community/flint-5bit" \ --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"
File size: 3,933 Bytes
a062f66 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | {
"format": "5bit",
"strict_reload": true,
"finite_prefill_decode_logits": true,
"cache_offsets_correct": true,
"source_sidecars_identical": true,
"native_thinking_template_preserved": true,
"temperature": 0.0,
"max_tokens": 512,
"smoke_tests": [
{
"task": "arithmetic",
"prompt": "What is 17 multiplied by 23? Give the answer.",
"text": "<think>1. The user asks for 17 multiplied by 23 and to give the answer.\n2. Calculation: 17 * 23 = 391.\n3. Provide the answer directly and clearly.</think>17 multiplied by 23 is **391**.",
"answer": "17 multiplied by 23 is **391**.",
"checks": {
"expected_391": true
},
"generated_tokens": 55,
"seconds": 0.5447727499995381
},
{
"task": "retrieval",
"prompt": "The passcode is 941731. Repeat the passcode exactly.",
"text": "<think>The user is asking me to repeat a passcode. This is a simple request. I should just repeat it exactly as they provided it.\n\nThe passcode is 941731.\n\nI should repeat it exactly. No need for extra commentary unless it seems helpful, but the instruction is clear: \"Repeat the passcode exactly.\"\n\nSo my response should just be: 941731\n\nLet me make sure I don't add anything extra that might be unwanted. The user wants me to repeat it exactly, so I should just output the number.</think>941731",
"answer": "941731",
"checks": {
"expected_passcode": true
},
"generated_tokens": 109,
"seconds": 1.0578467911109328
},
{
"task": "code",
"prompt": "Write a Python function add(a, b) that returns a + b.",
"text": "<think>We need to write a Python function add(a, b) that returns a + b. This is straightforward. The user likely expects a simple implementation.\n\nWe should provide the code, maybe with a brief explanation.\n\nThe instruction: \"Write a Python function add(a, b) that returns a + b.\"\n\nSo we can just output:\n\ndef add(a, b):\n return a + b\n\nWe might also include a docstring or example usage, but the core is that.\n\nSince the user asked to write the function, we should just provide the code. Possibly in a code block.\n\nWe'll respond with the function definition and maybe a short explanation.\n\nNo need for extra complexity.\n\nLet's craft the response.</think>Here's a simple Python function that adds two numbers:\n\n```python\ndef add(a, b):\n return a + b\n```\n\nYou can use it like this:\n\n```python\nresult = add(3, 5) # result will be 8\n```\n\nThe function works with any types that support the `+` operator, such as integers, floats, strings, lists, etc.",
"answer": "Here's a simple Python function that adds two numbers:\n\n```python\ndef add(a, b):\n return a + b\n```\n\nYou can use it like this:\n\n```python\nresult = add(3, 5) # result will be 8\n```\n\nThe function works with any types that support the `+` operator, such as integers, floats, strings, lists, etc.",
"checks": {
"add_function": true
},
"generated_tokens": 221,
"seconds": 1.9357592919841409
}
],
"all_smoke_checks_pass": true,
"device": {
"device_name": "Apple M5 Max",
"max_recommended_working_set_size": 115448725504,
"memory_size": 137438953472,
"architecture": "applegpu_g17s",
"max_buffer_length": 86586540032,
"resource_limit": 499000
},
"mlx_version": "0.32.4",
"mlx_vlm_version": "0.7.10",
"converter_revision": "6d9ba328abbd6129c7461eda86280aa9fbfd9986",
"python": "3.12.15",
"peak_active_gb": 27.436328788,
"seconds": 5.28359774989076,
"swap_before": "vm.swapusage: total = 10240.00M used = 8736.50M free = 1503.50M (encrypted)",
"swap_after": "vm.swapusage: total = 10240.00M used = 8736.50M free = 1503.50M (encrypted)",
"limits": "Three synthetic smoke prompts and finite/cache checks; not a quality benchmark or proof of parity to BF16/Transformers."
} |