Text Generation
MLX
Safetensors
interns2_mobius
mlx-lm
quantization
4-bit precision
conversational
custom_code
Instructions to use nightscape/Intern-S2-Mobius-4bit-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use nightscape/Intern-S2-Mobius-4bit-mlx 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("nightscape/Intern-S2-Mobius-4bit-mlx") 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 nightscape/Intern-S2-Mobius-4bit-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 "nightscape/Intern-S2-Mobius-4bit-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": "nightscape/Intern-S2-Mobius-4bit-mlx" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use nightscape/Intern-S2-Mobius-4bit-mlx with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "nightscape/Intern-S2-Mobius-4bit-mlx"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "nightscape/Intern-S2-Mobius-4bit-mlx" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nightscape/Intern-S2-Mobius-4bit-mlx", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use nightscape/Intern-S2-Mobius-4bit-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 "nightscape/Intern-S2-Mobius-4bit-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 nightscape/Intern-S2-Mobius-4bit-mlx
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use nightscape/Intern-S2-Mobius-4bit-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 "nightscape/Intern-S2-Mobius-4bit-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 "nightscape/Intern-S2-Mobius-4bit-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"
| library_name: mlx | |
| license: apache-2.0 | |
| license_link: https://huggingface.co/internlm/Intern-S2-Mobius/blob/main/LICENSE | |
| pipeline_tag: text-generation | |
| base_model: internlm/Intern-S2-Mobius | |
| tags: | |
| - mlx | |
| - mlx-lm | |
| - quantization | |
| - 4-bit | |
| # Intern-S2-Mobius (4-bit MLX) | |
| An MLX **4-bit** (affine, group size 64) quantization of | |
| [internlm/Intern-S2-Mobius](https://huggingface.co/internlm/Intern-S2-Mobius) — a 35B hybrid model: | |
| Gated-DeltaNet linear attention / full attention at interval 4, with 2560 experts in 4 globally-shared | |
| routed MoE banks. Runs on Apple Silicon. | |
| - Base model: [internlm/Intern-S2-Mobius](https://huggingface.co/internlm/Intern-S2-Mobius) (Apache-2.0). | |
| - Quantization: 4-bit affine, group size 64; shared-expert / router gates kept at 8-bit. ~19.6 GB peak, ~4.5 bpw. | |
| - Architecture: `interns2_mobius` (`text_config.model_type = interns2_mobius_text`), 40 layers, `head_dim` 256, | |
| MoE 2560 experts / top-8, `num_blocks` 4. `max_position_embeddings` 262144. | |
| ## Quick start | |
| Requires the `mlx-lm` build that ships the `interns2_mobius` architecture | |
| (official part of `mlx-lm` as of the model-support PR): | |
| ```bash | |
| pip install -U mlx-lm | |
| mlx_lm.generate --model nightscape/Intern-S2-Mobius-4bit-mlx \ | |
| -p "The secret to baking a good cake is" -m 1024 --trust-remote-code | |
| ``` | |
| `--trust-remote-code` is mandatory: the checkpoint bundles a custom tokenizer | |
| (`tokenization_interns1.py`) and model code. | |
| ## Details | |
| - This is an MLX conversion; `transformers` does not yet ship `interns2_mobius`. The reference is the | |
| upstream repo's `trust_remote_code` implementation, verified by full bf16 logit diff (argmax agreement | |
| 38/39, the sole miss a bit-identical tie). | |
| - Capability spot-check (this 4-bit conversion): MMLU-Pro 88.3% ± 4.1 (n=60) vs upstream bf16 89.05; | |
| GSM8K 97–98% (n=100). Short-generation-budget evals truncate chain-of-thought and depress scores — an | |
| eval artifact, not a capability drop. | |
| - Text-only: this conversion is the language model. The upstream checkpoint is tagged `image-text-to-text`, | |
| but the MLX port loads the language model and generates text (no vision tower on this path). | |
| ## Companion | |
| An experimental MTP (Multi-Token-Prediction) head is published separately: | |
| [nightscape/Intern-S2-Mobius-4bit-mlx-mtp](https://huggingface.co/nightscape/Intern-S2-Mobius-4bit-mlx-mtp). | |
| It is consumed by the `omlx` server's `interns2_mobius` MTP driver, **not** by stock `mlx-lm`. | |
| ## License | |
| Weights and code under Apache-2.0 — see [LICENSE](LICENSE). Model by InternLM; this is a derivative | |
| conversion of their weights plus the MLX port. | |