Text Generation
MLX
Safetensors
Mixture of Experts
edge-inference
prerouter
lora
ssd-offload
conversational
custom_code
4-bit precision
Instructions to use Edge0/Edge0-8B-A1B-preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Edge0/Edge0-8B-A1B-preview 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("Edge0/Edge0-8B-A1B-preview") 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 Edge0/Edge0-8B-A1B-preview with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Edge0/Edge0-8B-A1B-preview"
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": "Edge0/Edge0-8B-A1B-preview" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use Edge0/Edge0-8B-A1B-preview with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "Edge0/Edge0-8B-A1B-preview"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "Edge0/Edge0-8B-A1B-preview" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Edge0/Edge0-8B-A1B-preview", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use Edge0/Edge0-8B-A1B-preview 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 "Edge0/Edge0-8B-A1B-preview"
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 Edge0/Edge0-8B-A1B-preview
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Edge0/Edge0-8B-A1B-preview with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Edge0/Edge0-8B-A1B-preview"
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 "Edge0/Edge0-8B-A1B-preview" \ --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"
Upload config.json with huggingface_hub
Browse files- config.json +113 -0
config.json
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"BailingMoeV3ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_dropout": 0.0,
|
| 6 |
+
"auto_map": {
|
| 7 |
+
"AutoConfig": "configuration_bailing_moe_v3.BailingMoeV3Config",
|
| 8 |
+
"AutoModel": "modeling_bailing_moe_v3.BailingMoeV3Model",
|
| 9 |
+
"AutoModelForCausalLM": "modeling_bailing_moe_v3.BailingMoeV3ForCausalLM"
|
| 10 |
+
},
|
| 11 |
+
"dtype": "bfloat16",
|
| 12 |
+
"embedding_dropout": 0.0,
|
| 13 |
+
"eos_token_id": 156895,
|
| 14 |
+
"expert_swiglu_limit_list": null,
|
| 15 |
+
"first_k_dense_replace": 1,
|
| 16 |
+
"gated_attention_proj_granularity_type": "head_wise",
|
| 17 |
+
"group_norm_size": 1,
|
| 18 |
+
"head_dim": 128,
|
| 19 |
+
"hidden_act": "silu",
|
| 20 |
+
"hidden_size": 1536,
|
| 21 |
+
"initializer_range": 0.02,
|
| 22 |
+
"intermediate_size": 4608,
|
| 23 |
+
"kda_lower_bound": -5,
|
| 24 |
+
"kda_safe_gate": true,
|
| 25 |
+
"kv_lora_rank": 512,
|
| 26 |
+
"layer_group_size": 4,
|
| 27 |
+
"linear_silu": true,
|
| 28 |
+
"max_position_embeddings": 131072,
|
| 29 |
+
"max_window_layers": 20,
|
| 30 |
+
"moe_intermediate_size": 512,
|
| 31 |
+
"moe_router_enable_expert_bias": true,
|
| 32 |
+
"moe_shared_expert_intermediate_size": 512,
|
| 33 |
+
"mtp_loss_scaling_factor": 0,
|
| 34 |
+
"mtp_use_kda": false,
|
| 35 |
+
"n_group": 8,
|
| 36 |
+
"no_kda_lora": true,
|
| 37 |
+
"norm_topk_prob": true,
|
| 38 |
+
"num_attention_heads": 16,
|
| 39 |
+
"num_experts": 128,
|
| 40 |
+
"num_experts_per_tok": 8,
|
| 41 |
+
"num_hidden_layers": 24,
|
| 42 |
+
"num_key_value_heads": 16,
|
| 43 |
+
"num_kv_heads_for_linear_attn": 0,
|
| 44 |
+
"num_nextn_predict_layers": 0,
|
| 45 |
+
"num_shared_experts": 1,
|
| 46 |
+
"output_dropout": 0.0,
|
| 47 |
+
"output_router_logits": false,
|
| 48 |
+
"pad_token_id": 156892,
|
| 49 |
+
"partial_rotary_factor": 0.5,
|
| 50 |
+
"pregate_cross_token": true,
|
| 51 |
+
"pregate_enabled": true,
|
| 52 |
+
"pregate_hidden": 512,
|
| 53 |
+
"pregate_inference": false,
|
| 54 |
+
"pregate_init_router": false,
|
| 55 |
+
"pregate_opd_ce_weight": 1.0,
|
| 56 |
+
"pregate_opd_strategy": "none",
|
| 57 |
+
"pregate_opd_temperature": 1.0,
|
| 58 |
+
"pregate_opd_topk": 8,
|
| 59 |
+
"pregate_opd_weight": 1.0,
|
| 60 |
+
"pregate_opd_weight_mode": "teacher_p",
|
| 61 |
+
"pregate_shallow_hidden": 1024,
|
| 62 |
+
"pregate_shallow_layers": 5,
|
| 63 |
+
"pregate_shallow_loss_weight": 1.5,
|
| 64 |
+
"pregate_start_layer": 7,
|
| 65 |
+
"pregate_use_prev_token": true,
|
| 66 |
+
"pregate_use_prev_topk": true,
|
| 67 |
+
"q_lora_rank": 256,
|
| 68 |
+
"qk_head_dim": 192,
|
| 69 |
+
"qk_nope_head_dim": 128,
|
| 70 |
+
"qk_rope_head_dim": 64,
|
| 71 |
+
"rms_norm_eps": 1e-06,
|
| 72 |
+
"rope_interleave": true,
|
| 73 |
+
"rope_parameters": {
|
| 74 |
+
"partial_rotary_factor": 0.5,
|
| 75 |
+
"rope_theta": 6000000,
|
| 76 |
+
"rope_type": "default"
|
| 77 |
+
},
|
| 78 |
+
"rope_theta": 6000000,
|
| 79 |
+
"rotary_dim": 64,
|
| 80 |
+
"routed_scaling_factor": 2.5,
|
| 81 |
+
"router_dtype": "fp32",
|
| 82 |
+
"scale_router_input": false,
|
| 83 |
+
"score_function": "sigmoid",
|
| 84 |
+
"scoring_func": "sigmoid",
|
| 85 |
+
"seq_aux": true,
|
| 86 |
+
"share_expert_swiglu_limit_list": null,
|
| 87 |
+
"short_conv_kernel_size": 4,
|
| 88 |
+
"tie_word_embeddings": false,
|
| 89 |
+
"topk_group": 4,
|
| 90 |
+
"topk_method": "noaux_tc",
|
| 91 |
+
"transformers_version": "5.8.1",
|
| 92 |
+
"up_proj_norm": false,
|
| 93 |
+
"use_bias": false,
|
| 94 |
+
"use_cache": false,
|
| 95 |
+
"use_kda_lora": false,
|
| 96 |
+
"use_mla_nope": false,
|
| 97 |
+
"use_nGPT": false,
|
| 98 |
+
"use_qk_norm": true,
|
| 99 |
+
"use_qkv_bias": false,
|
| 100 |
+
"v_head_dim": 128,
|
| 101 |
+
"value_norm": false,
|
| 102 |
+
"vocab_size": 157184,
|
| 103 |
+
"quantization": {
|
| 104 |
+
"group_size": 64,
|
| 105 |
+
"bits": 4,
|
| 106 |
+
"mode": "affine"
|
| 107 |
+
},
|
| 108 |
+
"quantization_config": {
|
| 109 |
+
"group_size": 64,
|
| 110 |
+
"bits": 4,
|
| 111 |
+
"mode": "affine"
|
| 112 |
+
}
|
| 113 |
+
}
|