Instructions to use miguelamendez/mica-spark-x25-4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use miguelamendez/mica-spark-x25-4b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="miguelamendez/mica-spark-x25-4b")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("miguelamendez/mica-spark-x25-4b", device_map="auto") - MLX
How to use miguelamendez/mica-spark-x25-4b 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("miguelamendez/mica-spark-x25-4b") 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
- llama.cpp
How to use miguelamendez/mica-spark-x25-4b with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf miguelamendez/mica-spark-x25-4b:Q4_K_M # Run inference directly in the terminal: llama cli -hf miguelamendez/mica-spark-x25-4b:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf miguelamendez/mica-spark-x25-4b:Q4_K_M # Run inference directly in the terminal: llama cli -hf miguelamendez/mica-spark-x25-4b:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf miguelamendez/mica-spark-x25-4b:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf miguelamendez/mica-spark-x25-4b:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf miguelamendez/mica-spark-x25-4b:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf miguelamendez/mica-spark-x25-4b:Q4_K_M
Use Docker
docker model run hf.co/miguelamendez/mica-spark-x25-4b:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use miguelamendez/mica-spark-x25-4b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "miguelamendez/mica-spark-x25-4b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "miguelamendez/mica-spark-x25-4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/miguelamendez/mica-spark-x25-4b:Q4_K_M
- SGLang
How to use miguelamendez/mica-spark-x25-4b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "miguelamendez/mica-spark-x25-4b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "miguelamendez/mica-spark-x25-4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "miguelamendez/mica-spark-x25-4b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "miguelamendez/mica-spark-x25-4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use miguelamendez/mica-spark-x25-4b with Ollama:
ollama run hf.co/miguelamendez/mica-spark-x25-4b:Q4_K_M
- Unsloth Desktop
- Pi
How to use miguelamendez/mica-spark-x25-4b with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "miguelamendez/mica-spark-x25-4b"
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": "miguelamendez/mica-spark-x25-4b" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use miguelamendez/mica-spark-x25-4b with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "miguelamendez/mica-spark-x25-4b"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "miguelamendez/mica-spark-x25-4b" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "miguelamendez/mica-spark-x25-4b", "messages": [ {"role": "user", "content": "Hello"} ] }' - Docker Model Runner
How to use miguelamendez/mica-spark-x25-4b with Docker Model Runner:
docker model run hf.co/miguelamendez/mica-spark-x25-4b:Q4_K_M
- Lemonade
How to use miguelamendez/mica-spark-x25-4b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull miguelamendez/mica-spark-x25-4b:Q4_K_M
Run and chat with the model
lemonade run user.mica-spark-x25-4b-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use miguelamendez/mica-spark-x25-4b 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 "miguelamendez/mica-spark-x25-4b"
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 miguelamendez/mica-spark-x25-4b
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use miguelamendez/mica-spark-x25-4b with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "miguelamendez/mica-spark-x25-4b"
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 "miguelamendez/mica-spark-x25-4b" \ --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"
Spark-X2.5-4B — Mica Q4/Q8
Mica runtime artifacts for
XHToken/Spark-X2.5-4B,
pinned to revision 0bcb35678590218655dff3765b9e61c83b35e9c4. The
source and derivatives are Apache-2.0 licensed.
The runtime configuration, conversion policy, and validation evidence are
maintained in the Mica Server repository.
Validated artifacts are published together in the
miguelamendez/mica-spark-x25-4b
repository, with manifests recording their source, size, and digest.
Model facts and provenance
| Field | Value | Meaning |
|---|---|---|
| Parameter class | 4B | Upstream model name; an exact parameter total is not published in the card |
| Architectural context | 1,048,576 tokens | Declared by the pinned configuration; input plus output |
| Training context | sequences extending to 1M tokens | Upstream reports a dedicated long-context stage |
| Pretraining | approximately 20T tokens | Upstream disclosure |
| Maximum input alone | not disclosed | Do not infer it from the total context |
| Maximum generated output alone | not disclosed | The upstream 131,072-token example is not treated as a hard model limit |
| Thinking | supported, enabled by default | The chat template also permits enable_thinking=false |
| Thinking effort levels | not disclosed | Mica uses token budgets, not invented low/medium/high semantics |
The architecture combines one full-attention layer with three sliding-window layers. Upstream reports more than 200 languages and evaluates the model in thinking mode. Training data categories are described at a high level, but an itemized dataset inventory is not published.
Mica artifacts
The repository contains all validated formats:
mlx/q4/ MLX affine Q4, group size 64
mlx/q8/ MLX affine Q8, group size 64
gguf/ Q4_K_M and Q8_0
vllm/ not published; structural candidates failed the production gate
The intended portable Linux/NVIDIA comparison was AutoRound W4A16 group-128
versus GPTQ W4A16 group-128, followed by GPTQ W8A16 group-128. AutoRound 0.14.2
cannot calibrate this Spark revision's custom four-dimensional attention mask,
so GPTQ is now the active Q4 path. The embedding and lm_head stay at source
precision. Candidates use compressed-tensors and remain outside the serving
catalog until the custom Spark architecture loads and passes real vLLM
generation plus BF16 quality comparison. Blackwell-only formats are not part
of this matrix.
Two-sample structural GPTQ candidates for both W4A16 and W8A16 now serialize, reload, and generate with batch size two under the 16-GiB guard. They are not production artifacts; Q4's much higher calibration error and the tiny local fixture make the configured 512-sample calibration and BF16 comparison mandatory.
Weight precision and KV-cache precision are independent. A runtime profile may, for example, use Q4 weights with a Q8 KV cache.
Mica validation boundary
On the Apple M4 host, MLX Q4 and Q8 passed real generation and server inference. Measured peak model memory was 2.403 GiB for Q4 and 4.453 GiB for Q8 in the recorded smoke cases. GGUF Q4_K_M and Q8_0 also passed real Metal inference.
These tests do not validate the upstream 1M-token claim locally. Until the long-context matrix passes, Mica profiles must use their own certified context limit and warn above the longest locally tested input. The smaller 1.7B sibling failed the lossless classic-speculation gate and is not an accepted drafter. No native MTP or DFlash checkpoint was found for this target. The Apple M4 vLLM-Metal probe failed during custom-config parsing before model load, and the architecture is not in the plugin's support table.
Validation records:
docs/validation/spark-x25-4b-mlx-q4.mddocs/validation/spark-x25-4b-mlx-q8.mddocs/validation/spark-x25-4b-mlx-classic-speculative.mddocs/validation/spark-vllm-quantization-macos.mddocs/validation/gguf-runtime-macos-metal.md
Profile validation requirements
A Spark profile must satisfy:
max_input_tokens + max_output_tokens <= 1,048,576
max_reasoning_tokens + min_visible_output_tokens <= max_output_tokens
active_batch_tokens <= configured KV/cache admission budget
Exceeding Mica's tested context is a warning in experimental mode and an error in certified mode. Exceeding the architectural total is always an error.
- Downloads last month
- 144