Text Generation
MLX
Safetensors
granite_switch
granite
granite-switch
granite-4.1
alora
decision
guardian
apple-silicon
conversational
8-bit precision
Instructions to use netprojects/granite-switch-4.1-8b-mlx-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use netprojects/granite-switch-4.1-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("netprojects/granite-switch-4.1-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 netprojects/granite-switch-4.1-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 "netprojects/granite-switch-4.1-8b-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": "netprojects/granite-switch-4.1-8b-mlx-8bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use netprojects/granite-switch-4.1-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 "netprojects/granite-switch-4.1-8b-mlx-8bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "netprojects/granite-switch-4.1-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": "netprojects/granite-switch-4.1-8b-mlx-8bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use netprojects/granite-switch-4.1-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 "netprojects/granite-switch-4.1-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 netprojects/granite-switch-4.1-8b-mlx-8bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use netprojects/granite-switch-4.1-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 "netprojects/granite-switch-4.1-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 "netprojects/granite-switch-4.1-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"
Rebuild from Granite Switch 4.1.1
Browse files- BUILD.md +3 -2
- io_configs/decision/io.yaml +2 -2
- model-00001-of-00002.safetensors +1 -1
- model-00002-of-00002.safetensors +1 -1
BUILD.md
CHANGED
|
@@ -17,7 +17,7 @@ Total adapters: **2**
|
|
| 17 |
| # | Name | Technology | Control Token | Token ID | Rank | Alpha | Target Modules | Source |
|
| 18 |
|---|------|------------|---------------|----------|------|-------|----------------|--------|
|
| 19 |
| 1 | guardian-core | alora | `<\|guardian-core\|>` | 100352 | 16 | 64 | k_proj, o_proj, q_proj, v_proj | ibm-granite/granitelib-guardian-r1.0 |
|
| 20 |
-
| 2 | decision | alora | `<\|decision\|>` | 100353 | 64 |
|
| 21 |
|
| 22 |
## Composition Details
|
| 23 |
|
|
@@ -25,6 +25,7 @@ Total adapters: **2**
|
|
| 25 |
- composed_param_count: 8,776,400,896
|
| 26 |
- Param delta: +4.72%
|
| 27 |
- compose_settings:
|
|
|
|
| 28 |
- include_adapters:
|
| 29 |
- "guardian-core"
|
| 30 |
- "decision"
|
|
@@ -33,4 +34,4 @@ Total adapters: **2**
|
|
| 33 |
- 14711
|
| 34 |
- target_model: "granite-4.1-8b"
|
| 35 |
- adapter_sources:
|
| 36 |
-
- "ibm-granite/granitelib-guardian-r1.0": "
|
|
|
|
| 17 |
| # | Name | Technology | Control Token | Token ID | Rank | Alpha | Target Modules | Source |
|
| 18 |
|---|------|------------|---------------|----------|------|-------|----------------|--------|
|
| 19 |
| 1 | guardian-core | alora | `<\|guardian-core\|>` | 100352 | 16 | 64 | k_proj, o_proj, q_proj, v_proj | ibm-granite/granitelib-guardian-r1.0 |
|
| 20 |
+
| 2 | decision | alora | `<\|decision\|>` | 100353 | 64 | 64 | down_proj, gate_proj, k_proj, o_proj, q_proj, up_proj, v_proj | decision-4.1.1 |
|
| 21 |
|
| 22 |
## Composition Details
|
| 23 |
|
|
|
|
| 25 |
- composed_param_count: 8,776,400,896
|
| 26 |
- Param delta: +4.72%
|
| 27 |
- compose_settings:
|
| 28 |
+
- technology_filter: "alora"
|
| 29 |
- include_adapters:
|
| 30 |
- "guardian-core"
|
| 31 |
- "decision"
|
|
|
|
| 34 |
- 14711
|
| 35 |
- target_model: "granite-4.1-8b"
|
| 36 |
- adapter_sources:
|
| 37 |
+
- "ibm-granite/granitelib-guardian-r1.0": "5802b88ef1f9a71e7a33c9025a36b81f2671e58d"
|
io_configs/decision/io.yaml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
# Decider / decision engine (aLoRA, r=64, granite-4.1-
|
| 2 |
-
# Prompt layout and readout are those of
|
| 3 |
# turn with the state (runs on frozen base KV), then a second user turn opening with the
|
| 4 |
# "### DECISION" invocation marker plus Question / Options as "A: ...", "B: ...",
|
| 5 |
# add_generation_prompt=True; the answer is the first assistant token, read as a softmax over
|
|
|
|
| 1 |
+
# Decider / decision engine (aLoRA, r=64, granite-4.1-8b).
|
| 2 |
+
# Prompt layout and readout are those of the aLoRA example in the README: a fixed system prompt, a first user
|
| 3 |
# turn with the state (runs on frozen base KV), then a second user turn opening with the
|
| 4 |
# "### DECISION" invocation marker plus Question / Options as "A: ...", "B: ...",
|
| 5 |
# add_generation_prompt=True; the answer is the first assistant token, read as a softmax over
|
model-00001-of-00002.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 5366329691
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:49cc0adc1e53325dd38c16acfa0fef88fab04ca0e3ce62317b42c4475130a8a2
|
| 3 |
size 5366329691
|
model-00002-of-00002.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4033304869
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:57399ffb584899bc450f1d8c22ad6cb0cb33cc0ec472ce09d2f19a71d908cdea
|
| 3 |
size 4033304869
|