Skip to content

armgit / Edge0

Public Imported from GitHub
0

Run 35B MoE models in ~2.5 GB of RAM. Weights stream from SSD; a trained router predicts loads a step ahead. Mac, iPhone, Android, Windows supported

Python

add 5 language readmes

Bind85bae8f2382
diff --git a/README.md b/README.md
index 845e8d2..c335726 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@
[![GitHub](https://img.shields.io/badge/GitHub-Edge0--AI%2FEdge0-black?style=for-the-badge&logo=github)](https://github.com/Edge0-AI/Edge0)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue?style=for-the-badge)](LICENSE)
-English | [中文](README_zh.md)
+English | [中文](README_zh.md) | [日本語](README_ja.md) | [Español](README_es.md) | [Français](README_fr.md)
</div>
@@ -55,11 +55,11 @@ One repo, one recipe, per-platform runtimes:
| Platform | Directory | Stack | Status |
|---|---|---|---|
-| **Python** (macOS · Apple Silicon) | [`python/`](python/) | Python + MLX | ✅ Available now |
-| **macOS** app & CLI | [`macos/`](macos/) | Rust | ✅ Open-sourced (2026-09-30) |
-| **iOS** app | [`ios/`](ios/) | Swift + MLX Swift | ✅ Open-sourced (2026-09-30) |
-| **Android** app & engine | [`android/`](android/) | Kotlin + native engine | ✅ Open-sourced (2026-09-30) |
-| **Windows** app & engine | [`windows/`](windows/) | C++ + Vulkan | ✅ Open-sourced (2026-09-30) |
+| **Python** (macOS · Apple Silicon) | [`python/`](python/README.md) | Python + MLX | ✅ Available now |
+| **macOS** app & CLI | [`macos/`](macos/README.md) | Rust | ✅ Open-sourced (2026-09-30) |
+| **iOS** app | [`ios/`](ios/README.md) | Swift + MLX Swift | ✅ Open-sourced (2026-09-30) |
+| **Android** app & engine | [`android/`](android/README.md) | Kotlin + native engine | ✅ Open-sourced (2026-09-30) |
+| **Windows** app & engine | [`windows/`](windows/README.md) | C++ + Vulkan | ✅ Open-sourced (2026-09-30) |
### Models
@@ -360,9 +360,9 @@ examples/demo.py # minimal API walkthrough
CI runs unit tests (macOS + MLX) and a repo-hygiene suite (no hardcoded
paths, backend-boundary and secret checks) on every PR.
-**Platform runtimes** (macOS / iOS / Android): the directories are
-reserved placeholders for now; contribution guides will land together
-with the unified framework code.
+**Platform runtimes** (macOS / iOS / Android / Windows): each platform
+directory ships its own build guide and tests — see the directory
+READMEs.
Workflow: fork → feature branch → PR against `main`. Please keep the
hygiene suite green and add tests for new behavior.
diff --git a/README_es.md b/README_es.md
new file mode 100644
index 0000000..c5f8dcf
--- /dev/null
+++ b/README_es.md
@@ -0,0 +1,419 @@
+<div align="center">
+
+<img src="assets/20260908-223115.jpg" alt="edge0" width="100%">
+
+# edge0
+
+**Un framework de inferencia MoE en streaming de código abierto — SSD expert offload + Recover-LoRA + predicción de enrutamiento del prerouter.**
+
+**Python** · **macOS** · **iOS** · **Android** — una receta, todos los dispositivos.
+
+[![Hugging Face](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Edge0--35B--A3B--preview-yellow?style=for-the-badge)](https://huggingface.co/Edge0/Edge0-35B-A3B-preview)
+[![Hugging Face](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Edge0--8B--A1B--preview-yellow?style=for-the-badge)](https://huggingface.co/Edge0/Edge0-8B-A1B-preview)
+[![ModelScope](https://img.shields.io/badge/ModelScope-Edge0--35B--A3B--preview-624AFF?style=for-the-badge)](https://www.modelscope.cn/models/Edge0/Edge0-35B-A3B-preview)
+[![ModelScope](https://img.shields.io/badge/ModelScope-Edge0--8B--A1B--preview-624AFF?style=for-the-badge)](https://www.modelscope.cn/models/Edge0/Edge0-8B-A1B-preview)
+[![arXiv](https://img.shields.io/badge/arXiv-2609.18063-B31B1B?style=for-the-badge&logo=arxiv&logoColor=white)](https://arxiv.org/abs/2609.18063)
+[![GitHub](https://img.shields.io/badge/GitHub-Edge0--AI%2FEdge0-black?style=for-the-badge&logo=github)](https://github.com/Edge0-AI/Edge0)
+[![License](https://img.shields.io/badge/License-Apache%202.0-blue?style=for-the-badge)](LICENSE)
+
+[English](README.md) | [中文](README_zh.md) | [日本語](README_ja.md) | Español | [Français](README_fr.md)
+
+</div>
+
+## Novedades
+
+- **[2026-09-30]** Lanzamos los **motores de inferencia de edge0 para cuatro plataformas — iOS, macOS, Android y Windows** — de modo que los usuarios obtienen la mejor experiencia de inferencia en todas las arquitecturas y plataformas. El código fuente se ha liberado en este repositorio ([`ios/`](ios/) · [`macos/`](macos/) · [`android/`](android/) · [`windows/`](windows/)) — consulta el README de cada directorio para más detalles. El **framework de inferencia unificado** llegará en **Q4 2026**; consulta la [Hoja de ruta](#hoja-de-ruta).
+- **[2026-09-20]** `--prefill-ondemand` llega a `edge0 demo / chat / serve` ([#112](https://github.com/Edge0-AI/Edge0/pull/112)).
+- **[2026-09-16]** Nuestro informe técnico está en arXiv: [The Other Half of the Memory Wall: Serving 35B MoEs from SSD with Trained Routing Prediction](https://arxiv.org/abs/2609.18063).
+- **[2026-09-08]** Primera versión de código abierto de **edge0**, junto con los dos niveles de modelos — [`Edge0-35B-A3B-preview`](https://huggingface.co/Edge0/Edge0-35B-A3B-preview) y [`Edge0-8B-A1B-preview`](https://huggingface.co/Edge0/Edge0-8B-A1B-preview) — en Hugging Face y ModelScope.
+
+## Acerca de
+
+**edge0** es un framework de inferencia MoE en streaming de código abierto.
+Generaliza la receta probada en producción — **SSD expert offload +
+Recover-LoRA + predicción de enrutamiento del prerouter** — en un framework
+extensible que ejecuta grandes modelos sparse-MoE en hardware de consumo: la
+memoria pico está limitada por el conjunto de expertos *activos*, no por el
+número de parámetros.
+
+### Mecanismos principales
+
+- **SSD expert offload**: los pesos de los expertos se transmiten desde el
+ almacenamiento bajo demanda; la memoria pico está limitada por el conjunto
+ activo, no por el número de parámetros.
+- **Prerouter**: una cabeza entrenada predice el enrutamiento de expertos un
+ paso por delante, de modo que las cargas de expertos se solapan con el
+ forward pass en lugar de bloquearlo — **hasta +59%** de throughput de
+ decode; la ganancia crece con la latencia del almacenamiento, el tamaño del
+ modelo y el ancho de enrutamiento *K*.
+- **Recover-LoRA**: la base int4 se mantiene congelada y los adaptadores LoRA
+ se entrenan por destilación desde el teacher FP, recuperando la mayor parte
+ de la pérdida de cuantización a 4 bits (consulta [Calidad](#calidad)). Los
+ adaptadores permanecen sin fusionar: una única base de solo lectura sirve a
+ varios conjuntos de adaptadores.
+
+### Plataformas
+
+Un repositorio, una receta, runtimes por plataforma:
+
+| Plataforma | Directorio | Stack | Estado |
+|---|---|---|---|
+| **Python** (macOS · Apple Silicon) | [`python/`](python/README_es.md) | Python + MLX | ✅ Disponible ahora |
+| Aplicación y CLI para **macOS** | [`macos/`](macos/README_es.md) | Rust | ✅ Código abierto (2026-09-30) |
+| Aplicación para **iOS** | [`ios/`](ios/README_es.md) | Swift + MLX Swift | ✅ Código abierto (2026-09-30) |
+| Aplicación y motor para **Android** | [`android/`](android/README_es.md) | Kotlin + motor nativo | ✅ Código abierto (2026-09-30) |
+| Aplicación y motor para **Windows** | [`windows/`](windows/README_es.md) | C++ + Vulkan | ✅ Código abierto (2026-09-30) |
+
+### Modelos
+
+El framework incluye dos niveles de modelos. Cada nivel es una versión de
+extremo a extremo: el checkpoint publicado, los adaptadores LoRA entrenados y
+las cabezas prerouter entrenadas funcionan en conjunto como una sola unidad.
+
+| Nivel | Checkpoint publicado | Perfil de inferencia |
+|---|---|---|
+| `edge0-35b` | [`Edge0/Edge0-35B-A3B-preview`](https://huggingface.co/Edge0/Edge0-35B-A3B-preview) · [ModelScope](https://www.modelscope.cn/models/Edge0/Edge0-35B-A3B-preview) | 4 bits, 40 capas, 256 expertos, prerouter K=4 |
+| `edge0-8b` | [`Edge0/Edge0-8B-A1B-preview`](https://huggingface.co/Edge0/Edge0-8B-A1B-preview) · [ModelScope](https://www.modelscope.cn/models/Edge0/Edge0-8B-A1B-preview) | 4 bits, 24 capas, 128 expertos, prerouter K=8 |
+
+Ambos checkpoints se construyen sobre modelos base sparse-MoE abiertos
+(Qwen3.6-35B-A3B y el híbrido bailing Ling 3.0, respectivamente) e incluyen
+el entrenamiento de LoRA y prerouter realizado para este framework — los
+archivos de adaptadores están junto a cada checkpoint y se cargan
+automáticamente, de modo que `edge0 serve <nivel>` ejecuta el pipeline
+entrenado sin ninguna configuración adicional.
+
+### Diseño
+
+- **Uso al estilo transformers**: `AutoModel` / `AutoConfig` / `AutoEngine`
+ resuelven el nivel a partir del nombre del modelo;
+- **Aislamiento de backends (framework de Python)**: dentro del framework de
+ Python, todo el código MLX vive en `python/src/edge0/backends/mlx/`; la
+ lógica principal (especificaciones de modelos, prerouter, pool de expertos
+ en streaming, servidor) depende solo de la fachada del backend
+ (`backends/base.py`), de modo que un nuevo backend implementa la misma
+ fachada (`backends/cuda/` es un espacio reservado) sin ningún cambio en el
+ código principal. Los motores de iOS / macOS / Android incluyen hoy stacks
+ nativos de cada plataforma — llevar todas las plataformas bajo una única
+ capa de acceso es exactamente lo que entregará el framework de inferencia
+ unificado (consulta la [Hoja de ruta](#hoja-de-ruta));
+- **Adaptadores como safetensors**: los pesos de LoRA y del prerouter son
+ archivos `.safetensors` con metadatos de procedencia (fuente, versión, capas
+ propietarias), resueltos desde el directorio del modelo o `artifacts/`;
+- **Modelo + adaptadores en un solo directorio**: un directorio de modelo
+ contiene tanto el checkpoint base (`config.json` / `model*.safetensors` /
+ tokenizer) como los adaptadores de ese modelo; actualizar los adaptadores
+ solo reemplaza los archivos de adaptadores — la base permanece de solo
+ lectura y nunca se fusiona.
+
+### Calidad
+
+Todos los benchmarks fueron ejecutados por nosotros con
+[OpenCompass](https://github.com/open-compass/opencompass) bajo configuraciones
+y parámetros idénticos tanto para los modelos edge0 (int4 + adaptadores
+entrenados + enrutamiento prerouter) como para los modelos base fp16
+originales. La pérdida del pipeline edge0 es pequeña: **3.9 puntos de media
+para edge0-35b, 2.8 para edge0-8b** (MMLU-Pro incluso supera a la base).
+Máximo 100:
+
+| Benchmark | edge0-35b (int4) | Qwen3.6-35B-A3B (fp16) | edge0-8b (int4) | Ling 3.0 tiny (fp16) |
+|---|---:|---:|---:|---:|
+| AIME 2026 | 86.6 | 92.7 | 63.3 | 73.3 |
+| HumanEval | 90.9 | 95.1 | 91.5 | 92.7 |
+| GPQA-Diamond | 79.8 | 81.8 | 70.7 | 71.2 |
+| MMLU-Pro | 81.0 | 84.6 | 70.1 | 65.8 |
+| IFBench | 57.9 | 61.7 | 53.9 | 60.6 |
+| **Media** | **79.2** | **83.2** | **69.9** | **72.7** |
+
+### Benchmark
+
+Medido con `python/examples/bench.py` (prefill de un prompt de 3.3k tokens →
+10 pasos de calentamiento muestreados → 200 tokens de decode muestreados y
+cronometrados, 2 ejecuciones por nivel):
+
+| Nivel | Velocidad de decode | Throughput de prefill (frío / caliente)* | Memoria activa pico | Máquina de pruebas |
+|---|---|---|---|---|
+| `edge0-35b` | 14.9–17.7 tok/s | 113 / 140 tok/s | 2.9 GiB | Mac mini M4 Pro, 24 GB |
+| `edge0-8b` | 23.9–25.3 tok/s | 500 / 1428 tok/s | 1.0 GiB | Mac mini M4 Pro, 24 GB |
+
+*Frío = primera petición tras iniciar el proceso (los pesos de expertos entran
+por fallos de página desde el SSD); caliente = peticiones posteriores
+(residentes en la caché de páginas). Las cifras de prefill son throughput sobre
+un prompt de ~3.3k tokens (`BENCH_LONG=1`).*
+
+Reproducir:
+
+```bash
+cd python
+python examples/bench.py edge0-35b # via $EDGE0_35B_MODEL
+python examples/bench.py edge0-8b # via $EDGE0_8B_MODEL
+```
+
+## Primeros pasos
+
+### Python (macOS · Apple Silicon)
+
+#### Requisitos
+
+- **SO / hardware**: el backend MLX se ejecuta en macOS con Apple Silicon
+ (M1/M2/M3/M4). El backend CUDA está en la hoja de ruta — el framework de
+ Python aún no admite otras plataformas.
+- **Python**: 3.10+ (se recomienda 3.12).
+- **MLX**: `mlx==0.30.6` / `mlx-metal==0.30.6` con `mlx-lm==0.31.0` (consulta
+ `python/pyproject.toml`). Una salida ilegible o mezclada de idiomas en Apple
+ A18 / A18 Pro indica un `mlx` antiguo: `pip install 'mlx==0.30.6'
+ 'mlx-metal==0.30.6'` ([#8](https://github.com/Edge0-AI/Edge0/issues/8)).
+- **Memoria**: ~2.9 GB de memoria activa pico para `edge0-35b`, ~1.0 GB para
+ `edge0-8b` (contextos cortos; consulta [Benchmark](#benchmark)). Añade
+ margen para el SO, el tokenizer y el crecimiento de la KV cache en contextos
+ largos.
+- **Disco**: los checkpoints de 4 bits ocupan ~23 GB (`edge0-35b`) y ~4.2 GB
+ (`edge0-8b`); los pesos de los expertos se mapean con mmap y se leen bajo
+ demanda, no se cargan en RAM por adelantado.
+
+#### 1) Instalación
+
+```bash
+cd python
+# Python >= 3.10; the MLX backend requires macOS with Apple Silicon
+python3.12 -m venv .venv && .venv/bin/pip install -e '.[dev,fetch]'
+```
+
+#### 2) Descargar un modelo
+
+Los dos niveles están publicados en Hugging Face y ModelScope — cada
+repositorio incluye el checkpoint base y los adaptadores entrenados de LoRA +
+prerouter en **un solo directorio**, de modo que una única descarga es un
+modelo listo para ejecutar:
+
+- [`Edge0/Edge0-35B-A3B-preview`](https://huggingface.co/Edge0/Edge0-35B-A3B-preview) (~23 GB) · [mirror en ModelScope](https://www.modelscope.cn/models/Edge0/Edge0-35B-A3B-preview)
+- [`Edge0/Edge0-8B-A1B-preview`](https://huggingface.co/Edge0/Edge0-8B-A1B-preview) (~4.2 GB) · [mirror en ModelScope](https://www.modelscope.cn/models/Edge0/Edge0-8B-A1B-preview)
+
+```bash
+# with the repo's helper (defaults to the two repos above):
+.venv/bin/python scripts/fetch_models.py --tier edge0-35b --target-dir models
+.venv/bin/python scripts/fetch_models.py --tier edge0-8b --target-dir models
+
+# or directly with the CLI:
+.venv/bin/huggingface-cli download Edge0/Edge0-35B-A3B-preview --local-dir models/edge0-35b
+.venv/bin/huggingface-cli download Edge0/Edge0-8B-A1B-preview --local-dir models/edge0-8b
+```
+
+De cualquier forma obtendrás un directorio así:
+
+```
+models/edge0-35b/
+├── config.json, model-*.safetensors, tokenizer files # base checkpoint
+├── lora_edge0_35b.safetensors # trained LoRA adapters
+└── prerouter_edge0_35b.safetensors # trained prerouter heads
+```
+
+#### 3) Apuntar edge0 al modelo
+
+Los nombres de nivel se resuelven a directorios locales mediante variables de
+entorno (dónde guardes la descarga depende de ti):
+
+```bash
+export EDGE0_35B_MODEL=$PWD/models/edge0-35b
+export EDGE0_8B_MODEL=$PWD/models/edge0-8b
+```
+
+O sáltate las variables de entorno y pasa el directorio directamente — el
+nivel se detecta automáticamente desde el `config.json` del checkpoint:
+
+```bash
+edge0 demo models/edge0-35b
+edge0 serve models/edge0-8b
+```
+
+#### 4) Ejecutar
+
+```bash
+# quick demo
+edge0 demo edge0-35b
+
+# serve (OpenAI-compatible /v1/chat/completions)
+edge0 serve edge0-35b
+```
+
+```bash
+curl http://127.0.0.1:8000/v1/chat/completions \
+ -H 'Content-Type: application/json' \
+ -d '{"model":"edge0-35b","messages":[{"role":"user","content":"Hello!"}],"max_tokens":32}'
+
+# 5) One-shot chat (pass --max-new to cap length; add --show-thinking to
+# print the model's reasoning block too)
+edge0 chat edge0-35b --prompt "Explain streaming inference in one sentence."
+```
+
+`python -m edge0 ...` es equivalente a `edge0 ...`.
+
+#### API de Python
+
+```python
+from edge0 import AutoEngine
+from edge0.server.chat import ChatMessage, ChatRequest, ChatSession
+
+engine = AutoEngine.from_pretrained("/path/to/model") # tier auto-detected
+req = ChatRequest(
+ model=engine.name,
+ messages=[ChatMessage(role="user", content="Hello!")],
+ max_tokens=64,
+)
+tokens, meta = ChatSession(engine, req).run()
+print(engine._tok.decode(tokens))
+engine.close() # release mmaps / expert cache
+```
+
+`python/examples/demo.py` es el mismo recorrido mínimo (`edge0 demo` ejecuta
+exactamente esta ruta).
+
+#### Modelos y adaptadores
+
+- **Checkpoint**: el directorio original del modelo (`config.json`,
+ `model*.safetensors`, tokenizer). `edge0 serve <dir>` /
+ `AutoEngine.from_pretrained(<dir>)` detectan el nivel desde `config.json`.
+- Los **adaptadores** (LoRA + prerouter, safetensors) se resuelven
+ automáticamente desde cualquiera de estas ubicaciones:
+ - el directorio del modelo (recomendado): junto a la base, p. ej.
+ `lora_edge0_35b.safetensors` + `prerouter_edge0_35b.safetensors`;
+ - `artifacts/` en la raíz del proyecto Python (ignorado por git): una caché
+ alternativa opcional para los safetensors de adaptadores que no estén
+ junto al modelo.
+- Los repositorios de modelos publicados incluyen tanto el checkpoint base
+ como la versión actual por defecto de los adaptadores, de modo que
+ `scripts/fetch_models.py` produce un directorio de modelo listo para
+ ejecutar. Consulta la página de documentación de cada modelo para conocer la
+ procedencia de sus adaptadores (datos de entrenamiento, disposición de las
+ capas propietarias).
+- Ambos adaptadores son necesarios para el pipeline prerouter + LoRA; si falta
+ un archivo, `edge0` falla con un mensaje claro (o pasa `--no-prerouter` /
+ `--no-lora` para ejecutar el modelo base simple).
+
+#### Documentación
+
+- [Arquitectura](docs/architecture.md)
+- [Atención](docs/attention.md) / [MoE](docs/moe.md) / [Streaming SSD](docs/streaming.md) / [prerouter](docs/prerouter.md)
+- [Añadir un modelo](docs/adding-a-model.md)
+- [edge0-35b](docs/models/edge0-35b.md) / [edge0-8b](docs/models/edge0-8b.md)
+- Informe técnico: [The Other Half of the Memory Wall](https://arxiv.org/abs/2609.18063) ([PDF](paper/main.pdf))
+
+### macOS / iOS / Android / Windows
+
+Los cuatro motores de plataforma son de código abierto en este repositorio —
+más detalles en el README de cada directorio:
+
+- **macOS**: CLI / demonio / aplicación de escritorio local (Rust) — consulta [`macos/README_es.md`](macos/README_es.md)
+- **iOS**: aplicación para iPhone en el dispositivo (Swift + MLX Swift) — consulta [`ios/README_es.md`](ios/README_es.md)
+- **Android**: aplicación en el dispositivo + motor nativo (Kotlin) — consulta [`android/README_es.md`](android/README_es.md)
+- **Windows**: aplicación de escritorio + motor nativo (C++ + Vulkan) — consulta [`windows/README_es.md`](windows/README_es.md)
+
+El **framework de inferencia unificado** — una única capa de acceso, con el
+runtime adaptándose automáticamente a iOS / macOS / Android / Windows /
+Python — llegará en **Q4 2026**; consulta la [Hoja de ruta](#hoja-de-ruta).
+
+## Hoja de ruta
+
+### Q4 2026
+
+**Plataformas y sistemas**
+
+- **Framework de inferencia unificado de edge0** — liberaremos
+ un framework de inferencia unificado: **una única capa de acceso
+ unificada** (una sola API para chat / serve / uso en el dispositivo), con el
+ **runtime adaptándose automáticamente a la plataforma de hardware** — iOS,
+ macOS, Android, Windows y Python. Se construye sobre los motores de
+ plataforma ya liberados en este repositorio (`ios/` · `macos/` ·
+ `android/` · `windows/`).
+- **Backend CUDA** para el framework de Python — espacio reservado en
+ `python/src/edge0/backends/cuda/`, el código principal no necesita ningún
+ cambio.
+
+**Modelos y algoritmos**
+
+Q4 trabaja en dos frentes: incorporar una arquitectura de próxima generación
+al framework y convertir el razonamiento latente en un ahorro real de latencia
+y no solo aritmético.
+
+- **Soporte de arquitectura de próxima generación (clase Qwen3.8-Flash)** —
+ ejecutar atención lineal híbrida (GDN + QSA), residual multirrama con
+ puertas y topologías de embedding N-gram en edge0. Estos diseños encajan de
+ forma natural con el streaming offload a SSD: la atención de estado O(1)
+ evita que el thinking prolongado se convierta en un problema de KV cache, y
+ las tablas N-gram de solo consulta se transmiten bajo demanda. Objetivo: que
+ el nivel se ejecute en un solo dispositivo y que los benchmarks queden a una
+ distancia aceptable de la base fp16.
+- **Thinking latente + predicción anticipada de expertos por lotes** —
+ convertir el razonamiento latente en un ahorro de *latencia*, no solo
+ aritmético. El problema central de ingeniería: mover el enrutamiento de
+ expertos de por posición a **una vez por bloque**, de modo que una sola
+ predicción cubra cada posición y ronda de un bloque y **el volumen de carga
+ de expertos se desacople del número de bucles de razonamiento** — además de
+ prefetch entre bloques que carga los expertos del siguiente bloque dentro de
+ la ventana de cómputo del bloque actual. El progreso se mide como **tiempo
+ de la fase de thinking de extremo a extremo con la misma precisión** (nunca
+ tokens/s).
+- Más niveles de modelos y versiones de adaptadores sobre el pipeline
+ existente.
+
+## Contribuir
+
+Las contribuciones son bienvenidas — issues, PRs, informes de benchmarks y
+ports de modelos, todo cuenta.
+
+**Framework de Python** (disponible ahora):
+
+```bash
+cd python
+python3.12 -m venv .venv && .venv/bin/pip install -e '.[dev,fetch]'
+
+pytest # unit tests (no real weights)
+EDGE0_8B_MODEL=/path/to/edge0-8b pytest -m slow -q
+ # real-weight generation; missing tiers are skipped
+.venv/bin/python scripts/e2e_smoke.py \
+ --qwen-dir /path/to/edge0-35b --ling-dir /path/to/edge0-8b
+ # staged vs exact consistency + generation smoke
+scripts/generate_example.py # full-pipeline API example
+examples/demo.py # minimal API walkthrough
+```
+
+CI ejecuta pruebas unitarias (macOS + MLX) y una suite de higiene del
+repositorio (sin rutas hardcodeadas, checks de límites de backend y de
+secretos) en cada PR.
+
+**Runtimes de plataforma** (macOS / iOS / Android / Windows): cada
+directorio de plataforma incluye su propia guía de compilación y pruebas
+— consulta el README de cada directorio.
+
+Flujo de trabajo: fork → rama de feature → PR contra `main`. Mantén la suite
+de higiene en verde y añade pruebas para los nuevos comportamientos.
+
+## Cita
+
+Si edge0 te resulta útil, cita nuestro informe técnico:
+
+```bibtex
+@article{lin2026other,
+ title = {The Other Half of the Memory Wall: Serving 35B MoEs from SSD
+ with Trained Routing Prediction},
+ author = {Lin, Yu and Wang, Yiming and Cai, Runyuan and Liu, Hanze and
+ Zeng, Xiaodong},
+ journal = {arXiv preprint arXiv:2609.18063},
+ year = {2026},
+ url = {https://arxiv.org/abs/2609.18063}
+}
+```
+
+## Contacto
+
+Los canales de comunidad y soporte llegarán pronto — esta sección enumerará
+las vías oficiales para contactarnos:
+
+- **Email**: [email protected]
+
+Para bugs y solicitudes de funcionalidades, usa
+[GitHub Issues](https://github.com/Edge0-AI/Edge0/issues).
+
+## Licencia
+
+Apache-2.0, incluido el código de terceros incorporado (consulta
+[NOTICE](NOTICE)).
diff --git a/README_fr.md b/README_fr.md
new file mode 100644
index 0000000..ade6b8d
--- /dev/null
+++ b/README_fr.md
@@ -0,0 +1,430 @@
+<div align="center">
+
+<img src="assets/20260908-223115.jpg" alt="edge0" width="100%">
+
+# edge0
+
+**Un framework open source d'inférence MoE en streaming — SSD expert offload + Recover-LoRA + prédiction de routage prerouter.**
+
+**Python** · **macOS** · **iOS** · **Android** — une seule recette, tous les appareils.
+
+[![Hugging Face](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Edge0--35B--A3B--preview-yellow?style=for-the-badge)](https://huggingface.co/Edge0/Edge0-35B-A3B-preview)
+[![Hugging Face](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Edge0--8B--A1B--preview-yellow?style=for-the-badge)](https://huggingface.co/Edge0/Edge0-8B-A1B-preview)
+[![ModelScope](https://img.shields.io/badge/ModelScope-Edge0--35B--A3B--preview-624AFF?style=for-the-badge)](https://www.modelscope.cn/models/Edge0/Edge0-35B-A3B-preview)
+[![ModelScope](https://img.shields.io/badge/ModelScope-Edge0--8B--A1B--preview-624AFF?style=for-the-badge)](https://www.modelscope.cn/models/Edge0/Edge0-8B-A1B-preview)
+[![arXiv](https://img.shields.io/badge/arXiv-2609.18063-B31B1B?style=for-the-badge&logo=arxiv&logoColor=white)](https://arxiv.org/abs/2609.18063)
+[![GitHub](https://img.shields.io/badge/GitHub-Edge0--AI%2FEdge0-black?style=for-the-badge&logo=github)](https://github.com/Edge0-AI/Edge0)
+[![License](https://img.shields.io/badge/License-Apache%202.0-blue?style=for-the-badge)](LICENSE)
+
+[English](README.md) | [中文](README_zh.md) | [日本語](README_ja.md) | [Español](README_es.md) | Français
+
+</div>
+
+## Actualités
+
+- **[2026-09-30]** Nous avons publié les **moteurs d'inférence edge0 pour quatre plateformes — iOS, macOS, Android et Windows** — afin d'offrir aux utilisateurs la meilleure expérience d'inférence à travers les architectures et les plateformes. Le code source est publié en open source dans ce dépôt ([`ios/`](ios/) · [`macos/`](macos/) · [`android/`](android/) · [`windows/`](windows/)) — consultez le README de chaque répertoire pour plus de détails. Le **framework d'inférence unifié** suivra au **T4 2026** ; voir la [Feuille de route](#feuille-de-route).
+- **[2026-09-20]** `--prefill-ondemand` arrive pour `edge0 demo / chat / serve` ([#112](https://github.com/Edge0-AI/Edge0/pull/112)).
+- **[2026-09-16]** Notre rapport technique est sur arXiv : [The Other Half of the Memory Wall: Serving 35B MoEs from SSD with Trained Routing Prediction](https://arxiv.org/abs/2609.18063).
+- **[2026-09-08]** Première publication open source d'**edge0**, avec les deux gammes de modèles — [`Edge0-35B-A3B-preview`](https://huggingface.co/Edge0/Edge0-35B-A3B-preview) et [`Edge0-8B-A1B-preview`](https://huggingface.co/Edge0/Edge0-8B-A1B-preview) — sur Hugging Face et ModelScope.
+
+## À propos
+
+**edge0** est un framework open source d'inférence MoE en streaming. Il
+généralise la recette éprouvée en production — **SSD expert offload +
+Recover-LoRA + prédiction de routage prerouter** — en un framework
+extensible qui exécute de grands modèles MoE creux (sparse-MoE) sur du
+matériel grand public : la mémoire de pointe est limitée par l'ensemble
+*actif* d'experts, et non par le nombre de paramètres.
+
+### Mécanismes fondamentaux
+
+- **SSD expert offload** : les poids des experts sont lus en streaming
+ depuis le stockage à la demande ; la mémoire de pointe est limitée par
+ l'ensemble actif, et non par le nombre de paramètres.
+- **Prerouter** : une tête entraînée prédit le routage des experts un pas
+ à l'avance, de sorte que les chargements d'experts chevauchent la passe
+ avant au lieu de la bloquer — **jusqu'à +59 %** de débit de decode ; le
+ gain augmente avec la latence du stockage, la taille du modèle et la
+ largeur routée *K*.
+- **Recover-LoRA** : la base int4 est gelée et les adaptateurs LoRA sont
+ entraînés par distillation depuis l'enseignant FP, récupérant
+ l'essentiel de la perte de quantification à 4 bits (voir
+ [Qualité](#qualité)). Les adaptateurs restent non fusionnés : une base
+ unique en lecture seule sert plusieurs jeux d'adaptateurs.
+
+### Plateformes
+
+Un dépôt, une recette, des runtimes par plateforme :
+
+| Plateforme | Répertoire | Stack | Statut |
+|---|---|---|---|
+| **Python** (macOS · Apple Silicon) | [`python/`](python/README_fr.md) | Python + MLX | ✅ Disponible maintenant |
+| Application et CLI **macOS** | [`macos/`](macos/README_fr.md) | Rust | ✅ Open source (2026-09-30) |
+| Application **iOS** | [`ios/`](ios/README_fr.md) | Swift + MLX Swift | ✅ Open source (2026-09-30) |
+| Application et moteur **Android** | [`android/`](android/README_fr.md) | Kotlin + moteur natif | ✅ Open source (2026-09-30) |
+| Application et moteur **Windows** | [`windows/`](windows/README_fr.md) | C++ + Vulkan | ✅ Open source (2026-09-30) |
+
+### Modèles
+
+Deux gammes de modèles sont fournies avec le framework. Chaque gamme est
+une publication complète : le checkpoint publié, les adaptateurs LoRA
+entraînés et les têtes prerouter entraînées fonctionnent ensemble comme
+une seule unité.
+
+| Gamme | Checkpoint publié | Profil d'inférence |
+|---|---|---|
+| `edge0-35b` | [`Edge0/Edge0-35B-A3B-preview`](https://huggingface.co/Edge0/Edge0-35B-A3B-preview) · [ModelScope](https://www.modelscope.cn/models/Edge0/Edge0-35B-A3B-preview) | 4-bit, 40 couches, 256 experts, prerouter K=4 |
+| `edge0-8b` | [`Edge0/Edge0-8B-A1B-preview`](https://huggingface.co/Edge0/Edge0-8B-A1B-preview) · [ModelScope](https://www.modelscope.cn/models/Edge0/Edge0-8B-A1B-preview) | 4-bit, 24 couches, 128 experts, prerouter K=8 |
+
+Les deux checkpoints sont construits à partir de modèles de base MoE creux
+open source (respectivement Qwen3.6-35B-A3B et l'hybride bailing Ling 3.0)
+et sont fournis avec l'entraînement LoRA et prerouter réalisé pour ce
+framework — les fichiers d'adaptateurs sont colocalisés avec chaque
+checkpoint et se chargent automatiquement, de sorte que
+`edge0 serve <tier>` exécute le pipeline entraîné prêt à l'emploi.
+
+### Conception
+
+- **Utilisation façon transformers** : `AutoModel` / `AutoConfig` / `AutoEngine`
+ résolvent la gamme à partir du nom du modèle ;
+- **Isolation du backend (framework Python)** : dans le framework Python,
+ tout le code MLX se trouve sous `python/src/edge0/backends/mlx/` ; la
+ logique centrale (spécifications des modèles, prerouter, pool d'experts
+ en streaming, serveur) ne dépend que de la façade du backend
+ (`backends/base.py`), de sorte qu'un nouveau backend implémente la même
+ façade (`backends/cuda/` est un emplacement réservé) sans aucune
+ modification du code central. Les moteurs iOS / macOS / Android sont
+ aujourd'hui fournis avec des stacks natives par plateforme — regrouper
+ toutes les plateformes sous une couche d'accès unique est précisément ce
+ que fournira le framework d'inférence unifié (voir la
+ [Feuille de route](#feuille-de-route)) ;
+- **Adaptateurs au format safetensors** : les poids LoRA et prerouter sont
+ des fichiers `.safetensors` avec métadonnées de provenance (source,
+ version, couches propriétaires), résolus depuis le répertoire du modèle
+ ou `artifacts/` ;
+- **Modèle + adaptateurs dans un même répertoire** : un répertoire de
+ modèle contient à la fois le checkpoint de base (`config.json` /
+ `model*.safetensors` / tokenizer) et les adaptateurs de ce modèle ; la
+ mise à niveau des adaptateurs ne remplace que les fichiers d'adaptateurs
+ — la base reste en lecture seule et n'est jamais fusionnée.
+
+### Qualité
+
+Tous les benchmarks ont été exécutés par nos soins avec
+[OpenCompass](https://github.com/open-compass/opencompass), dans des
+conditions et avec des paramètres identiques, pour les modèles edge0
+(int4 + adaptateurs entraînés + routage prerouter) et pour les modèles de
+base fp16 d'origine. La perte du pipeline edge0 est faible : **3,9 points
+en moyenne pour edge0-35b, 2,8 pour edge0-8b** (MMLU-Pro est même
+au-dessus de la base). Maximum 100 :
+
+| Benchmark | edge0-35b (int4) | Qwen3.6-35B-A3B (fp16) | edge0-8b (int4) | Ling 3.0 tiny (fp16) |
+|---|---:|---:|---:|---:|
+| AIME 2026 | 86.6 | 92.7 | 63.3 | 73.3 |
+| HumanEval | 90.9 | 95.1 | 91.5 | 92.7 |
+| GPQA-Diamond | 79.8 | 81.8 | 70.7 | 71.2 |
+| MMLU-Pro | 81.0 | 84.6 | 70.1 | 65.8 |
+| IFBench | 57.9 | 61.7 | 53.9 | 60.6 |
+| **Moyenne** | **79.2** | **83.2** | **69.9** | **72.7** |
+
+### Benchmark
+
+Mesuré avec `python/examples/bench.py` (prefill d'un prompt de 3,3 k
+tokens → 10 pas d'échauffement échantillonnés → 200 tokens de decode
+échantillonnés et chronométrés, 2 exécutions par gamme) :
+
+| Gamme | Vitesse de decode | Débit de prefill (à froid / à chaud)* | Mémoire active de pointe | Machine de test |
+|---|---|---|---|---|
+| `edge0-35b` | 14.9–17.7 tok/s | 113 / 140 tok/s | 2.9 GiB | Mac mini M4 Pro, 24 GB |
+| `edge0-8b` | 23.9–25.3 tok/s | 500 / 1428 tok/s | 1.0 GiB | Mac mini M4 Pro, 24 GB |
+
+*À froid = première requête après le démarrage du processus (les poids des
+experts arrivent depuis le SSD par défaut de page) ; à chaud = requêtes
+suivantes (page cache résident). Les chiffres de prefill sont des débits
+mesurés sur un prompt d'environ 3,3 k tokens (`BENCH_LONG=1`).*
+
+Reproduire :
+
+```bash
+cd python
+python examples/bench.py edge0-35b # via $EDGE0_35B_MODEL
+python examples/bench.py edge0-8b # via $EDGE0_8B_MODEL
+```
+
+## Démarrage rapide
+
+### Python (macOS · Apple Silicon)
+
+#### Prérequis
+
+- **OS / matériel** : le backend MLX fonctionne sur macOS avec Apple
+ Silicon (M1/M2/M3/M4). Le backend CUDA est sur la feuille de route —
+ aucune autre plateforme n'est encore prise en charge par le framework
+ Python.
+- **Python** : 3.10+ (3.12 recommandé).
+- **MLX** : `mlx==0.30.6` / `mlx-metal==0.30.6` avec `mlx-lm==0.31.0` (voir
+ `python/pyproject.toml`). Une sortie illisible ou mêlant plusieurs
+ langues sur Apple A18 / A18 Pro indique une version plus ancienne de
+ `mlx` : `pip install 'mlx==0.30.6'
+ 'mlx-metal==0.30.6'` ([#8](https://github.com/Edge0-AI/Edge0/issues/8)).
+- **Mémoire** : environ 2,9 GB de mémoire active de pointe pour
+ `edge0-35b`, environ 1,0 GB pour `edge0-8b` (contextes courts ; voir
+ [Benchmark](#benchmark)). Prévoyez de la marge pour l'OS, le tokenizer
+ et la croissance de la KV cache en contexte long.
+- **Disque** : les checkpoints 4-bit pèsent environ 23 GB (`edge0-35b`) et
+ environ 4,2 GB (`edge0-8b`) ; les poids des experts sont mmappés et lus
+ à la demande, ils ne sont pas chargés en RAM au démarrage.
+
+#### 1) Installer
+
+```bash
+cd python
+# Python >= 3.10; the MLX backend requires macOS with Apple Silicon
+python3.12 -m venv .venv && .venv/bin/pip install -e '.[dev,fetch]'
+```
+
+#### 2) Télécharger un modèle
+
+Les deux gammes sont publiées sur Hugging Face et ModelScope — chaque
+dépôt regroupe le checkpoint de base et les adaptateurs LoRA + prerouter
+entraînés dans **un seul répertoire**, de sorte qu'un unique
+téléchargement constitue un modèle prêt à l'emploi :
+
+- [`Edge0/Edge0-35B-A3B-preview`](https://huggingface.co/Edge0/Edge0-35B-A3B-preview) (~23 GB) · [Miroir ModelScope](https://www.modelscope.cn/models/Edge0/Edge0-35B-A3B-preview)
+- [`Edge0/Edge0-8B-A1B-preview`](https://huggingface.co/Edge0/Edge0-8B-A1B-preview) (~4,2 GB) · [Miroir ModelScope](https://www.modelscope.cn/models/Edge0/Edge0-8B-A1B-preview)
+
+```bash
+# with the repo's helper (defaults to the two repos above):
+.venv/bin/python scripts/fetch_models.py --tier edge0-35b --target-dir models
+.venv/bin/python scripts/fetch_models.py --tier edge0-8b --target-dir models
+
+# or directly with the CLI:
+.venv/bin/huggingface-cli download Edge0/Edge0-35B-A3B-preview --local-dir models/edge0-35b
+.venv/bin/huggingface-cli download Edge0/Edge0-8B-A1B-preview --local-dir models/edge0-8b
+```
+
+Quelle que soit la méthode, vous obtenez un répertoire comme celui-ci :
+
+```
+models/edge0-35b/
+├── config.json, model-*.safetensors, tokenizer files # base checkpoint
+├── lora_edge0_35b.safetensors # trained LoRA adapters
+└── prerouter_edge0_35b.safetensors # trained prerouter heads
+```
+
+#### 3) Pointer edge0 vers le modèle
+
+Les noms de gamme sont résolus vers des répertoires locaux via des
+variables d'environnement (l'emplacement du téléchargement est libre) :
+
+```bash
+export EDGE0_35B_MODEL=$PWD/models/edge0-35b
+export EDGE0_8B_MODEL=$PWD/models/edge0-8b
+```
+
+Ou ignorez complètement les variables d'environnement et passez
+directement le répertoire — la gamme est détectée automatiquement depuis
+le `config.json` du checkpoint :
+
+```bash
+edge0 demo models/edge0-35b
+edge0 serve models/edge0-8b
+```
+
+#### 4) Exécuter
+
+```bash
+# quick demo
+edge0 demo edge0-35b
+
+# serve (OpenAI-compatible /v1/chat/completions)
+edge0 serve edge0-35b
+```
+
+```bash
+curl http://127.0.0.1:8000/v1/chat/completions \
+ -H 'Content-Type: application/json' \
+ -d '{"model":"edge0-35b","messages":[{"role":"user","content":"Hello!"}],"max_tokens":32}'
+
+# 5) One-shot chat (pass --max-new to cap length; add --show-thinking to
+# print the model's reasoning block too)
+edge0 chat edge0-35b --prompt "Explain streaming inference in one sentence."
+```
+
+`python -m edge0 ...` est équivalent à `edge0 ...`.
+
+#### API Python
+
+```python
+from edge0 import AutoEngine
+from edge0.server.chat import ChatMessage, ChatRequest, ChatSession
+
+engine = AutoEngine.from_pretrained("/path/to/model") # tier auto-detected
+req = ChatRequest(
+ model=engine.name,
+ messages=[ChatMessage(role="user", content="Hello!")],
+ max_tokens=64,
+)
+tokens, meta = ChatSession(engine, req).run()
+print(engine._tok.decode(tokens))
+engine.close() # release mmaps / expert cache
+```
+
+`python/examples/demo.py` est le même parcours minimal (`edge0 demo`
+exécute exactement ce chemin).
+
+#### Modèles et adaptateurs
+
+- **Checkpoint** : le répertoire du modèle d'origine (`config.json`,
+ `model*.safetensors`, tokenizer). `edge0 serve <dir>` /
+ `AutoEngine.from_pretrained(<dir>)` détectent la gamme depuis
+ `config.json`.
+- Les **adaptateurs** (LoRA + prerouter, safetensors) sont résolus
+ automatiquement depuis l'un ou l'autre emplacement :
+ - le répertoire du modèle (recommandé) : à côté de la base, par exemple
+ `lora_edge0_35b.safetensors` + `prerouter_edge0_35b.safetensors` ;
+ - `artifacts/` à la racine du projet Python (ignoré par git) : un cache
+ de secours optionnel pour les safetensors d'adaptateurs non
+ colocalisés avec le modèle.
+- Les dépôts de modèles publiés regroupent à la fois le checkpoint de base
+ et la version par défaut actuelle des adaptateurs, de sorte que
+ `scripts/fetch_models.py` produit un répertoire de modèle prêt à
+ l'emploi. Consultez la page de documentation de chaque modèle pour la
+ provenance de ses adaptateurs (données d'entraînement, disposition des
+ couches propriétaires).
+- Les deux adaptateurs sont requis pour le pipeline prerouter + LoRA ; si
+ un fichier manque, `edge0` échoue avec un message clair (ou passez
+ `--no-prerouter` / `--no-lora` pour exécuter le modèle de base seul).
+
+#### Documentation
+
+- [Architecture](docs/architecture.md)
+- [Attention](docs/attention.md) / [MoE](docs/moe.md) / [Streaming SSD](docs/streaming.md) / [prerouter](docs/prerouter.md)
+- [Ajouter un modèle](docs/adding-a-model.md)
+- [edge0-35b](docs/models/edge0-35b.md) / [edge0-8b](docs/models/edge0-8b.md)
+- Rapport technique : [The Other Half of the Memory Wall](https://arxiv.org/abs/2609.18063) ([PDF](paper/main.pdf))
+
+### macOS / iOS / Android / Windows
+
+Les quatre moteurs par plateforme sont publiés en open source dans ce
+dépôt — plus de détails dans le README de chaque répertoire :
+
+- **macOS** : CLI locale / démon / application de bureau (Rust) — voir [`macos/README_fr.md`](macos/README_fr.md)
+- **iOS** : application iPhone embarquée (Swift + MLX Swift) — voir [`ios/README_fr.md`](ios/README_fr.md)
+- **Android** : application embarquée + moteur natif (Kotlin) — voir [`android/README_fr.md`](android/README_fr.md)
+- **Windows** : application de bureau + moteur natif (C++ + Vulkan) — voir [`windows/README_fr.md`](windows/README_fr.md)
+
+Le **framework d'inférence unifié** — une couche d'accès unique, un
+runtime s'adaptant automatiquement à iOS / macOS / Android / Windows /
+Python — arrivera au **T4 2026** ; voir la
+[Feuille de route](#feuille-de-route).
+
+## Feuille de route
+
+### T4 2026
+
+**Plateformes et systèmes**
+
+- **Framework d'inférence unifié edge0** — nous publierons en open source
+ un framework d'inférence unifié : **une couche d'accès unifiée** (une
+ API unique pour le chat / le serving / l'utilisation embarquée), avec le
+ **runtime s'adaptant automatiquement à la plateforme matérielle** — iOS,
+ macOS, Android, Windows et Python. Il s'appuie sur les moteurs par
+ plateforme déjà publiés en open source dans ce dépôt (`ios/` · `macos/`
+ · `android/` · `windows/`).
+- **Backend CUDA** pour le framework Python — emplacement réservé dans
+ `python/src/edge0/backends/cuda/`, le code central ne nécessite aucune
+ modification.
+
+**Modèles et algorithmes**
+
+Le T4 travaille sur deux fronts : intégrer une architecture de nouvelle
+génération dans le framework, et transformer le raisonnement latent en un
+véritable gain de latence et non seulement arithmétique.
+
+- **Prise en charge des architectures de nouvelle génération (classe
+ Qwen3.8-Flash)** — exécuter sur edge0 l'attention linéaire hybride
+ (GDN + QSA), les résidus multi-branches à portail et les topologies
+ d'embedding N-gram. Ces conceptions se prêtent naturellement au SSD
+ expert offload en streaming : l'attention à état O(1) évite que les
+ longues réflexions ne deviennent un problème de KV cache, et les tables
+ N-gram, consultables uniquement en lecture (lookup-only), se chargent en
+ streaming à la demande. Objectif : que la gamme s'exécute sur un seul
+ appareil et que les benchmarks se situent à un écart acceptable de la
+ base fp16.
+- **Raisonnement latent + pré-prédiction d'experts par lots** — faire du
+ raisonnement latent une économie de *latence*, et pas seulement
+ arithmétique. Le problème d'ingénierie central : faire passer le routage
+ des experts d'une prédiction par position à **une prédiction par bloc**,
+ afin qu'une seule prédiction couvre toutes les positions et tous les
+ tours d'un bloc et que **le volume de chargement des experts soit
+ découplé du nombre de tours de la boucle de raisonnement** — plus un
+ préchargement inter-blocs qui charge les experts du bloc suivant dans la
+ fenêtre de calcul du bloc courant. Les progrès sont mesurés en **temps
+ de phase de réflexion de bout en bout à précision égale** (jamais en
+ tokens/s).
+- Davantage de gammes de modèles et de versions d'adaptateurs sur le
+ pipeline existant.
+
+## Contribution
+
+Les contributions sont les bienvenues — issues, PR, rapports de benchmark
+et portages de modèles, tout compte.
+
+**Framework Python** (disponible maintenant) :
+
+```bash
+cd python
+python3.12 -m venv .venv && .venv/bin/pip install -e '.[dev,fetch]'
+
+pytest # unit tests (no real weights)
+EDGE0_8B_MODEL=/path/to/edge0-8b pytest -m slow -q
+ # real-weight generation; missing tiers are skipped
+.venv/bin/python scripts/e2e_smoke.py \
+ --qwen-dir /path/to/edge0-35b --ling-dir /path/to/edge0-8b
+ # staged vs exact consistency + generation smoke
+scripts/generate_example.py # full-pipeline API example
+examples/demo.py # minimal API walkthrough
+```
+
+La CI exécute les tests unitaires (macOS + MLX) et une suite d'hygiène du
+dépôt (pas de chemins codés en dur, vérification des frontières de backend
+et des secrets) sur chaque PR.
+
+**Runtimes par plateforme** (macOS / iOS / Android / Windows) : chaque
+répertoire de plateforme dispose de son propre guide de compilation et de
+ses tests — voir le README de chaque répertoire.
+
+Workflow : fork → branche de fonctionnalité → PR vers `main`. Merci de
+garder la suite d'hygiène au vert et d'ajouter des tests pour les nouveaux
+comportements.
+
+## Citation
+
+Si vous trouvez edge0 utile, merci de citer notre rapport technique :
+
+```bibtex
+@article{lin2026other,
+ title = {The Other Half of the Memory Wall: Serving 35B MoEs from SSD
+ with Trained Routing Prediction},
+ author = {Lin, Yu and Wang, Yiming and Cai, Runyuan and Liu, Hanze and
+ Zeng, Xiaodong},
+ journal = {arXiv preprint arXiv:2609.18063},
+ year = {2026},
+ url = {https://arxiv.org/abs/2609.18063}
+}
+```
+
+## Nous contacter
+
+Les canaux communautaires et d'assistance arrivent bientôt — cette section
+listera les moyens officiels de nous joindre :
+
+- **Email** : [email protected]
+
+Pour les bugs et les demandes de fonctionnalités, merci d'utiliser
+[GitHub Issues](https://github.com/Edge0-AI/Edge0/issues).
+
+## Licence
+
+Apache-2.0, y compris le code tiers intégré (voir [NOTICE](NOTICE)).
diff --git a/README_ja.md b/README_ja.md
new file mode 100644
index 0000000..d37cae2
--- /dev/null
+++ b/README_ja.md
@@ -0,0 +1,302 @@
+<div align="center">
+
+<img src="assets/20260908-223115.jpg" alt="edge0" width="100%">
+
+# edge0
+
+**オープンソースのストリーミング MoE 推論フレームワーク — SSD expert offload + Recover-LoRA + prerouter ルーティング予測。**
+
+**Python** · **macOS** · **iOS** · **Android** — 1 つのレシピで、すべてのデバイスに対応。
+
+[![Hugging Face](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Edge0--35B--A3B--preview-yellow?style=for-the-badge)](https://huggingface.co/Edge0/Edge0-35B-A3B-preview)
+[![Hugging Face](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Edge0--8B--A1B--preview-yellow?style=for-the-badge)](https://huggingface.co/Edge0/Edge0-8B-A1B-preview)
+[![ModelScope](https://img.shields.io/badge/ModelScope-Edge0--35B--A3B--preview-624AFF?style=for-the-badge)](https://www.modelscope.cn/models/Edge0/Edge0-35B-A3B-preview)
+[![ModelScope](https://img.shields.io/badge/ModelScope-Edge0--8B--A1B--preview-624AFF?style=for-the-badge)](https://www.modelscope.cn/models/Edge0/Edge0-8B-A1B-preview)
+[![arXiv](https://img.shields.io/badge/arXiv-2609.18063-B31B1B?style=for-the-badge&logo=arxiv&logoColor=white)](https://arxiv.org/abs/2609.18063)
+[![GitHub](https://img.shields.io/badge/GitHub-Edge0--AI%2FEdge0-black?style=for-the-badge&logo=github)](https://github.com/Edge0-AI/Edge0)
+[![License](https://img.shields.io/badge/License-Apache%202.0-blue?style=for-the-badge)](LICENSE)
+
+[English](README.md) | [中文](README_zh.md) | 日本語 | [Español](README_es.md) | [Français](README_fr.md)
+
+</div>
+
+## ニュース
+
+- **[2026-09-30]** **4 つのプラットフォーム — iOS、macOS、Android、Windows — 向けの edge0 推論エンジン**をリリースしました。ユーザーはアーキテクチャとプラットフォームをまたいで最適な推論体験を得られます。ソースはこのリポジトリでオープンソース化されています([`ios/`](ios/) · [`macos/`](macos/) · [`android/`](android/) · [`windows/`](windows/))— 詳細は各ディレクトリの README を参照してください。**統合推論フレームワーク**は **2026 年 Q4** に控えています。[ロードマップ](#ロードマップ)を参照。
+- **[2026-09-20]** `edge0 demo / chat / serve` に `--prefill-ondemand` が登場([#112](https://github.com/Edge0-AI/Edge0/pull/112))。
+- **[2026-09-16]** 技術レポートが arXiv に掲載: [The Other Half of the Memory Wall: Serving 35B MoEs from SSD with Trained Routing Prediction](https://arxiv.org/abs/2609.18063)。
+- **[2026-09-08]** **edge0** の初オープンソースリリース。両モデルティア — [`Edge0-35B-A3B-preview`](https://huggingface.co/Edge0/Edge0-35B-A3B-preview) と [`Edge0-8B-A1B-preview`](https://huggingface.co/Edge0/Edge0-8B-A1B-preview) — を Hugging Face と ModelScope で同時公開。
+
+## 概要
+
+**edge0** はオープンソースのストリーミング MoE 推論フレームワークです。本番で実証済みのレシピ — **SSD expert offload + Recover-LoRA + prerouter ルーティング予測** — を拡張可能なフレームワークへと一般化し、コンシューマーハードウェアで大規模スパース MoE モデルを実行します。ピークメモリは、パラメータ数ではなく*アクティブ*なエキスパート集合によって上限が決まります。
+
+### コア機構
+
+- **SSD expert offload**: エキスパートの重みは必要に応じてストレージからストリーミングされます。ピークメモリはパラメータ数ではなく、アクティブな集合によって上限が決まります。
+- **Prerouter**: 訓練済みヘッドがエキスパートルーティングを 1 ステップ先に予測するため、エキスパートのロードがフォワードパスを停滞させるのではなくオーバーラップします — デコードスループットは**最大 +59%**。ストレージレイテンシ、モデルサイズ、ルーティング幅 *K* が増すほど効果は大きくなります。
+- **Recover-LoRA**: int4 のベースは凍結され、FP 教師からの蒸留によって LoRA アダプタが訓練されることで、4-bit 時の量子化損失の大部分を回復します([品質](#品質)を参照)。アダプタはマージされません。1 つの読み取り専用ベースが複数のアダプタセットに対応します。
+
+### プラットフォーム
+
+1 つのリポジトリ、1 つのレシピ、プラットフォームごとのランタイム:
+
+| プラットフォーム | ディレクトリ | スタック | ステータス |
+|---|---|---|---|
+| **Python**(macOS · Apple Silicon) | [`python/`](python/README_ja.md) | Python + MLX | ✅ 現在利用可能 |
+| **macOS** アプリ & CLI | [`macos/`](macos/README_ja.md) | Rust | ✅ オープンソース化(2026-09-30) |
+| **iOS** アプリ | [`ios/`](ios/README_ja.md) | Swift + MLX Swift | ✅ オープンソース化(2026-09-30) |
+| **Android** アプリ & エンジン | [`android/`](android/README_ja.md) | Kotlin + ネイティブエンジン | ✅ オープンソース化(2026-09-30) |
+| **Windows** アプリ & エンジン | [`windows/`](windows/README_ja.md) | C++ + Vulkan | ✅ オープンソース化(2026-09-30) |
+
+### モデル
+
+フレームワークには 2 つのモデルティアが付属します。各ティアはエンドツーエンドのリリースであり、公開されるチェックポイント、訓練済み LoRA アダプタ、訓練済み prerouter ヘッドが 1 つの単位として機能します。
+
+| ティア | 公開チェックポイント | 推論プロファイル |
+|---|---|---|
+| `edge0-35b` | [`Edge0/Edge0-35B-A3B-preview`](https://huggingface.co/Edge0/Edge0-35B-A3B-preview) · [ModelScope](https://www.modelscope.cn/models/Edge0/Edge0-35B-A3B-preview) | 4-bit、40 層、256 エキスパート、prerouter K=4 |
+| `edge0-8b` | [`Edge0/Edge0-8B-A1B-preview`](https://huggingface.co/Edge0/Edge0-8B-A1B-preview) · [ModelScope](https://www.modelscope.cn/models/Edge0/Edge0-8B-A1B-preview) | 4-bit、24 層、128 エキスパート、prerouter K=8 |
+
+両方のチェックポイントともオープンのスパース MoE ベースモデル(それぞれ Qwen3.6-35B-A3B と Ling 3.0 bailing hybrid)上に構築されており、本フレームワークのために実施された LoRA と prerouter の訓練成果物を同梱しています — アダプタファイルは各チェックポイントと同じ場所に配置され、自動的にロードされるため、`edge0 serve <tier>` はすぐさま訓練済みパイプラインを実行できます。
+
+### 設計
+
+- **transformers スタイルの使い方**: `AutoModel` / `AutoConfig` / `AutoEngine` がモデル名からティアを解決します。
+- **バックエンド分離(Python フレームワーク)**: Python フレームワーク内では、すべての MLX コードは `python/src/edge0/backends/mlx/` 配下に置かれます。コアロジック(モデル仕様、prerouter、ストリーミングエキスパートプール、サーバー)はバックエンドファサード(`backends/base.py`)にのみ依存するため、新しいバックエンドは同じファサードを実装するだけで済み(`backends/cuda/` は予約スロット)、コアコードの変更はゼロです。iOS / macOS / Android エンジンは現在プラットフォームネイティブのスタックで提供されています — すべてのプラットフォームを 1 つのアクセス層の下にまとめることこそ、統合推論フレームワーク([ロードマップ](#ロードマップ)を参照)が実現するものです。
+- **safetensors 形式のアダプタ**: LoRA と prerouter の重みは、来歴メタデータ(source、version、owner layers)付きの `.safetensors` ファイルであり、モデルディレクトリまたは `artifacts/` から解決されます。
+- **モデル + アダプタを 1 つのディレクトリに**: モデルディレクトリには、ベースチェックポイント(`config.json` / `model*.safetensors` / トークナイザー)とそのモデルのアダプタの両方が格納されます。アダプタのアップグレードはアダプタファイルの交換のみ — ベースは読み取り専用のままで、決してマージされません。
+
+### 品質
+
+すべてのベンチマークは、edge0 モデル(int4 + 訓練済みアダプタ + prerouter ルーティング)とオリジナルの fp16 ベースモデルの両方について、同一の設定とパラメータで [OpenCompass](https://github.com/open-compass/opencompass) を使って私たち自身が実行しました。edge0 パイプラインの損失は小さく、**edge0-35b で平均 3.9 ポイント、edge0-8b で 2.8 ポイント**です(MMLU-Pro はベースを上回ります)。満点 100:
+
+| ベンチマーク | edge0-35b (int4) | Qwen3.6-35B-A3B (fp16) | edge0-8b (int4) | Ling 3.0 tiny (fp16) |
+|---|---:|---:|---:|---:|
+| AIME 2026 | 86.6 | 92.7 | 63.3 | 73.3 |
+| HumanEval | 90.9 | 95.1 | 91.5 | 92.7 |
+| GPQA-Diamond | 79.8 | 81.8 | 70.7 | 71.2 |
+| MMLU-Pro | 81.0 | 84.6 | 70.1 | 65.8 |
+| IFBench | 57.9 | 61.7 | 53.9 | 60.6 |
+| **平均** | **79.2** | **83.2** | **69.9** | **72.7** |
+
+### ベンチマーク
+
+`python/examples/bench.py` で測定(3.3k トークンのプロンプトのプリフィル → サンプリングによるウォームアップ 10 ステップ → 計測付きのサンプリングデコード 200 トークン、ティアごとに 2 回実行):
+
+| ティア | デコード速度 | プリフィルスループット(コールド / ウォーム)* | ピークアクティブメモリ | テストマシン |
+|---|---|---|---|---|
+| `edge0-35b` | 14.9–17.7 tok/s | 113 / 140 tok/s | 2.9 GiB | Mac mini M4 Pro, 24 GB |
+| `edge0-8b` | 23.9–25.3 tok/s | 500 / 1428 tok/s | 1.0 GiB | Mac mini M4 Pro, 24 GB |
+
+*コールド = プロセス起動後の最初のリクエスト(エキスパートの重みが SSD からフォールトインする);ウォーム = 以降のリクエスト(ページキャッシュに常駐)。プリフィルの数値は約 3.3k トークンのプロンプトに対するスループット(`BENCH_LONG=1`)。*
+
+再現手順:
+
+```bash
+cd python
+python examples/bench.py edge0-35b # via $EDGE0_35B_MODEL
+python examples/bench.py edge0-8b # via $EDGE0_8B_MODEL
+```
+
+## はじめに
+
+### Python(macOS · Apple Silicon)
+
+#### 要件
+
+- **OS / ハードウェア**: MLX バックエンドは Apple Silicon(M1/M2/M3/M4)搭載の macOS で動作します。CUDA バックエンドはロードマップ上にあります — Python フレームワークはまだ他のプラットフォームをサポートしていません。
+- **Python**: 3.10+(3.12 推奨)。
+- **MLX**: `mlx==0.30.6` / `mlx-metal==0.30.6` と `mlx-lm==0.31.0`(`python/pyproject.toml` を参照)。Apple A18 / A18 Pro で文字化けした言語混在の出力が発生する場合、古い `mlx` が原因です: `pip install 'mlx==0.30.6' 'mlx-metal==0.30.6'`([#8](https://github.com/Edge0-AI/Edge0/issues/8))。
+- **メモリ**: `edge0-35b` でピークアクティブメモリ約 2.9 GB、`edge0-8b` で約 1.0 GB(短いコンテキストの場合;[ベンチマーク](#ベンチマーク)を参照)。OS、トークナイザー、長いコンテキストでの KV キャッシュの増加のための余裕を上乗せしてください。
+- **ディスク**: 4-bit チェックポイントは約 23 GB(`edge0-35b`)と約 4.2 GB(`edge0-8b`)です。エキスパートの重みは mmap されてオンデマンドで読み取られ、事前に RAM へロードされることはありません。
+
+#### 1) インストール
+
+```bash
+cd python
+# Python >= 3.10; the MLX backend requires macOS with Apple Silicon
+python3.12 -m venv .venv && .venv/bin/pip install -e '.[dev,fetch]'
+```
+
+#### 2) モデルのダウンロード
+
+2 つのティアは Hugging Face と ModelScope で公開されています — 各リポジトリは、ベースチェックポイントと訓練済み LoRA + prerouter アダプタを**1 つのディレクトリ**にまとめており、1 回のダウンロードですぐ実行できるモデルが揃います:
+
+- [`Edge0/Edge0-35B-A3B-preview`](https://huggingface.co/Edge0/Edge0-35B-A3B-preview)(~23 GB)· [ModelScope ミラー](https://www.modelscope.cn/models/Edge0/Edge0-35B-A3B-preview)
+- [`Edge0/Edge0-8B-A1B-preview`](https://huggingface.co/Edge0/Edge0-8B-A1B-preview)(~4.2 GB)· [ModelScope ミラー](https://www.modelscope.cn/models/Edge0/Edge0-8B-A1B-preview)
+
+```bash
+# with the repo's helper (defaults to the two repos above):
+.venv/bin/python scripts/fetch_models.py --tier edge0-35b --target-dir models
+.venv/bin/python scripts/fetch_models.py --tier edge0-8b --target-dir models
+
+# or directly with the CLI:
+.venv/bin/huggingface-cli download Edge0/Edge0-35B-A3B-preview --local-dir models/edge0-35b
+.venv/bin/huggingface-cli download Edge0/Edge0-8B-A1B-preview --local-dir models/edge0-8b
+```
+
+どちらの方法でも、次のようなディレクトリが得られます:
+
+```
+models/edge0-35b/
+├── config.json, model-*.safetensors, tokenizer files # base checkpoint
+├── lora_edge0_35b.safetensors # trained LoRA adapters
+└── prerouter_edge0_35b.safetensors # trained prerouter heads
+```
+
+#### 3) edge0 にモデルを指定する
+
+ティア名は環境変数を通じてローカルディレクトリに解決されます(ダウンロード先は自由です):
+
+```bash
+export EDGE0_35B_MODEL=$PWD/models/edge0-35b
+export EDGE0_8B_MODEL=$PWD/models/edge0-8b
+```
+
+環境変数を完全に省略して、ディレクトリを直接渡すこともできます — ティアはチェックポイントの `config.json` から自動検出されます:
+
+```bash
+edge0 demo models/edge0-35b
+edge0 serve models/edge0-8b
+```
+
+#### 4) 実行
+
+```bash
+# quick demo
+edge0 demo edge0-35b
+
+# serve (OpenAI-compatible /v1/chat/completions)
+edge0 serve edge0-35b
+```
+
+```bash
+curl http://127.0.0.1:8000/v1/chat/completions \
+ -H 'Content-Type: application/json' \
+ -d '{"model":"edge0-35b","messages":[{"role":"user","content":"Hello!"}],"max_tokens":32}'
+
+# 5) One-shot chat (pass --max-new to cap length; add --show-thinking to
+# print the model's reasoning block too)
+edge0 chat edge0-35b --prompt "Explain streaming inference in one sentence."
+```
+
+`python -m edge0 ...` は `edge0 ...` と等価です。
+
+#### Python API
+
+```python
+from edge0 import AutoEngine
+from edge0.server.chat import ChatMessage, ChatRequest, ChatSession
+
+engine = AutoEngine.from_pretrained("/path/to/model") # tier auto-detected
+req = ChatRequest(
+ model=engine.name,
+ messages=[ChatMessage(role="user", content="Hello!")],
+ max_tokens=64,
+)
+tokens, meta = ChatSession(engine, req).run()
+print(engine._tok.decode(tokens))
+engine.close() # release mmaps / expert cache
+```
+
+`python/examples/demo.py` も同じ最小限のウォークスルーです(`edge0 demo` はまさにこのパスを実行します)。
+
+#### モデルとアダプタ
+
+- **チェックポイント**: 元のモデルディレクトリ(`config.json`、`model*.safetensors`、トークナイザー)。`edge0 serve <dir>` / `AutoEngine.from_pretrained(<dir>)` は `config.json` からティアを検出します。
+- **アダプタ**(LoRA + prerouter、safetensors)は、次のいずれかの場所から自動的に解決されます:
+ - モデルディレクトリ(推奨): ベースと同じ場所。例: `lora_edge0_35b.safetensors` + `prerouter_edge0_35b.safetensors`
+ - Python プロジェクトルートの `artifacts/`(gitignore 済み): モデルと同じ場所にないアダプタ safetensors のための、オプションのフォールバックキャッシュ。
+- 公開されているモデルリポジトリには、ベースチェックポイントと現在のデフォルトのアダプタリリースの両方が同梱されているため、`scripts/fetch_models.py` はすぐ実行できるモデルディレクトリを生成します。アダプタの来歴(訓練データ、owner-layer レイアウト)は各モデルのドキュメントページで確認してください。
+- prerouter + LoRA パイプラインには両方のアダプタが必要です。ファイルが不足している場合、`edge0` は明確なメッセージとともに失敗します(あるいは `--no-prerouter` / `--no-lora` を渡せば、素のベースモデルを実行できます)。
+
+#### ドキュメント
+
+- [アーキテクチャ](docs/architecture.md)
+- [アテンション](docs/attention.md) / [MoE](docs/moe.md) / [SSD ストリーミング](docs/streaming.md) / [prerouter](docs/prerouter.md)
+- [モデルの追加](docs/adding-a-model.md)
+- [edge0-35b](docs/models/edge0-35b.md) / [edge0-8b](docs/models/edge0-8b.md)
+- 技術レポート: [The Other Half of the Memory Wall](https://arxiv.org/abs/2609.18063)([PDF](paper/main.pdf))
+
+### macOS / iOS / Android / Windows
+
+4 つのプラットフォームエンジンはこのリポジトリでオープンソース化されています — 詳細は各ディレクトリの README を参照してください:
+
+- **macOS**: ローカル CLI / デーモン / デスクトップアプリ(Rust)— [`macos/README_ja.md`](macos/README_ja.md) を参照
+- **iOS**: オンデバイス iPhone アプリ(Swift + MLX Swift)— [`ios/README_ja.md`](ios/README_ja.md) を参照
+- **Android**: オンデバイスアプリ + ネイティブエンジン(Kotlin)— [`android/README_ja.md`](android/README_ja.md) を参照
+- **Windows**: デスクトップアプリ + ネイティブエンジン(C++ + Vulkan)— [`windows/README_ja.md`](windows/README_ja.md) を参照
+
+**統合推論フレームワーク** — 1 つのアクセス層、iOS / macOS / Android / Windows / Python へ自動適応するランタイム — は **2026 年 Q4** に登場します。[ロードマップ](#ロードマップ)を参照。
+
+## ロードマップ
+
+### 2026 年 Q4
+
+**プラットフォーム & システム**
+
+- **edge0 統合推論フレームワーク** — 統合推論フレームワークをオープンソース化します: **1 つの統一アクセス層**(chat / serve / オンデバイス利用を横断する単一 API)を備え、**ランタイムがハードウェアプラットフォームへ自動適応**します — iOS、macOS、Android、Windows、Python。このリポジトリですでにオープンソース化されているプラットフォームエンジン(`ios/` · `macos/` · `android/` · `windows/`)の上に構築されます。
+- Python フレームワーク向け **CUDA バックエンド** — `python/src/edge0/backends/cuda/` に予約スロットがあり、コアコードの変更はゼロです。
+
+**モデル & アルゴリズム**
+
+Q4 は 2 つの前線で進めます: 次世代アーキテクチャをフレームワークに取り込むこと、そして潜在推論を単なる算術上の削減ではなく実際のレイテンシ削減に変えることです。
+
+- **次世代アーキテクチャのサポート(Qwen3.8-Flash クラス)** — ハイブリッド線形アテンション(GDN + QSA)、ゲート付きマルチブランチ残差、N-gram 埋め込みトポロジを edge0 で実行します。これらの設計は SSD ストリーミングオフロードと自然に相性が良いものです: O(1) 状態のアテンションにより長い思考が KV キャッシュの問題になるのを防ぎ、ルックアップのみの N-gram テーブルはオンデマンドでストリーミングされます。目標: そのティアが単一デバイスで動作し、ベンチマークが fp16 ベースに対して許容可能な差に収まること。
+- **潜在 thinking + バッチ化されたエキスパート事前予測** — 潜在推論を、単なる算術上の削減ではなく*レイテンシ*の削減にします。コアとなるエンジニアリング課題: エキスパートルーティングを位置ごとから**ブロックごとに 1 回**へ移行し、1 回の予測がブロック内のすべての位置とラウンドをカバーすることで、**エキスパートのロード量を推論ループの回数から切り離す**こと — さらに、現在のブロックの計算ウィンドウ内で次のブロックのエキスパートをロードするクロスブロックプリフェッチも加えます。進捗は**同一精度でのエンドツーエンドの thinking フェーズ時間**で測定します(決して tokens/s では測りません)。
+- 既存パイプラインにおける、さらなるモデルティアとアダプタのリリース。
+
+## コントリビュート
+
+コントリビューションを歓迎します — issue、PR、ベンチマークレポート、モデルポート、すべてが対象です。
+
+**Python フレームワーク**(現在利用可能):
+
+```bash
+cd python
+python3.12 -m venv .venv && .venv/bin/pip install -e '.[dev,fetch]'
+
+pytest # unit tests (no real weights)
+EDGE0_8B_MODEL=/path/to/edge0-8b pytest -m slow -q
+ # real-weight generation; missing tiers are skipped
+.venv/bin/python scripts/e2e_smoke.py \
+ --qwen-dir /path/to/edge0-35b --ling-dir /path/to/edge0-8b
+ # staged vs exact consistency + generation smoke
+scripts/generate_example.py # full-pipeline API example
+examples/demo.py # minimal API walkthrough
+```
+
+CI はすべての PR で、ユニットテスト(macOS + MLX)とリポジトリ衛生スイート(ハードコードされたパスの禁止、バックエンド境界とシークレットのチェック)を実行します。
+
+**プラットフォームランタイム**(macOS / iOS / Android / Windows): 各プラットフォームのディレクトリには独自のビルドガイドとテストが含まれています——各ディレクトリの README を参照してください。
+
+ワークフロー: fork → フィーチャーブランチ → `main` への PR。衛生スイートをグリーンのまま保ち、新しい動作にはテストを追加してください。
+
+## 引用
+
+edge0 が役に立った場合は、私たちの技術レポートを引用してください:
+
+```bibtex
+@article{lin2026other,
+ title = {The Other Half of the Memory Wall: Serving 35B MoEs from SSD
+ with Trained Routing Prediction},
+ author = {Lin, Yu and Wang, Yiming and Cai, Runyuan and Liu, Hanze and
+ Zeng, Xiaodong},
+ journal = {arXiv preprint arXiv:2609.18063},
+ year = {2026},
+ url = {https://arxiv.org/abs/2609.18063}
+}
+```
+
+## お問い合わせ
+
+コミュニティとサポートのチャネルは近日公開予定です — このセクションに、私たちへの公式の連絡方法を掲載します:
+
+- **メール**: [email protected]
+
+バグと機能リクエストには、[GitHub Issues](https://github.com/Edge0-AI/Edge0/issues) をご利用ください。
+
+## ライセンス
+
+Apache-2.0。ベンダー化されたサードパーティコードを含みます([NOTICE](NOTICE) を参照)。
diff --git a/README_zh.md b/README_zh.md
index da25752..328fb5e 100644
--- a/README_zh.md
+++ b/README_zh.md
@@ -16,7 +16,7 @@
[![GitHub](https://img.shields.io/badge/GitHub-Edge0--AI%2FEdge0-black?style=for-the-badge&logo=github)](https://github.com/Edge0-AI/Edge0)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue?style=for-the-badge)](LICENSE)
-[English](README.md) | 中文
+[English](README.md) | 中文 | [日本語](README_ja.md) | [Español](README_es.md) | [Français](README_fr.md)
</div>
@@ -60,11 +60,11 @@ MoE 模型跑在消费级硬件上——峰值内存由**激活**专家集而非
| 平台 | 目录 | 技术栈 | 状态 |
|---|---|---|---|
-| **Python**(macOS · Apple Silicon) | [`python/`](python/) | Python + MLX | ✅ 现已可用 |
-| **macOS** 桌面 App 与 CLI | [`macos/`](macos/) | Rust | ✅ 已开源(2026-09-30) |
-| **iOS** App | [`ios/`](ios/) | Swift + MLX Swift | ✅ 已开源(2026-09-30) |
-| **Android** App 与引擎 | [`android/`](android/) | Kotlin + 原生引擎 | ✅ 已开源(2026-09-30) |
-| **Windows** App 与引擎 | [`windows/`](windows/) | C++ + Vulkan | ✅ 已开源(2026-09-30) |
+| **Python**(macOS · Apple Silicon) | [`python/`](python/README_zh.md) | Python + MLX | ✅ 现已可用 |
+| **macOS** 桌面 App 与 CLI | [`macos/`](macos/README_zh.md) | Rust | ✅ 已开源(2026-09-30) |
+| **iOS** App | [`ios/`](ios/README_zh.md) | Swift + MLX Swift | ✅ 已开源(2026-09-30) |
+| **Android** App 与引擎 | [`android/`](android/README_zh.md) | Kotlin + 原生引擎 | ✅ 已开源(2026-09-30) |
+| **Windows** App 与引擎 | [`windows/`](windows/README_zh.md) | C++ + Vulkan | ✅ 已开源(2026-09-30) |
### 模型
@@ -278,13 +278,13 @@ engine.close() # 释放 mmap / 专家缓存
四端推理引擎已开源在本仓库,更多细节见各目录 README:
- **macOS**:本地 CLI / daemon / 桌面 App(Rust)—— 详见
- [`macos/README.md`](macos/README.md)
+ [`macos/README_zh.md`](macos/README_zh.md)
- **iOS**:iPhone 端侧 App(Swift + MLX Swift)—— 详见
- [`ios/README.md`](ios/README.md)
+ [`ios/README_zh.md`](ios/README_zh.md)
- **Android**:端侧 App + 原生引擎(Kotlin)—— 详见
- [`android/README.md`](android/README.md)
+ [`android/README_zh.md`](android/README_zh.md)
- **Windows**:桌面 App + 原生引擎(C++ + Vulkan)—— 详见
- [`windows/README.md`](windows/README.md)
+ [`windows/README_zh.md`](windows/README_zh.md)
**统一推理框架**(接入层统一,runtime 自动适配 iOS / macOS / Android /
Windows / Python)将于 **2026 Q4** 发布,见[路线图](#路线图)。
@@ -343,8 +343,8 @@ examples/demo.py # 最小 API walkthrough(edge0 demo 的等价代
每个 PR 都会跑 CI:单元测试(macOS + MLX)与仓库卫生检查(无硬编码
路径、后端边界、无密钥)。
-**平台 runtime**(macOS / iOS / Android):目前是占位目录,贡献指南将
-随统一框架代码一并发布。
+**平台 runtime**(macOS / iOS / Android / Windows):各平台目录自带
+构建指南与测试——见各目录 README。
流程:fork → 功能分支 → 向 `main` 发 PR。请保持卫生检查通过,并为新
行为补测试。
diff --git a/android/README.md b/android/README.md
index af27957..ee9197c 100644
--- a/android/README.md
+++ b/android/README.md
@@ -1,5 +1,7 @@
# edge0-android — Release Build Guide
+English | [中文](README_zh.md) | [日本語](README_ja.md) | [Español](README_es.md) | [Français](README_fr.md)
+
This document is for **developers building or evaluating the Android app from source**. It covers: quick start (engine → app → models → test), measured performance on the reference device, and the technical choices behind the stack.
edge0 is published as a **monorepo** — [`Edge0-AI/edge0`](https://github.com/Edge0-AI/edge0) — whose top level holds the shared engine supply (`vendor.llama.pin` + the scripts-materialized `vendor/llama.cpp`, `patches/llama.cpp/` band-sets) and the platform subprojects (`windows/` = the desktop companion, `android/` = this app). Inference runs on pinned upstream llama.cpp, patched as a replayable patch set, fully on-CPU with ARM-NEON kernels and a demand-paged expert pool.
diff --git a/android/README_es.md b/android/README_es.md
new file mode 100644
index 0000000..ef65486
--- /dev/null
+++ b/android/README_es.md
@@ -0,0 +1,191 @@
+# edge0-android — Guía de compilación de release
+
+[English](README.md) | [中文](README_zh.md) | [日本語](README_ja.md) | Español | [Français](README_fr.md)
+
+Este documento está dirigido a **desarrolladores que compilan o evalúan la aplicación de Android desde el código fuente**. Cubre: inicio rápido (motor → aplicación → modelos → pruebas), rendimiento medido en el dispositivo de referencia y las decisiones técnicas detrás del stack.
+
+edge0 se publica como **monorepo** — [`Edge0-AI/edge0`](https://github.com/Edge0-AI/edge0) — cuyo nivel superior contiene el suministro compartido del motor (`vendor.llama.pin` + el `vendor/llama.cpp` materializado por los scripts, los conjuntos de bandas de `patches/llama.cpp/`) y los subproyectos de plataforma (`windows/` = el complemento de escritorio, `android/` = esta aplicación). La inferencia se ejecuta sobre una versión fijada (pin) de llama.cpp upstream, parcheada como un conjunto de parches reejecutable, totalmente en CPU con kernels ARM-NEON y un pool de expertos paginado bajo demanda.
+
+Atribución de terceros: consulta `NOTICE` en este directorio. Fichas de modelo: [Edge0/Edge0-8B-A1B-preview](https://huggingface.co/Edge0/Edge0-8B-A1B-preview) · [Edge0/Edge0-35B-A3B-preview](https://huggingface.co/Edge0/Edge0-35B-A3B-preview).
+
+---
+
+## 1. Inicio rápido
+
+### 1.1 Requisitos previos
+
+| componente | requisito |
+|---|---|
+| Dispositivo | arm64-v8a, Android 13+ (API 33); se recomienda un Snapdragon 8 Elite o similar |
+| RAM | 8 GB+ ejecuta 8B; 12–16 GB ejecuta 35B (paginación de expertos, ver §3.2) |
+| Toolchain | JDK 17+, Android SDK 35, **NDK r28** (`28.2.13676358`), CMake ≥ 3.21 + Ninja |
+| Python | 3.10+ con `numpy` (conversor de modelos, se ejecuta desde el `windows/tools` hermano) |
+| Disco | ≥ 30 GB libres para las fuentes de los modelos y las compilaciones GGUF convertidas |
+
+El NDK **no** forma parte de este repositorio — instálalo una vez (Android Studio:
+*Android SDK → SDK Tools → NDK (Side by side)*, o mediante CLI):
+
+```bash
+sdkmanager --install "ndk;28.2.13676358"
+```
+
+Después apunta la compilación hacia él con `NDK_DIR` (o una variable `ANDROID_NDK_HOME`
+exportada): `build_vendor_libs.sh` lee la toolchain del compilador **y** el runtime
+`libomp.so` que prepara (§1.2) desde dentro de esa instalación del NDK; si falta el NDK,
+falla rápidamente con esa indicación en lugar de producir un conjunto de bibliotecas
+defectuoso.
+
+### 1.2 Compilar el motor
+
+Las bibliotecas nativas provienen del árbol upstream fijado con las bandas de parches de
+esta plataforma reejecutadas en un worktree aislado — el árbol del vendor **nunca** se
+parchea in situ:
+
+```bash
+git clone https://github.com/Edge0-AI/edge0
+cd edge0/android
+bash tools/llama/build_vendor_libs.sh
+```
+
+El script reejecuta `../patches/llama.cpp/{common,android}` (6 + 14 bandas) sobre el árbol
+fijado de llama.cpp — el pin está en `../vendor.llama.pin` (actualmente `7ab4ee7`, tag
+b11100); el árbol **no** es un submódulo, así que en la primera ejecución se clona desde
+upstream en `../vendor/llama.cpp` (ignorado por git; establece `EDGE0_LLAMA_URL` para usar
+un mirror) y se hace detach en el pin. Las reejecuciones ocurren en un worktree consumidor
+ignorado por git, el script verifica el hash golden del árbol de resultado y produce las
+cuatro bibliotecas compartidas del motor (más el runtime `libomp.so` del NDK que
+`libggml-cpu` necesita) con las cabeceras en `build-dl/llama-libs/` (el punto de
+preparación de jniLibs de la aplicación). `--replay` vuelve a aplicar las bandas tras
+cambios en los parches; árbol discordante ⇒ ROJO, la compilación se niega a empezar. Este
+paso es necesario una vez antes de compilar la aplicación — el plugin de Gradle lee estas
+bibliotecas desde `build-dl/llama-libs/`.
+
+### 1.3 Compilar e instalar la aplicación
+
+```bash
+./gradlew :app:assembleDebug
+./gradlew :app:installDebug # or adb install -r app/build/outputs/apk/debug/app-debug.apk
+```
+
+### 1.4 Modelos
+
+Las compilaciones GGUF se producen localmente a partir de los checkpoints publicados —
+todo permanece en el `models/` de este directorio (ignorado por git):
+
+```bash
+huggingface-cli download Edge0/Edge0-8B-A1B-preview --local-dir models/edge0-8b
+python ../windows/tools/convert_mlx_to_gguf.py --dir models/edge0-8b
+# → models/edge0-8b-gguf/{edge0-8b.gguf, lora_edge0_8b-gguf.gguf, manifest.json}
+
+huggingface-cli download Edge0/Edge0-35B-A3B-preview --local-dir models/edge0-35b
+python ../windows/tools/convert_mlx_to_gguf.py --dir models/edge0-35b
+
+bash tools/model/push_models.sh --all # md5-gated staging onto the device
+```
+
+El conversor solo necesita python3 + numpy (sin runtime MLX/torch — «MLX» denota la
+disposición en disco del checkpoint). Ejecuta el reempaquetado r3 con puertas de paridad
+numérica y emite un manifiesto sha256; una conversión correcta reproduce byte a byte las
+sumas de verificación de referencia listadas en `push_models.sh`. Los modelos también se
+pueden copiar a `files/models/` con el selector de la aplicación.
+
+### 1.5 Ejecución
+
+Inicia **Edge0 Chat**. La barra de título muestra el modelo activo (8B / 35B), el botón
+superior derecho lo cambia. El compositor solo envía; la temperatura, el thinking y el
+system prompt están en los ajustes del panel lateral. Cada respuesta lleva una línea de
+métricas integrada: `tokens · TTFT · prefill t/s · decode t/s · RSS`.
+
+### 1.6 Probarlo
+
+Regresión instrumentada (requiere ambos modelos preparados — reinstalar el APK de prueba
+borra los datos de la aplicación, así que vuelve a prepararlos justo antes de la
+ejecución):
+
+```bash
+./gradlew :app:installDebugAndroidTest
+bash tools/model/push_models.sh --all
+adb shell am instrument -w -e class dev.edge0.runtime.app.LlamaRuntimeTest \
+ dev.edge0.runtime.app.test/androidx.test.runner.AndroidJUnitRunner
+# expected: OK (8 tests), ~7 min on the reference device
+```
+
+Cobertura: smoke de 8B/35B, cambio en el proceso 35B↔8B, fidelidad de la reutilización de
+prefijos, cuadrantes de thinking activado/desactivado × system prompt (puerta 8B + prueba
+de fuga con 35B desactivado) y retención de identidad en el renderizado multiturno.
+Pruebas de lógica del lado del host: `./gradlew :app:testDebugUnitTest` (26 pruebas, sin
+necesidad de dispositivo).
+
+---
+
+## 2. Rendimiento
+
+Dispositivo de referencia: **Lenovo TB322FC (Snapdragon 8 Elite, 16 GB de RAM)**,
+configuración de serie, ventanas sostenidas (los primeros segmentos = relojes de boost, la
+cola = estado estacionario térmico — se reportan ambos en lugar de picos seleccionados a
+dedo).
+
+| Modelo | TTFT (turno caliente) | Decode | Prefill | RSS de sesión |
+|---|---:|---:|---:|---:|
+| **8B** (GGUF clase Q8 + LoRA) | ≈ 1.4 s | 29–32 → ~10 t/s en una ventana de 480 s | ~100 t/s | ≈ 250 MB |
+| **35B** (MoE int8 mixto, paginado bajo demanda) | ≈ 1.1 s caliente (≈ 10–15 s en el primer turno de un tema nuevo — pool de expertos frío, limitado por flash) | 6–9 t/s en la aplicación (9.46 t/s sostenidos en CLI) | ~1 s por turno incremental | presupuesto del pool 2–6 GB; residente ≪ tamaño del archivo |
+
+Notas: el «primer turno de un tema nuevo» paga el costo del pool frío — p. ej., una
+pregunta de 55 tokens midió un prefill de 12.8 s con 25956 cargas de expertos, el 73 % del
+tiempo real en espera de E/S de flash; eso es la paginación bajo demanda funcionando según
+lo diseñado, no una regresión. Desde el segundo turno todo está caliente: la reutilización
+de prefijos KV + el refill keepwarm llevan el TTFT a ~1 s. El descenso del decode a lo
+largo de una ventana larga es comportamiento DVFS/térmico en este SoC.
+
+---
+
+## 3. Detalles técnicos
+
+### 3.1 Arquitectura
+
+```mermaid
+graph TD
+ subgraph App ["Kotlin / Jetpack Compose"]
+ UI[ChatScreen · dark · send-only composer] --> VM[ChatViewModel]
+ VM --> RT[LlamaRuntime<br/>coroutines + Flow events]
+ VM --> DB[(Room · threads & messages)]
+ ST[SettingsStore] --> VM
+ end
+ subgraph Native ["C JNI shell (llama_chat.c)"]
+ SHELL[generate loop · template-aware thinking control<br/>segment-wise history render · UTF-8-safe streaming]
+ end
+ subgraph Engine ["patched llama.cpp @ b11100 · arm64 CPU-only"]
+ LLIB[libllama.so]
+ GCPU[libggml-cpu.so<br/>NEON kernels + moe_pool]
+ end
+ RT -->|JNI| SHELL --> LLIB --> GCPU
+ GCPU -->|demand-paged expert IO| MODELS[GGUF on flash]
+```
+
+### 3.2 Por qué un MoE de 21.7 GB cabe en un teléfono — `moe_pool`
+
+El modelo de 35B solo activa un subconjunto móvil de sus 256 expertos por capa en cada
+token, así que el diseño de serie pagina los expertos **bajo demanda** desde la flash en
+lugar de la memoria residente (`ggml/src/ggml-cpu/moe_pool.c`, desarrollado como la banda
+android de 14 parches): frames privados copy-in, una máquina de estados de slots iguales,
+colas de preparación de E/S en segundo plano ajustadas al throughput UFS medido, controles
+de pin/blob/trim, un refill keepwarm al final del turno dentro de un presupuesto de bytes y
+un reinicio completo entre modelos que permite cambiar de 8B↔35B dentro de un mismo
+proceso. Con el pool desactivado, el motor resuelve las filas de expertos exactamente igual
+que upstream (resolver NULL ⇒ perturbación cero, verificado con diff del conjunto de
+símbolos). Es la misma familia de mecanismos que el proyecto de escritorio implementa sobre
+NVMe + Vulkan; aquí es CPU/NEON por diseño — los backends de GPU quedan fuera de la
+configuración de serie para garantizar una numérica determinista y un único modelo de
+memoria.
+
+### 3.3 Mapa del repositorio
+
+```
+app/ Android app: Compose UI (src/main/java), JNI shell (src/main/cpp),
+ instrumented + unit tests (src/androidTest, src/test)
+tools/llama/ build_vendor_libs.sh — engine rebuild from the pinned tree + bands
+tools/model/ push_models.sh — md5-gated model staging to devices
+../vendor/llama.cpp/ materialized by the build scripts from vendor.llama.pin (gitignored; never patched in place)
+../patches/llama.cpp/ common(6) + android(14) hook-point bands + ledger README
+../windows/ desktop companion — hosts the MLX→GGUF converter used in §1.4
+```
diff --git a/android/README_fr.md b/android/README_fr.md
new file mode 100644
index 0000000..5d0a988
--- /dev/null
+++ b/android/README_fr.md
@@ -0,0 +1,200 @@
+# edge0-android — Guide de compilation de la release
+
+[English](README.md) | [中文](README_zh.md) | [日本語](README_ja.md) | [Español](README_es.md) | Français
+
+Ce document s'adresse aux **développeurs qui compilent ou évaluent l'application Android depuis les sources**. Il couvre : le démarrage rapide (moteur → application → modèles → test), les performances mesurées sur l'appareil de référence et les choix techniques derrière la stack.
+
+edge0 est publié sous forme de **monorepo** — [`Edge0-AI/edge0`](https://github.com/Edge0-AI/edge0) — dont le niveau supérieur contient l'approvisionnement partagé du moteur (`vendor.llama.pin` + le `vendor/llama.cpp` matérialisé par les scripts, les jeux de bandes `patches/llama.cpp/`) et les sous-projets par plateforme (`windows/` = le compagnon de bureau, `android/` = cette application). L'inférence s'exécute sur une version épinglée de llama.cpp upstream, patchée sous forme d'un jeu de patchs rejouable, entièrement sur CPU avec des kernels ARM-NEON et un pool d'experts paginé à la demande.
+
+Attribution tierce : voir `NOTICE` dans ce répertoire. Cartes de modèles : [Edge0/Edge0-8B-A1B-preview](https://huggingface.co/Edge0/Edge0-8B-A1B-preview) · [Edge0/Edge0-35B-A3B-preview](https://huggingface.co/Edge0/Edge0-35B-A3B-preview).
+
+---
+
+## 1. Démarrage rapide
+
+### 1.1 Prérequis
+
+| composant | exigence |
+|---|---|
+| Appareil | arm64-v8a, Android 13+ (API 33) ; Snapdragon 8 Elite ou équivalent recommandé |
+| RAM | 8 GB+ pour le 8B ; 12–16 GB pour le 35B (pagination des experts, voir §3.2) |
+| Chaîne d'outils | JDK 17+, Android SDK 35, **NDK r28** (`28.2.13676358`), CMake ≥ 3.21 + Ninja |
+| Python | 3.10+ avec `numpy` (convertisseur de modèles, exécuté depuis le `windows/tools` voisin) |
+| Disque | ≥ 30 GB libres pour les sources des modèles et les compilations GGUF converties |
+
+Le NDK ne fait **pas** partie de ce dépôt — installez-le une fois (Android Studio :
+*Android SDK → SDK Tools → NDK (Side by side)*, ou via la CLI) :
+
+```bash
+sdkmanager --install "ndk;28.2.13676358"
+```
+
+Pointez ensuite la compilation dessus avec `NDK_DIR` (ou un `ANDROID_NDK_HOME`
+exporté) : `build_vendor_libs.sh` lit la chaîne de compilation **et** le runtime
+`libomp.so` qu'il met en place (§1.2) depuis cette installation NDK ; un NDK
+manquant échoue immédiatement avec cette indication plutôt que de produire un
+jeu de bibliothèques cassé.
+
+### 1.2 Compiler le moteur
+
+Les bibliothèques natives proviennent de l'arborescence upstream épinglée, avec
+les bandes de patchs de cette plateforme rejouées dans un worktree isolé —
+l'arborescence vendor n'est **jamais patchée en place** :
+
+```bash
+git clone https://github.com/Edge0-AI/edge0
+cd edge0/android
+bash tools/llama/build_vendor_libs.sh
+```
+
+Le script rejoue `../patches/llama.cpp/{common,android}` (6 + 14 bandes) sur
+l'arborescence llama.cpp épinglée — l'épingle se trouve dans
+`../vendor.llama.pin` (actuellement `7ab4ee7`, tag b11100) ; l'arborescence
+n'est **pas** un sous-module, elle est donc clonée depuis upstream au premier
+lancement dans `../vendor/llama.cpp` (ignoré par git ; définissez
+`EDGE0_LLAMA_URL` pour utiliser un miroir) et détachée sur l'épingle. Les
+rejeux se produisent dans un worktree consommateur ignoré par git, le script
+vérifie le hash de l'arborescence résultat attendue (golden) et produit les
+quatre bibliothèques partagées du moteur (plus le runtime NDK `libomp.so` dont
+`libggml-cpu` a besoin) avec les en-têtes dans `build-dl/llama-libs/` (le point
+de mise en place jniLibs de l'application). `--replay` réapplique les bandes
+après modification des patchs ; arborescence différente ⇒ ROUGE, la
+compilation refuse de démarrer. Cette étape est requise une fois avant la
+compilation de l'application — le plugin Gradle lit ces bibliothèques depuis
+`build-dl/llama-libs/`.
+
+### 1.3 Compiler et installer l'application
+
+```bash
+./gradlew :app:assembleDebug
+./gradlew :app:installDebug # or adb install -r app/build/outputs/apk/debug/app-debug.apk
+```
+
+### 1.4 Modèles
+
+Les compilations GGUF sont produites localement à partir des checkpoints
+publiés — tout reste sous le `models/` de ce répertoire (ignoré par git) :
+
+```bash
+huggingface-cli download Edge0/Edge0-8B-A1B-preview --local-dir models/edge0-8b
+python ../windows/tools/convert_mlx_to_gguf.py --dir models/edge0-8b
+# → models/edge0-8b-gguf/{edge0-8b.gguf, lora_edge0_8b-gguf.gguf, manifest.json}
+
+huggingface-cli download Edge0/Edge0-35B-A3B-preview --local-dir models/edge0-35b
+python ../windows/tools/convert_mlx_to_gguf.py --dir models/edge0-35b
+
+bash tools/model/push_models.sh --all # md5-gated staging onto the device
+```
+
+Le convertisseur n'a besoin que de python3 + numpy (pas de runtime MLX/torch —
+« MLX » désigne la disposition sur disque du checkpoint). Il exécute le repack
+r3 avec des portes de parité numérique et émet un manifeste sha256 ; une
+conversion correcte reproduit octet pour octet les checksums de référence
+listées dans `push_models.sh`. Les modèles peuvent aussi être copiés dans
+`files/models/` avec le sélecteur intégré à l'application.
+
+### 1.5 Exécution
+
+Lancez **Edge0 Chat**. La barre de titre affiche le modèle actif (8B / 35B), le
+bouton en haut à droite permet d'en changer. La zone de saisie sert uniquement
+à envoyer ; la température, la réflexion (thinking) et le prompt système se
+trouvent dans les paramètres du tiroir. Chaque réponse comporte une ligne de
+métriques inline : `tokens · TTFT · prefill t/s · decode t/s · RSS`.
+
+### 1.6 Tester
+
+Régression instrumentée (nécessite les deux modèles mis en place —
+réinstaller l'APK de test efface les données de l'application, replacez donc
+les modèles juste avant l'exécution) :
+
+```bash
+./gradlew :app:installDebugAndroidTest
+bash tools/model/push_models.sh --all
+adb shell am instrument -w -e class dev.edge0.runtime.app.LlamaRuntimeTest \
+ dev.edge0.runtime.app.test/androidx.test.runner.AndroidJUnitRunner
+# expected: OK (8 tests), ~7 min on the reference device
+```
+
+Couverture : smoke 8B/35B, commutation 35B↔8B dans le même processus,
+fidélité de la réutilisation de préfixe, quadrants thinking activé/désactivé ×
+prompt système (porte 8B + sonde de fuite 35B désactivée), et rétention
+d'identité à travers le rendu multi-tours. Tests logiques côté hôte :
+`./gradlew :app:testDebugUnitTest` (26 tests, aucun appareil requis).
+
+---
+
+## 2. Performances
+
+Appareil de référence : **Lenovo TB322FC (Snapdragon 8 Elite, 16 GB RAM)**,
+configuration de série, fenêtres soutenues (premiers segments = fréquences
+boost, fin = régime thermique stable — les deux sont rapportés plutôt que des
+pics triés sur le volet).
+
+| Modèle | TTFT (tour à chaud) | Decode | Prefill | RSS de session |
+|---|---:|---:|---:|---:|
+| **8B** (GGUF classe Q8 + LoRA) | ≈ 1.4 s | 29–32 → ~10 t/s sur une fenêtre de 480 s | ~100 t/s | ≈ 250 MB |
+| **35B** (MoE int8 mixte, paginé à la demande) | ≈ 1.1 s à chaud (≈ 10–15 s au tout premier tour d'un nouveau sujet — pool d'experts froid, limité par le flash) | 6–9 t/s dans l'application (9.46 t/s soutenu en CLI) | ~1 s par tour incrémental | budget du pool 2–6 GB ; résident ≪ taille du fichier |
+
+Notes : le « premier tour d'un nouveau sujet » paie le coût du pool froid —
+par exemple, une question de 55 tokens a mesuré un prefill de 12,8 s avec
+25 956 chargements d'experts, 73 % du temps total passé en attente d'E/S
+flash ; c'est la pagination à la demande qui fonctionne comme prévu, pas une
+régression. À partir du deuxième tour, tout est à chaud : la réutilisation du
+préfixe KV + le remplissage keepwarm ramènent le TTFT à ~1 s. La décroissance
+du decode le long d'une longue fenêtre est le comportement DVFS/thermique sur
+ce SoC.
+
+---
+
+## 3. Détails techniques
+
+### 3.1 Architecture
+
+```mermaid
+graph TD
+ subgraph App ["Kotlin / Jetpack Compose"]
+ UI[ChatScreen · dark · send-only composer] --> VM[ChatViewModel]
+ VM --> RT[LlamaRuntime<br/>coroutines + Flow events]
+ VM --> DB[(Room · threads & messages)]
+ ST[SettingsStore] --> VM
+ end
+ subgraph Native ["C JNI shell (llama_chat.c)"]
+ SHELL[generate loop · template-aware thinking control<br/>segment-wise history render · UTF-8-safe streaming]
+ end
+ subgraph Engine ["patched llama.cpp @ b11100 · arm64 CPU-only"]
+ LLIB[libllama.so]
+ GCPU[libggml-cpu.so<br/>NEON kernels + moe_pool]
+ end
+ RT -->|JNI| SHELL --> LLIB --> GCPU
+ GCPU -->|demand-paged expert IO| MODELS[GGUF on flash]
+```
+
+### 3.2 Pourquoi un MoE de 21,7 GB tient sur un téléphone — `moe_pool`
+
+Le modèle 35B n'active qu'un sous-ensemble mobile de ses 256 experts par
+couche et par token, de sorte que la conception livrée pagine les experts **à
+la demande** depuis le flash au lieu de la mémoire résidente
+(`ggml/src/ggml-cpu/moe_pool.c`, développé comme la bande android de
+14 patchs) : cadres privés recopiés à l'entrée (copy-in), une machine à états
+à créneaux égaux, des files d'attente d'E/S en arrière-plan calibrées sur le
+débit UFS mesuré, des contrôles pin/blob/trim, un remplissage keepwarm de fin
+de tour dans une limite d'octets, et une réinitialisation complète
+inter-modèles permettant la commutation 8B↔35B à l'intérieur d'un même
+processus. Pool désactivé, le moteur résout les lignes d'experts exactement
+comme upstream (résolveur NULL ⇒ perturbation nulle, vérifiée par diff des
+jeux de symboles). C'est la même famille de mécanismes que le projet de
+bureau implémente sur NVMe + Vulkan ; ici, c'est CPU/NEON par conception —
+les backends GPU restent hors de la configuration livrée pour garantir un
+comportement numérique déterministe et un modèle de mémoire unique.
+
+### 3.3 Structure du dépôt
+
+```
+app/ Android app: Compose UI (src/main/java), JNI shell (src/main/cpp),
+ instrumented + unit tests (src/androidTest, src/test)
+tools/llama/ build_vendor_libs.sh — engine rebuild from the pinned tree + bands
+tools/model/ push_models.sh — md5-gated model staging to devices
+../vendor/llama.cpp/ materialized by the build scripts from vendor.llama.pin (gitignored; never patched in place)
+../patches/llama.cpp/ common(6) + android(14) hook-point bands + ledger README
+../windows/ desktop companion — hosts the MLX→GGUF converter used in §1.4
+```
diff --git a/android/README_ja.md b/android/README_ja.md
new file mode 100644
index 0000000..5f0c93a
--- /dev/null
+++ b/android/README_ja.md
@@ -0,0 +1,140 @@
+# edge0-android — リリースビルドガイド
+
+[English](README.md) | [中文](README_zh.md) | 日本語 | [Español](README_es.md) | [Français](README_fr.md)
+
+このドキュメントは、**ソースから Android アプリをビルドまたは評価する開発者**向けのものです。内容は、クイックスタート(エンジン → アプリ → モデル → テスト)、リファレンスデバイスでの実測パフォーマンス、そしてスタックの背後にある技術的選択です。
+
+edge0 は**モノレポ**として公開されています — [`Edge0-AI/edge0`](https://github.com/Edge0-AI/edge0) — 最上位階層には共有のエンジンサプライ(`vendor.llama.pin` + スクリプトが実体化する `vendor/llama.cpp`、`patches/llama.cpp/` のバンドセット)とプラットフォームのサブプロジェクト(`windows/` = デスクトップ版コンパニオン、`android/` = 本アプリ)が含まれます。推論はピン留めされた上流の llama.cpp 上で実行され、リプレイ可能なパッチセットとしてパッチが適用され、ARM-NEON カーネルとデマンドページ方式のエキスパートプールにより、完全に CPU 上で動作します。
+
+サードパーティの帰属表示: このディレクトリの `NOTICE` を参照してください。モデルカード: [Edge0/Edge0-8B-A1B-preview](https://huggingface.co/Edge0/Edge0-8B-A1B-preview) · [Edge0/Edge0-35B-A3B-preview](https://huggingface.co/Edge0/Edge0-35B-A3B-preview)。
+
+---
+
+## 1. クイックスタート
+
+### 1.1 前提条件
+
+| コンポーネント | 要件 |
+|---|---|
+| デバイス | arm64-v8a、Android 13+(API 33);Snapdragon 8 Elite クラスを推奨 |
+| RAM | 8 GB+ で 8B が動作;12–16 GB で 35B が動作(エキスパートページング、§3.2 を参照) |
+| ツールチェーン | JDK 17+、Android SDK 35、**NDK r28**(`28.2.13676358`)、CMake ≥ 3.21 + Ninja |
+| Python | 3.10+ と `numpy`(モデルコンバータ;隣接する `windows/tools` から実行される) |
+| ディスク | モデルソースと変換済み GGUF ビルド用に 30 GB 以上の空き容量 |
+
+NDK はこのリポジトリの一部では**ありません** — 一度インストールしてください(Android Studio: *Android SDK → SDK Tools → NDK (Side by side)*、または CLI 経由):
+
+```bash
+sdkmanager --install "ndk;28.2.13676358"
+```
+
+次に `NDK_DIR`(またはエクスポートされた `ANDROID_NDK_HOME`)でビルドにそれを指定します:
+`build_vendor_libs.sh` は、その NDK インストール内からコンパイラツールチェーン**と**、ステージングする `libomp.so` ランタイム(§1.2)を読み取ります。NDK が見つからない場合は、壊れたライブラリセットを生成するのではなく、そのヒントを示して即座に失敗します。
+
+### 1.2 エンジンのビルド
+
+ネイティブライブラリは、ピン留めされた上流ツリーにこのプラットフォームのパッチバンドを隔離されたワークツリーへリプレイして生成されます — ベンダーツリーが**その場でパッチされることは決してありません**:
+
+```bash
+git clone https://github.com/Edge0-AI/edge0
+cd edge0/android
+bash tools/llama/build_vendor_libs.sh
+```
+
+スクリプトは `../patches/llama.cpp/{common,android}`(6 + 14 バンド)をピン留めされた llama.cpp ツリーにリプレイします — ピンは `../vendor.llama.pin` にあります(現在 `7ab4ee7`、tag b11100)。このツリーはサブモジュールでは**ない**ため、初回実行時に上流から `../vendor/llama.cpp` にクローンされ(gitignore 済み;ミラーを使うには `EDGE0_LLAMA_URL` を設定)、ピンの位置で detach されます。リプレイは gitignore されたコンシューマーワークツリー内で行われ、スクリプトはゴールデンな結果ツリーハッシュをアサートし、4 つのエンジン共有ライブラリ(および `libggml-cpu` が必要とする NDK の `libomp.so` ランタイム)をヘッダとともに `build-dl/llama-libs/`(アプリの jniLibs ステージングポイント)に生成します。`--replay` はパッチ変更後にバンドを再適用します。ツリーが不一致の場合は RED となり、ビルドは開始を拒否します。このステップはアプリのビルドの前に一度必要です — Gradle プラグインはこれらのライブラリを `build-dl/llama-libs/` から読み取ります。
+
+### 1.3 アプリのビルド & インストール
+
+```bash
+./gradlew :app:assembleDebug
+./gradlew :app:installDebug # or adb install -r app/build/outputs/apk/debug/app-debug.apk
+```
+
+### 1.4 モデル
+
+GGUF ビルドは公開チェックポイントからローカルで生成されます — すべてのものはこのディレクトリの `models/` 配下に置かれます(gitignore 済み):
+
+```bash
+huggingface-cli download Edge0/Edge0-8B-A1B-preview --local-dir models/edge0-8b
+python ../windows/tools/convert_mlx_to_gguf.py --dir models/edge0-8b
+# → models/edge0-8b-gguf/{edge0-8b.gguf, lora_edge0_8b-gguf.gguf, manifest.json}
+
+huggingface-cli download Edge0/Edge0-35B-A3B-preview --local-dir models/edge0-35b
+python ../windows/tools/convert_mlx_to_gguf.py --dir models/edge0-35b
+
+bash tools/model/push_models.sh --all # md5-gated staging onto the device
+```
+
+コンバータが必要とするのは python3 + numpy のみです(MLX/torch ランタイムは不要 — 「MLX」はディスク上のチェックポイントレイアウトを指します)。数値パリティゲートを備えた r3 リパックを実行し、sha256 マニフェストを出力します。正しい変換は、`push_models.sh` に記載されたベースラインチェックサムをバイト単位で再現します。モデルはアプリ内ピッカーで `files/models/` にコピーすることもできます。
+
+### 1.5 実行
+
+**Edge0 Chat** を起動します。タイトルバーはアクティブなモデル(8B / 35B)を表示し、右上のボタンで切り替えます。コンポーザーは送信専用です。temperature、thinking、システムプロンプトはドロワーの設定にあります。各返信にはインラインのメトリクス行が付きます: `tokens · TTFT · prefill t/s · decode t/s · RSS`。
+
+### 1.6 テスト
+
+計装リグレッションテスト(両モデルのステージングが必要 — テスト APK の再インストールはアプリデータを消去するため、実行直前に再ステージングしてください):
+
+```bash
+./gradlew :app:installDebugAndroidTest
+bash tools/model/push_models.sh --all
+adb shell am instrument -w -e class dev.edge0.runtime.app.LlamaRuntimeTest \
+ dev.edge0.runtime.app.test/androidx.test.runner.AndroidJUnitRunner
+# expected: OK (8 tests), ~7 min on the reference device
+```
+
+カバレッジ: 8B/35B スモーク、35B↔8B のプロセス内切り替え、プレフィックス再利用の忠実性、thinking オン/オフ × システムプロンプトの四象限(8B ゲート + 35B オフ時のリークプローブ)、マルチターンレンダリングを通じたアイデンティティの保持。ホスト側のロジックテスト: `./gradlew :app:testDebugUnitTest`(26 テスト、デバイス不要)。
+
+---
+
+## 2. パフォーマンス
+
+リファレンスデバイス: **Lenovo TB322FC(Snapdragon 8 Elite、16 GB RAM)**、出荷時構成、持続ウィンドウ(最初のセグメント = ブーストクロック、テール = 熱的定常状態 — チェリーピックしたピーク値ではなく両方を報告)。
+
+| モデル | TTFT(ウォームターン) | デコード | プリフィル | セッション RSS |
+|---|---:|---:|---:|---:|
+| **8B**(Q8 クラス GGUF + LoRA) | ≈ 1.4 s | 480 秒のウィンドウで 29–32 → ~10 t/s | ~100 t/s | ≈ 250 MB |
+| **35B**(混合 int8 MoE、デマンドページ方式) | ≈ 1.1 s ウォーム(≈ 10–15 s 新しいトピックの最初のターン — コールドエキスパートプール、フラッシュ律速) | アプリ内 6–9 t/s(CLI 持続値 9.46 t/s) | インクリメンタルターンあたり ~1 s | プールバジェット 2–6 GB;常駐 ≪ ファイルサイズ |
+
+注記: 「新しいトピックの最初のターン」はコールドプールのコストを支払います — 例えば 55 トークンの質問で、プリフィル 12.8 s、エキスパートロード 25956 回、実時間の 73 % がフラッシュ I/O 待ちと測定されました。これはデマンドページングが設計通りに機能しているものであり、リグレッションではありません。2 ターン目以降はウォームです: KV プレフィックスの再利用 + keepwarm リフィルにより、TTFT は約 1 s になります。長いウィンドウに沿ったデコードの減衰は、この SoC の DVFS/熱による挙動です。
+
+---
+
+## 3. 技術詳細
+
+### 3.1 アーキテクチャ
+
+```mermaid
+graph TD
+ subgraph App ["Kotlin / Jetpack Compose"]
+ UI[ChatScreen · dark · send-only composer] --> VM[ChatViewModel]
+ VM --> RT[LlamaRuntime<br/>coroutines + Flow events]
+ VM --> DB[(Room · threads & messages)]
+ ST[SettingsStore] --> VM
+ end
+ subgraph Native ["C JNI shell (llama_chat.c)"]
+ SHELL[generate loop · template-aware thinking control<br/>segment-wise history render · UTF-8-safe streaming]
+ end
+ subgraph Engine ["patched llama.cpp @ b11100 · arm64 CPU-only"]
+ LLIB[libllama.so]
+ GCPU[libggml-cpu.so<br/>NEON kernels + moe_pool]
+ end
+ RT -->|JNI| SHELL --> LLIB --> GCPU
+ GCPU -->|demand-paged expert IO| MODELS[GGUF on flash]
+```
+
+### 3.2 21.7 GB の MoE はなぜスマートフォンに収まるのか — `moe_pool`
+
+35B モデルはトークンごとに、レイヤーあたり 256 のエキスパートのうち移動する部分集合のみをアクティブ化します。そのため出荷時の設計では、エキスパートを常駐メモリではなくフラッシュから**オンデマンドで**ページングします(`ggml/src/ggml-cpu/moe_pool.c`、14 パッチの android バンドとして開発): コピーインのプライベートフレーム、等スロットの状態機械、実測 UFS スループットにチューニングされたバックグラウンド IO ステージングキュー、pin/blob/trim 制御、バイトバジェット内でのターン終了時の keepwarm リフィル、そして 1 つのプロセス内での 8B↔35B 切り替えを可能にする完全なクロスモデルリセット。プールを無効にすると、エンジンは上流とまったく同じようにエキスパート行を解決します(NULL リゾルバー ⇒ ゼロ摂動、シンボルセットの diff により検証済み)。これは、デスクトッププロジェクトが NVMe + Vulkan 上で実装しているものと同じ機構ファミリーです。ここでは設計により CPU/NEON です — 決定的な数値計算と単一のメモリモデルのため、GPU バックエンドは出荷時構成から外されています。
+
+### 3.3 リポジトリマップ
+
+```
+app/ Android app: Compose UI (src/main/java), JNI shell (src/main/cpp),
+ instrumented + unit tests (src/androidTest, src/test)
+tools/llama/ build_vendor_libs.sh — engine rebuild from the pinned tree + bands
+tools/model/ push_models.sh — md5-gated model staging to devices
+../vendor/llama.cpp/ materialized by the build scripts from vendor.llama.pin (gitignored; never patched in place)
+../patches/llama.cpp/ common(6) + android(14) hook-point bands + ledger README
+../windows/ desktop companion — hosts the MLX→GGUF converter used in §1.4
+```
diff --git a/android/README_zh.md b/android/README_zh.md
new file mode 100644
index 0000000..143b9c8
--- /dev/null
+++ b/android/README_zh.md
@@ -0,0 +1,177 @@
+# edge0-android — 发布构建指南
+
+[English](README.md) | 中文 | [日本語](README_ja.md) | [Español](README_es.md) | [Français](README_fr.md)
+
+本文档面向**从源码构建或评估 Android App 的开发者**。内容包括:快速开始(引擎 → App → 模型 → 测试)、参考设备上的性能实测,以及技术栈背后的技术选型。
+
+edge0 以 **monorepo** 形式发布 —— [`Edge0-AI/edge0`](https://github.com/Edge0-AI/edge0) —— 顶层目录存放共享的引擎供给(`vendor.llama.pin` + 由脚本物化的 `vendor/llama.cpp`、`patches/llama.cpp/` 补丁 band 集)与各平台子项目(`windows/` = 桌面伙伴项目,`android/` = 本 App)。推理运行在固定版本(pinned)的上游 llama.cpp 上,以可重放补丁集的方式打补丁,完全在 CPU 上运行,采用 ARM-NEON kernel 与按需分页的专家池。
+
+第三方声明:见本目录下的 `NOTICE`。模型卡:[Edge0/Edge0-8B-A1B-preview](https://huggingface.co/Edge0/Edge0-8B-A1B-preview) · [Edge0/Edge0-35B-A3B-preview](https://huggingface.co/Edge0/Edge0-35B-A3B-preview)。
+
+---
+
+## 1. 快速开始
+
+### 1.1 环境要求
+
+| 组件 | 要求 |
+|---|---|
+| 设备 | arm64-v8a,Android 13+(API 33);推荐骁龙 8 Elite 级别 |
+| 内存 | 8 GB+ 可运行 8B;12–16 GB 可运行 35B(专家分页,见 §3.2) |
+| 工具链 | JDK 17+,Android SDK 35,**NDK r28**(`28.2.13676358`),CMake ≥ 3.21 + Ninja |
+| Python | 3.10+ 且带 `numpy`(模型转换器,从同级目录 `windows/tools` 运行) |
+| 磁盘 | ≥ 30 GB 可用空间,用于模型源文件与转换后的 GGUF 构建产物 |
+
+NDK **不在**本仓库内 —— 只需安装一次(Android Studio:
+*Android SDK → SDK Tools → NDK (Side by side)*,或通过 CLI):
+
+```bash
+sdkmanager --install "ndk;28.2.13676358"
+```
+
+然后用 `NDK_DIR`(或导出的 `ANDROID_NDK_HOME`)让构建指向它:
+`build_vendor_libs.sh` 会从该 NDK 安装中读取编译器工具链**以及**其暂存
+(§1.2)的 `libomp.so` runtime;若缺少 NDK,会按该提示快速失败,而不是
+产出损坏的库集合。
+
+### 1.2 构建引擎
+
+原生库来自固定版本的上游源码树,本平台的补丁 band 会被重放到一个隔离的
+worktree 中 —— vendor 树**绝不就地打补丁**:
+
+```bash
+git clone https://github.com/Edge0-AI/edge0
+cd edge0/android
+bash tools/llama/build_vendor_libs.sh
+```
+
+脚本把 `../patches/llama.cpp/{common,android}`(6 + 14 个 band)重放到
+固定版本的 llama.cpp 树上 —— pin 记录在 `../vendor.llama.pin`(当前为
+`7ab4ee7`,tag b11100);该树**不是** submodule,因此首次运行时会从上游
+克隆到 `../vendor/llama.cpp`(gitignored;设置 `EDGE0_LLAMA_URL` 可使用
+镜像)并 detach 到 pin 的提交。重放发生在一个 gitignored 的消费方
+worktree 中,脚本会校验黄金结果树哈希,并产出四个引擎共享库(外加
+`libggml-cpu` 所需的 NDK `libomp.so` runtime)与头文件到
+`build-dl/llama-libs/`(App 的 jniLibs 暂存点)。补丁变更后用 `--replay`
+重新应用 band;树不匹配 ⇒ RED,构建拒绝启动。App 构建前需要执行一次
+本步骤 —— Gradle 插件会从 `build-dl/llama-libs/` 读取这些库。
+
+### 1.3 构建并安装 App
+
+```bash
+./gradlew :app:assembleDebug
+./gradlew :app:installDebug # or adb install -r app/build/outputs/apk/debug/app-debug.apk
+```
+
+### 1.4 模型
+
+GGUF 构建产物由已发布的 checkpoint 在本地生成 —— 全部内容都留在本目录的
+`models/` 下(gitignored):
+
+```bash
+huggingface-cli download Edge0/Edge0-8B-A1B-preview --local-dir models/edge0-8b
+python ../windows/tools/convert_mlx_to_gguf.py --dir models/edge0-8b
+# → models/edge0-8b-gguf/{edge0-8b.gguf, lora_edge0_8b-gguf.gguf, manifest.json}
+
+huggingface-cli download Edge0/Edge0-35B-A3B-preview --local-dir models/edge0-35b
+python ../windows/tools/convert_mlx_to_gguf.py --dir models/edge0-35b
+
+bash tools/model/push_models.sh --all # md5-gated staging onto the device
+```
+
+转换器只需 python3 + numpy(无需 MLX/torch runtime —— “MLX” 指的是磁盘上
+的 checkpoint 布局)。它执行带数值一致性校验门的 r3 重打包并输出 sha256
+清单;正确的转换会逐字节复现 `push_models.sh` 中列出的基线校验和。也可以
+通过 App 内的选择器把模型拷贝到 `files/models/`。
+
+### 1.5 运行
+
+启动 **Edge0 Chat**。标题栏显示当前模型(8B / 35B),右上角按钮用于切换。
+输入框只有发送功能;temperature、thinking 与系统提示词在抽屉设置中。每条
+回复附带一行内联指标:`tokens · TTFT · prefill t/s · decode t/s · RSS`。
+
+### 1.6 测试
+
+仪器化回归测试(需要两个模型都已就位 —— 重新安装测试 APK 会清空 App
+数据,因此请在运行前重新推送模型):
+
+```bash
+./gradlew :app:installDebugAndroidTest
+bash tools/model/push_models.sh --all
+adb shell am instrument -w -e class dev.edge0.runtime.app.LlamaRuntimeTest \
+ dev.edge0.runtime.app.test/androidx.test.runner.AndroidJUnitRunner
+# expected: OK (8 tests), ~7 min on the reference device
+```
+
+覆盖范围:8B/35B 冒烟、35B↔8B 进程内切换、前缀复用保真度、thinking
+开/关 × 系统提示词四象限(8B 开启 + 35B 关闭泄漏探测),以及多轮渲染下的
+身份保持。宿主侧逻辑测试:`./gradlew :app:testDebugUnitTest`(26 个测试,
+无需设备)。
+
+---
+
+## 2. 性能实测
+
+参考设备:**Lenovo TB322FC(骁龙 8 Elite,16 GB RAM)**,出厂配置,持续
+测试窗口(前段 = 加速频率,尾段 = 热稳态 —— 两者都如实报告,而非只挑
+峰值)。
+
+| 模型 | TTFT(热轮次) | 解码 | Prefill | 会话 RSS |
+|---|---:|---:|---:|---:|
+| **8B**(Q8 级 GGUF + LoRA) | ≈ 1.4 s | 480 s 窗口内 29–32 → 约 10 t/s | 约 100 t/s | ≈ 250 MB |
+| **35B**(混合 int8 MoE,按需分页) | 热轮次 ≈ 1.1 s(新话题首轮 ≈ 10–15 s —— 专家池冷启动,受闪存 IO 限制) | App 内 6–9 t/s(CLI 持续 9.46 t/s) | 每个增量轮次约 1 s | 池预算 2–6 GB;常驻 ≪ 文件大小 |
+
+说明:“新话题首轮”要付出冷池代价 —— 例如一个 55 token 的问题实测
+prefill 12.8 s、25956 次专家加载,73% 的墙钟时间耗在闪存 I/O 等待上;
+这是按需分页按设计工作,而非性能回退。第二轮起即为热轮次:KV 前缀复用 +
+keepwarm 回填把 TTFT 降到约 1 s。长窗口内解码速度的衰减是该 SoC 上的
+DVFS/热行为。
+
+---
+
+## 3. 技术细节
+
+### 3.1 架构
+
+```mermaid
+graph TD
+ subgraph App ["Kotlin / Jetpack Compose"]
+ UI[ChatScreen · dark · send-only composer] --> VM[ChatViewModel]
+ VM --> RT[LlamaRuntime<br/>coroutines + Flow events]
+ VM --> DB[(Room · threads & messages)]
+ ST[SettingsStore] --> VM
+ end
+ subgraph Native ["C JNI shell (llama_chat.c)"]
+ SHELL[generate loop · template-aware thinking control<br/>segment-wise history render · UTF-8-safe streaming]
+ end
+ subgraph Engine ["patched llama.cpp @ b11100 · arm64 CPU-only"]
+ LLIB[libllama.so]
+ GCPU[libggml-cpu.so<br/>NEON kernels + moe_pool]
+ end
+ RT -->|JNI| SHELL --> LLIB --> GCPU
+ GCPU -->|demand-paged expert IO| MODELS[GGUF on flash]
+```
+
+### 3.2 为什么 21.7 GB 的 MoE 能装进手机 —— `moe_pool`
+
+35B 模型每个 token 只激活其每层 256 个专家中一个滚动的子集,因此发布版
+设计让专家从闪存**按需**分页,而非驻留内存
+(`ggml/src/ggml-cpu/moe_pool.c`,以 14 个补丁的 android band 开发):
+copy-in 私有帧、等槽位状态机、按实测 UFS 吞吐调优的后台 IO 暂存队列、
+pin/blob/trim 控制、字节预算内的轮末 keepwarm 回填,以及支持单进程内
+8B↔35B 切换的完整跨模型重置。禁用专家池时,引擎解析专家行的行为与上游
+完全一致(NULL resolver ⇒ 零扰动,经符号集 diff 验证)。这与桌面项目在
+NVMe + Vulkan 上实现的是同一族机制;这里按设计走 CPU/NEON —— GPU 后端
+不进入发布配置,以保证确定性数值与单一内存模型。
+
+### 3.3 仓库结构
+
+```
+app/ Android app: Compose UI (src/main/java), JNI shell (src/main/cpp),
+ instrumented + unit tests (src/androidTest, src/test)
+tools/llama/ build_vendor_libs.sh — engine rebuild from the pinned tree + bands
+tools/model/ push_models.sh — md5-gated model staging to devices
+../vendor/llama.cpp/ materialized by the build scripts from vendor.llama.pin (gitignored; never patched in place)
+../patches/llama.cpp/ common(6) + android(14) hook-point bands + ledger README
+../windows/ desktop companion — hosts the MLX→GGUF converter used in §1.4
+```
diff --git a/ios/README.md b/ios/README.md
index bcde788..1d3d24e 100644
--- a/ios/README.md
+++ b/ios/README.md
@@ -1,5 +1,7 @@
# Edge0Phone
+English | [中文](README_zh.md) | [日本語](README_ja.md) | [Español](README_es.md) | [Français](README_fr.md)
+
On-device chat for iPhone. The app can run Edge0 8B, Edge0 35B, or both, and only the model you select is loaded. Model weights are not in this folder.
## Quick Start
diff --git a/ios/README_es.md b/ios/README_es.md
new file mode 100644
index 0000000..3eb3ed8
--- /dev/null
+++ b/ios/README_es.md
@@ -0,0 +1,111 @@
+# Edge0Phone
+
+[English](README.md) | [中文](README_zh.md) | [日本語](README_ja.md) | Español | [Français](README_fr.md)
+
+Chat en el dispositivo para iPhone. La aplicación puede ejecutar Edge0 8B, Edge0 35B o ambos, y solo se carga el modelo que selecciones. Los pesos del modelo no están en esta carpeta.
+
+## Inicio rápido
+
+Necesitas un Mac con Apple Silicon, Xcode y un iPhone con iOS 17 o posterior y el modo de desarrollador activado. Python 3.10 o posterior solo se necesita para descargar los pesos y para convertir el 35B. Si Xcode indica que falta el compilador de Metal, ejecuta `xcodebuild -downloadComponent MetalToolchain`.
+
+El directorio `Models/` se copia dentro de la aplicación al compilar. Coloca ahí un modelo antes de compilar si quieres que ese botón sea seleccionable. Un directorio `Models/` vacío compila igualmente; el modelo ausente muestra **No incluido**.
+
+### Descargar un modelo
+
+```sh
+python3 -m venv .venv-tools
+.venv-tools/bin/python -m pip install --upgrade pip huggingface_hub numpy
+```
+
+El 8B se puede empaquetar tal como se descarga. Ocupa unos 5 GB, así que la aplicación instalada tiene aproximadamente ese tamaño.
+
+```sh
+.venv-tools/bin/hf download Edge0/Edge0-8B-A1B-preview \
+ --local-dir Models/Edge0-8B-A1B-preview
+```
+
+El 35B es un cambio de disposición (layout), no un cambio en los pesos. El checkpoint publicado almacena cada experto como nueve lecturas dispersas a lo largo de un archivo de 19 GB. En un iPhone eso es demasiado lento, así que las herramientas de abajo reescriben cada experto en una sola lectura secuencial y escriben un archivo por capa. Conserva la descarga original fuera de `Models/`. Solo `Models/repacked/` es lo que debe contener la aplicación. Una compilación del 35B ocupa unos 20 GB.
+
+```sh
+mkdir -p checkpoints
+.venv-tools/bin/hf download Edge0/Edge0-35B-A3B-preview \
+ --local-dir checkpoints/Edge0-35B-A3B-preview
+
+SOURCE=checkpoints/Edge0-35B-A3B-preview
+OUTPUT=Models/repacked
+
+.venv-tools/bin/python tools/repack_experts.py pack "$SOURCE" "$OUTPUT"
+.venv-tools/bin/python tools/repack_experts.py resident "$SOURCE" "$OUTPUT"
+.venv-tools/bin/python tools/repack_experts.py verify "$SOURCE" "$OUTPUT"
+.venv-tools/bin/python tools/convert_tokenizer.py "$SOURCE" "$OUTPUT/tokenizer.bin"
+.venv-tools/bin/python tools/convert_pregate.py \
+ "$SOURCE/prerouter_edge0_35b.safetensors" \
+ "$OUTPUT/prerouter-stacked.safetensors"
+cp "$SOURCE/lora_edge0_35b.safetensors" "$OUTPUT/"
+```
+
+`Models/repacked/` debe contener `resident.safetensors`, `tokenizer.bin` y desde `experts-L00.bin` hasta `experts-L39.bin`. Puedes empaquetar cualquiera de los dos modelos, o ambos.
+
+Checkpoints:
+
+- [Edge0/Edge0-8B-A1B-preview](https://huggingface.co/Edge0/Edge0-8B-A1B-preview)
+- [Edge0/Edge0-35B-A3B-preview](https://huggingface.co/Edge0/Edge0-35B-A3B-preview)
+
+### Compilación e instalación
+
+`com.example.edge0phone` en el proyecto es un identificador de bundle de ejemplo. Antes de compilar o firmar, reemplázalo por un identificador de bundle único que controles. En Xcode, abre `Edge0PhoneProbe.xcodeproj`, selecciona el target **Edge0Phone** y cambia **Signing & Capabilities → Bundle Identifier**. Elige tu Apple Developer Team, conecta el iPhone y pulsa Run.
+
+Para configurar el equipo desde un archivo, copia `Config/Local.xcconfig.example` a `Config/Local.xcconfig` y completa `DEVELOPMENT_TEAM`.
+
+La misma compilación desde la línea de comandos:
+
+```sh
+DEVICE_ID=<device id from `xcrun devicectl list devices`>
+TEAM_ID=<your Apple Developer Team ID>
+BUNDLE_ID=com.yourname.edge0phone # replace with your own unique bundle identifier
+
+xcodebuild -project Edge0PhoneProbe.xcodeproj \
+ -scheme Edge0Phone \
+ -destination "id=$DEVICE_ID" \
+ -derivedDataPath .build-device \
+ -allowProvisioningUpdates \
+ -skipPackagePluginValidation \
+ CODE_SIGN_STYLE=Automatic \
+ DEVELOPMENT_TEAM="$TEAM_ID" \
+ PRODUCT_BUNDLE_IDENTIFIER="$BUNDLE_ID" \
+ build
+
+xcrun devicectl device install app \
+ --device "$DEVICE_ID" \
+ .build-device/Build/Products/Debug-iphoneos/Edge0Phone.app
+```
+
+Los pesos van dentro de ese `.app`. No hay una copia independiente al teléfono.
+
+### Pruebas
+
+`scripts/test.sh` compila la biblioteca MLX Metal con Xcode y después ejecuta las pruebas unitarias. La primera ejecución resuelve el paquete MLX Swift.
+
+```sh
+scripts/test.sh
+EDGE0_TEST_GPU=1 scripts/test.sh
+```
+
+### Uso de la aplicación
+
+Abre la aplicación y elige **Edge0 8B** o **Edge0 35B**. Un modelo que no estaba en `Models/` al compilar muestra **No incluido** y no se puede seleccionar. Escribe una pregunta o toca una de las sugerencias. La línea bajo una respuesta muestra el recuento de tokens, el tiempo hasta el primer token, prefill, decode y memoria pico. Al cambiar de modelo se libera el que estaba cargado. Nuevo chat borra la conversación.
+
+## Rendimiento
+
+| Modelo | Dispositivo | SO | Prefill | TTFT | Decode |
+| --- | --- | --- | --- | --- | --- |
+| 8B | iPhone 16 Pro | iOS 26.6.2 | 7.2 tok/s | 3.6 s | 10.9 tok/s |
+| 35B | iPhone 16 Pro | iOS 26.6.2 | 4.9 tok/s | 2.1 s | 6.4 tok/s |
+
+## Detalles técnicos
+
+La aplicación es SwiftUI. `Edge0MLX` ejecuta el modelo. `Edge0Core` lee el checkpoint, el tokenizer y el índice de enrutamiento. Las fórmulas matemáticas pasan por MLX Swift sobre Metal. El objetivo de despliegue es iOS 17.
+
+Edge0 8B tiene 24 capas, alternando Kimi Delta Attention y atención latente multicabeza, Top-8, INT4. El prefill del prompt ejecuta una capa completa cada vez, en fragmentos de hasta 2048 tokens. El primer token es greedy. Los tokens siguientes usan temperatura 0.7, top-k 64, top-p 0.95 y una penalización de repetición de 1.1.
+
+Edge0 35B tiene 40 capas, 256 expertos por capa, Top-4. Los pesos residentes y los archivos de expertos por capa se leen por separado. La caché de prefijos se guarda en Application Support, porque el bundle de la aplicación es de solo lectura. Los dos modelos nunca se cargan al mismo tiempo.
diff --git a/ios/README_fr.md b/ios/README_fr.md
new file mode 100644
index 0000000..e93c38c
--- /dev/null
+++ b/ios/README_fr.md
@@ -0,0 +1,111 @@
+# Edge0Phone
+
+[English](README.md) | [中文](README_zh.md) | [日本語](README_ja.md) | [Español](README_es.md) | Français
+
+Chat embarqué pour iPhone. L'application peut exécuter Edge0 8B, Edge0 35B, ou les deux, et seul le modèle que vous sélectionnez est chargé. Les poids des modèles ne sont pas dans ce dossier.
+
+## Démarrage rapide
+
+Vous avez besoin d'un Mac Apple Silicon, de Xcode et d'un iPhone sous iOS 17 ou ultérieur avec le mode développeur activé. Python 3.10 ou ultérieur n'est nécessaire que pour télécharger les poids et pour convertir le 35B. Si Xcode signale un compilateur Metal manquant, exécutez `xcodebuild -downloadComponent MetalToolchain`.
+
+Le répertoire `Models/` est copié dans l'application au moment de la compilation. Placez-y un modèle avant de compiler si vous voulez que ce bouton soit sélectionnable. Un répertoire `Models/` vide compile quand même ; le modèle manquant affiche **Not included**.
+
+### Télécharger un modèle
+
+```sh
+python3 -m venv .venv-tools
+.venv-tools/bin/python -m pip install --upgrade pip huggingface_hub numpy
+```
+
+Le 8B peut être empaqueté tel que téléchargé. Il pèse environ 5 GB, l'application installée a donc à peu près cette taille.
+
+```sh
+.venv-tools/bin/hf download Edge0/Edge0-8B-A1B-preview \
+ --local-dir Models/Edge0-8B-A1B-preview
+```
+
+Le 35B est un changement de disposition, pas une modification des poids. Le checkpoint publié stocke chaque expert sous forme de neuf lectures dispersées dans un fichier de 19 GB. Sur un iPhone, c'est trop lent, donc les outils ci-dessous réécrivent chaque expert en une seule lecture séquentielle et écrivent un fichier par couche. Conservez le téléchargement d'origine hors de `Models/`. Seul `Models/repacked/` doit contenir ce que l'application doit embarquer. Une compilation 35B pèse environ 20 GB.
+
+```sh
+mkdir -p checkpoints
+.venv-tools/bin/hf download Edge0/Edge0-35B-A3B-preview \
+ --local-dir checkpoints/Edge0-35B-A3B-preview
+
+SOURCE=checkpoints/Edge0-35B-A3B-preview
+OUTPUT=Models/repacked
+
+.venv-tools/bin/python tools/repack_experts.py pack "$SOURCE" "$OUTPUT"
+.venv-tools/bin/python tools/repack_experts.py resident "$SOURCE" "$OUTPUT"
+.venv-tools/bin/python tools/repack_experts.py verify "$SOURCE" "$OUTPUT"
+.venv-tools/bin/python tools/convert_tokenizer.py "$SOURCE" "$OUTPUT/tokenizer.bin"
+.venv-tools/bin/python tools/convert_pregate.py \
+ "$SOURCE/prerouter_edge0_35b.safetensors" \
+ "$OUTPUT/prerouter-stacked.safetensors"
+cp "$SOURCE/lora_edge0_35b.safetensors" "$OUTPUT/"
+```
+
+`Models/repacked/` doit contenir `resident.safetensors`, `tokenizer.bin`, ainsi que `experts-L00.bin` à `experts-L39.bin`. Vous pouvez empaqueter l'un ou l'autre modèle, ou les deux.
+
+Checkpoints :
+
+- [Edge0/Edge0-8B-A1B-preview](https://huggingface.co/Edge0/Edge0-8B-A1B-preview)
+- [Edge0/Edge0-35B-A3B-preview](https://huggingface.co/Edge0/Edge0-35B-A3B-preview)
+
+### Compilation et installation
+
+`com.example.edge0phone` dans le projet est un identifiant de bundle fictif. Avant de compiler ou de signer, remplacez-le par un identifiant de bundle unique que vous contrôlez. Dans Xcode, ouvrez `Edge0PhoneProbe.xcodeproj`, sélectionnez la cible **Edge0Phone**, puis modifiez **Signing & Capabilities → Bundle Identifier**. Choisissez votre équipe Apple Developer, connectez l'iPhone et lancez (Run).
+
+Pour définir l'équipe depuis un fichier, copiez `Config/Local.xcconfig.example` vers `Config/Local.xcconfig` et renseignez `DEVELOPMENT_TEAM`.
+
+La même compilation depuis la ligne de commande :
+
+```sh
+DEVICE_ID=<device id from `xcrun devicectl list devices`>
+TEAM_ID=<your Apple Developer Team ID>
+BUNDLE_ID=com.yourname.edge0phone # replace with your own unique bundle identifier
+
+xcodebuild -project Edge0PhoneProbe.xcodeproj \
+ -scheme Edge0Phone \
+ -destination "id=$DEVICE_ID" \
+ -derivedDataPath .build-device \
+ -allowProvisioningUpdates \
+ -skipPackagePluginValidation \
+ CODE_SIGN_STYLE=Automatic \
+ DEVELOPMENT_TEAM="$TEAM_ID" \
+ PRODUCT_BUNDLE_IDENTIFIER="$BUNDLE_ID" \
+ build
+
+xcrun devicectl device install app \
+ --device "$DEVICE_ID" \
+ .build-device/Build/Products/Debug-iphoneos/Edge0Phone.app
+```
+
+Les poids se trouvent à l'intérieur de ce `.app`. Il n'y a pas de copie séparée vers le téléphone.
+
+### Tests
+
+`scripts/test.sh` compile la bibliothèque MLX Metal avec Xcode, puis exécute les tests unitaires. La première exécution résout le paquet MLX Swift.
+
+```sh
+scripts/test.sh
+EDGE0_TEST_GPU=1 scripts/test.sh
+```
+
+### Utiliser l'application
+
+Lancez l'application et choisissez **Edge0 8B** ou **Edge0 35B**. Un modèle qui n'était pas dans `Models/` au moment de la compilation affiche **Not included** et ne peut pas être sélectionné. Saisissez une question ou touchez l'une des suggestions. La ligne sous une réponse affiche le nombre de tokens, le temps avant le premier token, le prefill, le decode et la mémoire de pointe. Changer de modèle décharge celui qui est chargé. New chat efface la conversation.
+
+## Performances
+
+| Modèle | Appareil | OS | Prefill | TTFT | Decode |
+| --- | --- | --- | --- | --- | --- |
+| 8B | iPhone 16 Pro | iOS 26.6.2 | 7.2 tok/s | 3.6 s | 10.9 tok/s |
+| 35B | iPhone 16 Pro | iOS 26.6.2 | 4.9 tok/s | 2.1 s | 6.4 tok/s |
+
+## Détails techniques
+
+L'application est en SwiftUI. `Edge0MLX` exécute le modèle. `Edge0Core` lit le checkpoint, le tokenizer et l'index de routage. Les calculs mathématiques passent par MLX Swift sur Metal. La cible de déploiement est iOS 17.
+
+Edge0 8B comporte 24 couches, alternant Kimi Delta Attention et attention latente multi-têtes, Top-8, INT4. Le prefill du prompt exécute une couche entière à la fois, par blocs de 2048 tokens au plus. Le premier token est glouton (greedy). Les tokens suivants utilisent une température de 0,7, top-k 64, top-p 0,95 et une pénalité de répétition de 1,1.
+
+Edge0 35B comporte 40 couches, 256 experts par couche, Top-4. Les poids résidents et les fichiers d'experts par couche sont lus séparément. Le cache de préfixes est stocké dans Application Support, car le bundle de l'application est en lecture seule. Les deux modèles ne sont jamais chargés en même temps.
diff --git a/ios/README_ja.md b/ios/README_ja.md
new file mode 100644
index 0000000..7f5f2a0
--- /dev/null
+++ b/ios/README_ja.md
@@ -0,0 +1,111 @@
+# Edge0Phone
+
+[English](README.md) | [中文](README_zh.md) | 日本語 | [Español](README_es.md) | [Français](README_fr.md)
+
+iPhone 向けオンデバイスチャット。アプリは Edge0 8B、Edge0 35B、またはその両方を実行でき、選択したモデルのみがロードされます。モデルの重みはこのフォルダには含まれていません。
+
+## クイックスタート
+
+Apple Silicon Mac、Xcode、そして Developer Mode をオンにした iOS 17 以降の iPhone が必要です。Python 3.10 以降は、重みのダウンロードと 35B の変換にのみ必要です。Xcode が Metal コンパイラの不足を報告する場合は、`xcodebuild -downloadComponent MetalToolchain` を実行してください。
+
+`Models/` ディレクトリはビルド時にアプリへコピーされます。ボタンを選択可能にしたい場合は、ビルド前にモデルをそこに置いてください。空の `Models/` ディレクトリでもビルドは成功します。存在しないモデルは **Not included** と表示されます。
+
+### モデルのダウンロード
+
+```sh
+python3 -m venv .venv-tools
+.venv-tools/bin/python -m pip install --upgrade pip huggingface_hub numpy
+```
+
+8B はダウンロードしたままの状態でパックできます。約 5 GB なので、インストールされるアプリもほぼそのサイズになります。
+
+```sh
+.venv-tools/bin/hf download Edge0/Edge0-8B-A1B-preview \
+ --local-dir Models/Edge0-8B-A1B-preview
+```
+
+35B は重みの変更ではなくレイアウトの変更です。公開されているチェックポイントは、各エキスパートを 19 GB のファイル全体に散らばった 9 回の読み取りとして格納しています。iPhone ではこれは遅すぎるため、以下のツールは各エキスパートを 1 回のシーケンシャル読み取りに書き換え、レイヤーごとに 1 ファイルを書き出します。元のダウンロードは `Models/` の外に保管してください。アプリに含めるべきものは `Models/repacked/` だけです。35B ビルドは約 20 GB になります。
+
+```sh
+mkdir -p checkpoints
+.venv-tools/bin/hf download Edge0/Edge0-35B-A3B-preview \
+ --local-dir checkpoints/Edge0-35B-A3B-preview
+
+SOURCE=checkpoints/Edge0-35B-A3B-preview
+OUTPUT=Models/repacked
+
+.venv-tools/bin/python tools/repack_experts.py pack "$SOURCE" "$OUTPUT"
+.venv-tools/bin/python tools/repack_experts.py resident "$SOURCE" "$OUTPUT"
+.venv-tools/bin/python tools/repack_experts.py verify "$SOURCE" "$OUTPUT"
+.venv-tools/bin/python tools/convert_tokenizer.py "$SOURCE" "$OUTPUT/tokenizer.bin"
+.venv-tools/bin/python tools/convert_pregate.py \
+ "$SOURCE/prerouter_edge0_35b.safetensors" \
+ "$OUTPUT/prerouter-stacked.safetensors"
+cp "$SOURCE/lora_edge0_35b.safetensors" "$OUTPUT/"
+```
+
+`Models/repacked/` には `resident.safetensors`、`tokenizer.bin`、および `experts-L00.bin` から `experts-L39.bin` が含まれている必要があります。どちらか一方のモデル、または両方をパックできます。
+
+チェックポイント:
+
+- [Edge0/Edge0-8B-A1B-preview](https://huggingface.co/Edge0/Edge0-8B-A1B-preview)
+- [Edge0/Edge0-35B-A3B-preview](https://huggingface.co/Edge0/Edge0-35B-A3B-preview)
+
+### ビルドとインストール
+
+プロジェクト内の `com.example.edge0phone` はプレースホルダのバンドル識別子です。ビルドや署名の前に、自分が管理する一意のバンドル識別子に置き換えてください。Xcode で `Edge0PhoneProbe.xcodeproj` を開き、**Edge0Phone** ターゲットを選択して、**Signing & Capabilities → Bundle Identifier** を変更します。Apple Developer Team を選び、iPhone を接続して Run します。
+
+代わりにファイルからチームを設定するには、`Config/Local.xcconfig.example` を `Config/Local.xcconfig` にコピーして `DEVELOPMENT_TEAM` を記入します。
+
+コマンドラインからの同じビルド:
+
+```sh
+DEVICE_ID=<device id from `xcrun devicectl list devices`>
+TEAM_ID=<your Apple Developer Team ID>
+BUNDLE_ID=com.yourname.edge0phone # replace with your own unique bundle identifier
+
+xcodebuild -project Edge0PhoneProbe.xcodeproj \
+ -scheme Edge0Phone \
+ -destination "id=$DEVICE_ID" \
+ -derivedDataPath .build-device \
+ -allowProvisioningUpdates \
+ -skipPackagePluginValidation \
+ CODE_SIGN_STYLE=Automatic \
+ DEVELOPMENT_TEAM="$TEAM_ID" \
+ PRODUCT_BUNDLE_IDENTIFIER="$BUNDLE_ID" \
+ build
+
+xcrun devicectl device install app \
+ --device "$DEVICE_ID" \
+ .build-device/Build/Products/Debug-iphoneos/Edge0Phone.app
+```
+
+重みはその `.app` の中に含まれています。スマートフォンへの個別のコピーはありません。
+
+### テスト
+
+`scripts/test.sh` は Xcode で MLX Metal ライブラリをビルドし、その後ユニットテストを実行します。初回実行では MLX Swift パッケージを解決します。
+
+```sh
+scripts/test.sh
+EDGE0_TEST_GPU=1 scripts/test.sh
+```
+
+### アプリの使い方
+
+アプリを起動し、**Edge0 8B** または **Edge0 35B** を選択します。ビルド時に `Models/` になかったモデルは **Not included** と表示され、選択できません。質問を入力するか、提案の 1 つをタップします。返信の下の行には、トークン数、最初のトークンまでの時間、プリフィル、デコード、ピークメモリが表示されます。モデルを切り替えると、ロード済みのモデルがアンロードされます。New chat は会話をクリアします。
+
+## パフォーマンス
+
+| モデル | デバイス | OS | プリフィル | TTFT | デコード |
+| --- | --- | --- | --- | --- | --- |
+| 8B | iPhone 16 Pro | iOS 26.6.2 | 7.2 tok/s | 3.6 s | 10.9 tok/s |
+| 35B | iPhone 16 Pro | iOS 26.6.2 | 4.9 tok/s | 2.1 s | 6.4 tok/s |
+
+## 技術詳細
+
+アプリは SwiftUI です。`Edge0MLX` がモデルを実行します。`Edge0Core` はチェックポイント、トークナイザー、ルーティングインデックスを読み取ります。計算は Metal 上の MLX Swift を通じて行われます。デプロイメントターゲットは iOS 17 です。
+
+Edge0 8B は 24 層で、Kimi Delta Attention とマルチヘッド潜在アテンションが交互に配置され、Top-8、INT4 です。プロンプトのプリフィルは 1 度に 1 層全体を、最大 2048 トークンのチャンクで実行します。最初のトークンは greedy です。以降のトークンは temperature 0.7、top-k 64、top-p 0.95、repetition penalty 1.1 を使用します。
+
+Edge0 35B は 40 層、レイヤーごとに 256 エキスパート、Top-4 です。常駐重みとレイヤーごとのエキスパートファイルは別々に読み取られます。プレフィックスキャッシュは Application Support に保存されます — アプリバンドルは読み取り専用だからです。2 つのモデルが同時にロードされることはありません。
diff --git a/ios/README_zh.md b/ios/README_zh.md
new file mode 100644
index 0000000..4b20f87
--- /dev/null
+++ b/ios/README_zh.md
@@ -0,0 +1,111 @@
+# Edge0Phone
+
+[English](README.md) | 中文 | [日本語](README_ja.md) | [Español](README_es.md) | [Français](README_fr.md)
+
+面向 iPhone 的端侧对话 App。可运行 Edge0 8B、Edge0 35B 或两者兼备,且只加载你选中的模型。模型权重不在本目录内。
+
+## 快速开始
+
+你需要一台 Apple Silicon Mac、Xcode,以及一部开启开发者模式、运行 iOS 17 或更高版本的 iPhone。Python 3.10+ 仅用于下载权重与转换 35B。若 Xcode 提示缺少 Metal 编译器,运行 `xcodebuild -downloadComponent MetalToolchain`。
+
+`Models/` 目录会在构建时拷贝进 App。若希望对应按钮可选,请在构建前把模型放入其中。`Models/` 为空也能构建;缺失的模型会显示 **Not included**。
+
+### 下载模型
+
+```sh
+python3 -m venv .venv-tools
+.venv-tools/bin/python -m pip install --upgrade pip huggingface_hub numpy
+```
+
+8B 下载后即可直接打包。它约 5 GB,因此安装后的 App 也约为该体积。
+
+```sh
+.venv-tools/bin/hf download Edge0/Edge0-8B-A1B-preview \
+ --local-dir Models/Edge0-8B-A1B-preview
+```
+
+35B 只是布局变化,权重本身不变。发布的 checkpoint 把每个专家存为一个 19 GB 文件中的九次分散读取。这在 iPhone 上太慢,因此下面的工具会把每个专家重写为一次顺序读取,并按层各写一个文件。原始下载请放在 `Models/` 之外。App 只应包含 `Models/repacked/`。35B 构建约 20 GB。
+
+```sh
+mkdir -p checkpoints
+.venv-tools/bin/hf download Edge0/Edge0-35B-A3B-preview \
+ --local-dir checkpoints/Edge0-35B-A3B-preview
+
+SOURCE=checkpoints/Edge0-35B-A3B-preview
+OUTPUT=Models/repacked
+
+.venv-tools/bin/python tools/repack_experts.py pack "$SOURCE" "$OUTPUT"
+.venv-tools/bin/python tools/repack_experts.py resident "$SOURCE" "$OUTPUT"
+.venv-tools/bin/python tools/repack_experts.py verify "$SOURCE" "$OUTPUT"
+.venv-tools/bin/python tools/convert_tokenizer.py "$SOURCE" "$OUTPUT/tokenizer.bin"
+.venv-tools/bin/python tools/convert_pregate.py \
+ "$SOURCE/prerouter_edge0_35b.safetensors" \
+ "$OUTPUT/prerouter-stacked.safetensors"
+cp "$SOURCE/lora_edge0_35b.safetensors" "$OUTPUT/"
+```
+
+`Models/repacked/` 必须包含 `resident.safetensors`、`tokenizer.bin` 以及 `experts-L00.bin` 至 `experts-L39.bin`。可以只打包其中一个模型,也可以两个都打包。
+
+Checkpoint:
+
+- [Edge0/Edge0-8B-A1B-preview](https://huggingface.co/Edge0/Edge0-8B-A1B-preview)
+- [Edge0/Edge0-35B-A3B-preview](https://huggingface.co/Edge0/Edge0-35B-A3B-preview)
+
+### 构建与安装
+
+项目中的 `com.example.edge0phone` 是占位 bundle identifier。构建或签名前,请替换为你自己掌控的唯一 bundle identifier。在 Xcode 中打开 `Edge0PhoneProbe.xcodeproj`,选择 **Edge0Phone** target,然后修改 **Signing & Capabilities → Bundle Identifier**。选择你的 Apple Developer Team,连接 iPhone 并运行。
+
+也可以改用文件方式设置 team:把 `Config/Local.xcconfig.example` 复制为 `Config/Local.xcconfig`,填入 `DEVELOPMENT_TEAM`。
+
+命令行执行同样的构建:
+
+```sh
+DEVICE_ID=<device id from `xcrun devicectl list devices`>
+TEAM_ID=<your Apple Developer Team ID>
+BUNDLE_ID=com.yourname.edge0phone # replace with your own unique bundle identifier
+
+xcodebuild -project Edge0PhoneProbe.xcodeproj \
+ -scheme Edge0Phone \
+ -destination "id=$DEVICE_ID" \
+ -derivedDataPath .build-device \
+ -allowProvisioningUpdates \
+ -skipPackagePluginValidation \
+ CODE_SIGN_STYLE=Automatic \
+ DEVELOPMENT_TEAM="$TEAM_ID" \
+ PRODUCT_BUNDLE_IDENTIFIER="$BUNDLE_ID" \
+ build
+
+xcrun devicectl device install app \
+ --device "$DEVICE_ID" \
+ .build-device/Build/Products/Debug-iphoneos/Edge0Phone.app
+```
+
+权重就在该 `.app` 内部,不会另行拷贝到手机上。
+
+### 测试
+
+`scripts/test.sh` 会用 Xcode 构建 MLX Metal 库,然后运行单元测试。首次运行会解析 MLX Swift 包。
+
+```sh
+scripts/test.sh
+EDGE0_TEST_GPU=1 scripts/test.sh
+```
+
+### 使用 App
+
+启动 App,选择 **Edge0 8B** 或 **Edge0 35B**。构建时不在 `Models/` 中的模型会显示 **Not included** 且不可选择。输入问题,或点按一条建议。回复下方一行显示 token 数、首 token 时间、prefill、decode 与峰值内存。切换模型会卸载当前已加载的模型。新对话会清空当前会话。
+
+## 性能实测
+
+| 模型 | 设备 | 系统 | Prefill | TTFT | 解码 |
+| --- | --- | --- | --- | --- | --- |
+| 8B | iPhone 16 Pro | iOS 26.6.2 | 7.2 tok/s | 3.6 s | 10.9 tok/s |
+| 35B | iPhone 16 Pro | iOS 26.6.2 | 4.9 tok/s | 2.1 s | 6.4 tok/s |
+
+## 技术细节
+
+App 采用 SwiftUI。`Edge0MLX` 负责运行模型。`Edge0Core` 读取 checkpoint、tokenizer 与路由索引。数学运算经由 Metal 上的 MLX Swift 完成。部署目标为 iOS 17。
+
+Edge0 8B 为 24 层,Kimi Delta Attention 与多头潜在注意力(multi-head latent attention)交替,Top-8,INT4。Prompt prefill 以整层为单位运行,每块最多 2048 token。首 token 采用贪心解码,后续 token 使用 temperature 0.7、top-k 64、top-p 0.95 与 1.1 的重复惩罚。
+
+Edge0 35B 为 40 层,每层 256 专家,Top-4。常驻权重与各层专家文件分开读取。前缀缓存存放在 Application Support 中,因为 App bundle 是只读的。两个模型绝不会同时加载。
diff --git a/macos/README.md b/macos/README.md
index aff7c0f..e2857e0 100644
--- a/macos/README.md
+++ b/macos/README.md
@@ -1,5 +1,7 @@
# edge0
+English | [中文](README_zh.md) | [日本語](README_ja.md) | [Español](README_es.md) | [Français](README_fr.md)
+
On-device inference for Apple Silicon. The app talks to a local OpenAI-compatible server that runs Edge0 MoE models (8B and 35B) with streaming expert weights, SSD offload, and Metal.
Requires **macOS 14+** on **Apple Silicon (M3 or later)**. All commands below are from this directory's root. MLX v0.30.6 is already under `third_party/mlx`.
diff --git a/macos/README_es.md b/macos/README_es.md
new file mode 100644
index 0000000..c72895e
--- /dev/null
+++ b/macos/README_es.md
@@ -0,0 +1,99 @@
+# edge0
+
+[English](README.md) | [中文](README_zh.md) | [日本語](README_ja.md) | Español | [Français](README_fr.md)
+
+Inferencia en el dispositivo para Apple Silicon. La aplicación se comunica con un servidor local compatible con OpenAI que ejecuta modelos MoE de Edge0 (8B y 35B) con pesos de expertos en streaming, offload a SSD y Metal.
+
+Requiere **macOS 14+** en **Apple Silicon (M3 o posterior)**. Todos los comandos siguientes se ejecutan desde la raíz de este directorio. MLX v0.30.6 ya está en `third_party/mlx`.
+
+## Inicio rápido
+
+### Requisitos previos
+
+- Xcode Command Line Tools (compilador de Metal)
+- CMake 3.24+
+- Rust 1.88 (`rustup` elegirá la versión desde `rust-toolchain.toml`)
+- Node 22 o posterior (se usa yarn 1.22 si ya está instalado; en caso contrario `check-prereqs` lo habilita mediante Corepack)
+
+`make app` ejecuta esta verificación. Para comprobarlo antes:
+
+```bash
+bash scripts/check-prereqs.sh
+```
+
+### Compilación y empaquetado
+
+```bash
+make app
+open dist/edge0-0.1.0-arm64.app
+```
+
+`make app` instala las dependencias de JavaScript, compila `edge0`, `edge0d` y `edge0-engine`, compila el motor nativo y después genera `dist/edge0-<version>-arm64.app`. No inicia la aplicación ni el servicio local. El `.app` está firmado de forma ad-hoc.
+
+### Primer inicio
+
+1. Abre el `.app`. El servicio local (`edge0d` en `127.0.0.1:8000`) se inicia con él.
+2. En la página Modelos, descarga un modelo desde Hugging Face (se guarda en `~/.edge0`), cárgalo y chatea.
+3. Chat: Enter envía. Las respuestas se transmiten en Markdown, incluidas las fórmulas matemáticas `$inline$` y `$$block$$`.
+4. API HTTP (loopback no necesita token):
+
+```bash
+curl http://127.0.0.1:8000/v1/chat/completions \
+ -H 'Content-Type: application/json' \
+ -d '{
+ "model": "edge0-8b",
+ "messages": [{"role": "user", "content": "Say hello in one sentence."}],
+ "stream": false
+ }'
+```
+
+El acceso fuera de loopback requiere `Authorization: Bearer <token>` desde la página Servicio.
+
+### Desarrollo
+
+Para iterar sin empaquetar:
+
+```bash
+make setup
+cargo build -p edge0d -p edge0-engine
+make engine
+cd app && yarn tauri dev
+```
+
+Esto inicia una ventana de desarrollo que puede lanzar el servicio local. `make engine` compila la biblioteca nativa de MLX/Metal.
+
+### Uso de la aplicación
+
+| Pantalla | Qué hace |
+| --- | --- |
+| Chat | Chat en streaming, prompts predefinidos, estilo de generación (Preciso / Equilibrado / Creativo), Markdown + fórmulas matemáticas |
+| Modelos | Descargar, cargar/liberar, keep-alive |
+| Servicio | Iniciar/detener el demonio, bind en LAN, LaunchAgent, token de API, verificación del entorno, registro de peticiones |
+| Configuración | Tema, tamaño de fuente, system prompt opcional |
+| Barra de menús | Estado, Abrir ventana, Reiniciar servicio, Salir (detiene el demonio que inició esta aplicación) |
+
+Los datos viven en `~/.edge0` (modelos, base de datos de sesiones, logs). La CLI es `Contents/Resources/bin/edge0` dentro del `.app`. `edge0 uninstall` detiene el servicio y cualquier LaunchAgent; añade `--purge` para eliminar los datos de usuario tras confirmación.
+
+## Rendimiento
+
+Medido en **MacBook Air, Apple M3**.
+
+| Modelo | Decode | Prefill | Memoria residente |
+| --- | --- | --- | --- |
+| Edge0-35B-A3B | 10–12 tok/s | ~70–130 tok/s | 4 GB |
+| Edge0-8B-A1B | 18–20 tok/s | ~300–570 tok/s | 1.7 GB |
+
+## Detalles técnicos
+
+```
+edge0.app (Tauri 2 + React 19)
+ HTTP 127.0.0.1:8000 → edge0d (OpenAI-compatible + /v1/edge0/*)
+ Unix socket frames → edge0-engine
+ dlopen → libedge0_engine_native.dylib + libmlx.dylib
+```
+
+- **UI:** Tauri 2, React 19, TanStack Router, Tailwind, Vercel AI SDK, streamdown + `@streamdown/math` (KaTeX).
+- **Demonio:** Rust. `/v1/chat/completions` (SSE). Descarga desde Hugging Face por defecto.
+- **Motor:** C++/Metal sobre mlx 0.30.6. Expertos en streaming int4 (slices mmap + pila caliente LRU + SSD offload), prefetch del prerouter, LoRA sin fusionar, caché de prefijos KV. NAX GEMM está desactivado por defecto (`MLX_METAL_NO_NAX`) porque mlx 0.30.6 es numéricamente incorrecto para edge0-8b en M5.
+
+`EDGE0_HOME` tiene por defecto `~/.edge0`.
diff --git a/macos/README_fr.md b/macos/README_fr.md
new file mode 100644
index 0000000..d752915
--- /dev/null
+++ b/macos/README_fr.md
@@ -0,0 +1,99 @@
+# edge0
+
+[English](README.md) | [中文](README_zh.md) | [日本語](README_ja.md) | [Español](README_es.md) | Français
+
+Inférence embarquée pour Apple Silicon. L'application communique avec un serveur local compatible OpenAI qui exécute les modèles MoE Edge0 (8B et 35B) avec des poids d'experts en streaming, SSD offload et Metal.
+
+Nécessite **macOS 14+** sur **Apple Silicon (M3 ou ultérieur)**. Toutes les commandes ci-dessous s'exécutent depuis la racine de ce répertoire. MLX v0.30.6 est déjà présent sous `third_party/mlx`.
+
+## Démarrage rapide
+
+### Prérequis
+
+- Xcode Command Line Tools (compilateur Metal)
+- CMake 3.24+
+- Rust 1.88 (`rustup` choisira la version depuis `rust-toolchain.toml`)
+- Node 22 ou ultérieur (yarn 1.22 est utilisé s'il est déjà installé ; sinon `check-prereqs` l'active via Corepack)
+
+`make app` exécute cette vérification. Pour vérifier d'abord :
+
+```bash
+bash scripts/check-prereqs.sh
+```
+
+### Compilation et packaging
+
+```bash
+make app
+open dist/edge0-0.1.0-arm64.app
+```
+
+`make app` installe les dépendances JavaScript, compile `edge0`, `edge0d` et `edge0-engine`, compile le moteur natif, puis génère `dist/edge0-<version>-arm64.app`. Il ne lance ni l'application ni le service local. Le `.app` est signé ad hoc.
+
+### Premier lancement
+
+1. Ouvrez le `.app`. Le service local (`edge0d` sur `127.0.0.1:8000`) démarre avec lui.
+2. Sur la page Models, téléchargez un modèle depuis Hugging Face (stocké sous `~/.edge0`), chargez-le, puis discutez.
+3. Chat : Entrée envoie. Les réponses arrivent en streaming au format Markdown, y compris les formules mathématiques `$inline$` et `$$block$$`.
+4. API HTTP (le loopback ne nécessite pas de token) :
+
+```bash
+curl http://127.0.0.1:8000/v1/chat/completions \
+ -H 'Content-Type: application/json' \
+ -d '{
+ "model": "edge0-8b",
+ "messages": [{"role": "user", "content": "Say hello in one sentence."}],
+ "stream": false
+ }'
+```
+
+L'accès hors loopback nécessite `Authorization: Bearer <token>` depuis la page Service.
+
+### Développement
+
+Pour itérer sans packaging :
+
+```bash
+make setup
+cargo build -p edge0d -p edge0-engine
+make engine
+cd app && yarn tauri dev
+```
+
+Cela lance une fenêtre de développement qui peut démarrer le service local. `make engine` compile la bibliothèque native MLX/Metal.
+
+### Utilisation de l'application
+
+| Écran | Rôle |
+| --- | --- |
+| Chat | Chat en streaming, prompts prédéfinis, style de génération (Precise / Balanced / Creative), Markdown + formules mathématiques |
+| Models | Téléchargement, chargement/déchargement, maintien actif (keep-alive) |
+| Service | Démarrer/arrêter le démon, liaison LAN, LaunchAgent, token API, vérification de l'environnement, journal des requêtes |
+| Settings | Thème, taille de police, prompt système optionnel |
+| Menu bar | Status, Open window, Restart service, Quit (arrête le démon que cette application a démarré) |
+
+Les données résident dans `~/.edge0` (modèles, base de données des sessions, journaux). La CLI se trouve dans `Contents/Resources/bin/edge0` à l'intérieur du `.app`. `edge0 uninstall` arrête le service et tout LaunchAgent ; ajoutez `--purge` pour supprimer les données utilisateur après confirmation.
+
+## Performances
+
+Mesurées sur **MacBook Air, Apple M3**.
+
+| Modèle | Decode | Prefill | Mémoire résidente |
+| --- | --- | --- | --- |
+| Edge0-35B-A3B | 10–12 tok/s | ~70–130 tok/s | 4 GB |
+| Edge0-8B-A1B | 18–20 tok/s | ~300–570 tok/s | 1.7 GB |
+
+## Détails techniques
+
+```
+edge0.app (Tauri 2 + React 19)
+ HTTP 127.0.0.1:8000 → edge0d (OpenAI-compatible + /v1/edge0/*)
+ Unix socket frames → edge0-engine
+ dlopen → libedge0_engine_native.dylib + libmlx.dylib
+```
+
+- **UI :** Tauri 2, React 19, TanStack Router, Tailwind, Vercel AI SDK, streamdown + `@streamdown/math` (KaTeX).
+- **Démon :** Rust. `/v1/chat/completions` (SSE). Téléchargements depuis Hugging Face par défaut.
+- **Moteur :** C++/Metal sur mlx 0.30.6. Experts int4 en streaming (tranches mmap + pile LRU à chaud + SSD offload), préchargement prerouter, LoRA non fusionné, KV cache de préfixe. NAX GEMM est désactivé par défaut (`MLX_METAL_NO_NAX`) car mlx 0.30.6 est numériquement incorrect pour edge0-8b sur M5.
+
+`EDGE0_HOME` a pour valeur par défaut `~/.edge0`.
diff --git a/macos/README_ja.md b/macos/README_ja.md
new file mode 100644
index 0000000..839157c
--- /dev/null
+++ b/macos/README_ja.md
@@ -0,0 +1,99 @@
+# edge0
+
+[English](README.md) | [中文](README_zh.md) | 日本語 | [Español](README_es.md) | [Français](README_fr.md)
+
+Apple Silicon 向けオンデバイス推論。アプリはローカルの OpenAI 互換サーバーと通信し、そのサーバーが Edge0 MoE モデル(8B および 35B)を、ストリーミングされるエキスパート重み、SSD オフロード、Metal で実行します。
+
+**Apple Silicon(M3 以降)**搭載の **macOS 14+** が必要です。以下のすべてのコマンドはこのディレクトリのルートから実行します。MLX v0.30.6 はすでに `third_party/mlx` に含まれています。
+
+## クイックスタート
+
+### 前提条件
+
+- Xcode Command Line Tools(Metal コンパイラ)
+- CMake 3.24+
+- Rust 1.88(`rustup` が `rust-toolchain.toml` からバージョンを選択します)
+- Node 22 以降(すでにインストールされている場合は yarn 1.22 が使われます;そうでない場合は `check-prereqs` が Corepack 経由で有効化します)
+
+`make app` はこのチェックを実行します。事前に確認するには:
+
+```bash
+bash scripts/check-prereqs.sh
+```
+
+### ビルドとパッケージング
+
+```bash
+make app
+open dist/edge0-0.1.0-arm64.app
+```
+
+`make app` は JavaScript の依存関係をインストールし、`edge0`、`edge0d`、`edge0-engine` をビルドし、ネイティブエンジンをコンパイルしてから、`dist/edge0-<version>-arm64.app` を書き出します。アプリやローカルサービスの起動は行いません。`.app` は ad-hoc 署名されています。
+
+### 初回起動
+
+1. `.app` を開きます。ローカルサービス(`127.0.0.1:8000` の `edge0d`)も同時に起動します。
+2. Models ページで、Hugging Face からモデルをダウンロードし(`~/.edge0` に保存されます)、ロードしてからチャットします。
+3. チャット: Enter で送信します。返信は Markdown としてストリーミング表示され、`$inline$` および `$$block$$` 数式を含みます。
+4. HTTP API(ループバックにはトークン不要):
+
+```bash
+curl http://127.0.0.1:8000/v1/chat/completions \
+ -H 'Content-Type: application/json' \
+ -d '{
+ "model": "edge0-8b",
+ "messages": [{"role": "user", "content": "Say hello in one sentence."}],
+ "stream": false
+ }'
+```
+
+ループバック以外からのアクセスには、Service ページで取得できる `Authorization: Bearer <token>` が必要です。
+
+### 開発
+
+パッケージングせずに反復作業するには:
+
+```bash
+make setup
+cargo build -p edge0d -p edge0-engine
+make engine
+cd app && yarn tauri dev
+```
+
+ローカルサービスを起動できる開発ウィンドウが開きます。`make engine` はネイティブの MLX/Metal ライブラリをビルドします。
+
+### アプリの使い方
+
+| 画面 | 機能 |
+| --- | --- |
+| Chat | ストリーミングチャット、プリセットプロンプト、生成スタイル(Precise / Balanced / Creative)、Markdown + 数式 |
+| Models | ダウンロード、ロード/アンロード、keep-alive |
+| Service | デーモンの起動/停止、LAN バインド、LaunchAgent、API トークン、環境チェック、リクエストログ |
+| Settings | テーマ、フォントサイズ、オプションのシステムプロンプト |
+| メニューバー | ステータス、ウィンドウを開く、サービスの再起動、終了(このアプリが起動したデーモンを停止します)|
+
+データは `~/.edge0` に保存されます(モデル、セッションデータベース、ログ)。CLI は `.app` 内の `Contents/Resources/bin/edge0` です。`edge0 uninstall` はサービスと LaunchAgent を停止します。確認後にユーザーデータを削除するには `--purge` を追加します。
+
+## パフォーマンス
+
+**MacBook Air、Apple M3** で測定。
+
+| モデル | デコード | プリフィル | 常駐メモリ |
+| --- | --- | --- | --- |
+| Edge0-35B-A3B | 10–12 tok/s | ~70–130 tok/s | 4 GB |
+| Edge0-8B-A1B | 18–20 tok/s | ~300–570 tok/s | 1.7 GB |
+
+## 技術詳細
+
+```
+edge0.app (Tauri 2 + React 19)
+ HTTP 127.0.0.1:8000 → edge0d (OpenAI-compatible + /v1/edge0/*)
+ Unix socket frames → edge0-engine
+ dlopen → libedge0_engine_native.dylib + libmlx.dylib
+```
+
+- **UI:** Tauri 2、React 19、TanStack Router、Tailwind、Vercel AI SDK、streamdown + `@streamdown/math`(KaTeX)。
+- **デーモン:** Rust。`/v1/chat/completions`(SSE)。デフォルトでは Hugging Face からダウンロードします。
+- **エンジン:** mlx 0.30.6 上の C++/Metal。Int4 ストリーミングエキスパート(mmap スライス + LRU ホットスタック + SSD オフロード)、prerouter プリフェッチ、非マージ LoRA、KV プレフィックスキャッシュ。NAX GEMM はデフォルトでオフです(`MLX_METAL_NO_NAX`)。mlx 0.30.6 が M5 上で edge0-8b に対して数値的に誤った結果を出すためです。
+
+`EDGE0_HOME` のデフォルトは `~/.edge0` です。
diff --git a/macos/README_zh.md b/macos/README_zh.md
new file mode 100644
index 0000000..c8dbb08
--- /dev/null
+++ b/macos/README_zh.md
@@ -0,0 +1,99 @@
+# edge0
+
+[English](README.md) | 中文 | [日本語](README_ja.md) | [Español](README_es.md) | [Français](README_fr.md)
+
+面向 Apple Silicon 的端侧推理。App 与本地 OpenAI 兼容 server 通信,由其以流式专家权重、SSD offload 与 Metal 运行 Edge0 MoE 模型(8B 与 35B)。
+
+需要 **Apple Silicon(M3 或更新机型)**上的 **macOS 14+**。下文所有命令均在本目录根下运行。MLX v0.30.6 已置于 `third_party/mlx`。
+
+## 快速开始
+
+### 环境要求
+
+- Xcode Command Line Tools(Metal 编译器)
+- CMake 3.24+
+- Rust 1.88(`rustup` 会按 `rust-toolchain.toml` 选择版本)
+- Node 22 或更新版本(若已安装则使用 yarn 1.22;否则 `check-prereqs` 会通过 Corepack 启用)
+
+`make app` 会执行该检查。如需先行验证:
+
+```bash
+bash scripts/check-prereqs.sh
+```
+
+### 构建与打包
+
+```bash
+make app
+open dist/edge0-0.1.0-arm64.app
+```
+
+`make app` 会安装 JavaScript 依赖,构建 `edge0`、`edge0d` 与 `edge0-engine`,编译原生引擎,然后生成 `dist/edge0-<version>-arm64.app`。它不会启动 App 或本地服务。`.app` 为 ad-hoc 签名。
+
+### 首次启动
+
+1. 打开 `.app`。本地服务(监听 `127.0.0.1:8000` 的 `edge0d`)随之启动。
+2. 在 Models 页面从 Hugging Face 下载模型(存放于 `~/.edge0`),加载后即可对话。
+3. 对话:Enter 发送。回复以 Markdown 流式呈现,支持 `$inline$` 与 `$$block$$` 数学公式。
+4. HTTP API(回环访问无需 token):
+
+```bash
+curl http://127.0.0.1:8000/v1/chat/completions \
+ -H 'Content-Type: application/json' \
+ -d '{
+ "model": "edge0-8b",
+ "messages": [{"role": "user", "content": "Say hello in one sentence."}],
+ "stream": false
+ }'
+```
+
+非回环访问需要携带 Service 页面提供的 `Authorization: Bearer <token>`。
+
+### 开发
+
+无需打包即可迭代开发:
+
+```bash
+make setup
+cargo build -p edge0d -p edge0-engine
+make engine
+cd app && yarn tauri dev
+```
+
+这会启动一个可拉起本地服务的开发窗口。`make engine` 构建原生 MLX/Metal 库。
+
+### App 使用
+
+| 页面 | 功能 |
+| --- | --- |
+| Chat | 流式对话、预置提示词、生成风格(Precise / Balanced / Creative)、Markdown + 数学公式 |
+| Models | 下载、加载/卸载、keep-alive |
+| Service | 启停 daemon、局域网绑定、LaunchAgent、API token、环境检查、请求日志 |
+| Settings | 主题、字号、可选系统提示词 |
+| 菜单栏 | 状态、打开窗口、重启服务、退出(会停止本 App 启动的 daemon) |
+
+数据存放于 `~/.edge0`(模型、会话数据库、日志)。CLI 位于 `.app` 内的 `Contents/Resources/bin/edge0`。`edge0 uninstall` 会停止服务与所有 LaunchAgent;加 `--purge` 可在确认后删除用户数据。
+
+## 性能实测
+
+在 **MacBook Air(Apple M3)**上实测。
+
+| 模型 | 解码 | Prefill | 常驻内存 |
+| --- | --- | --- | --- |
+| Edge0-35B-A3B | 10–12 tok/s | ~70–130 tok/s | 4 GB |
+| Edge0-8B-A1B | 18–20 tok/s | ~300–570 tok/s | 1.7 GB |
+
+## 技术细节
+
+```
+edge0.app (Tauri 2 + React 19)
+ HTTP 127.0.0.1:8000 → edge0d (OpenAI-compatible + /v1/edge0/*)
+ Unix socket frames → edge0-engine
+ dlopen → libedge0_engine_native.dylib + libmlx.dylib
+```
+
+- **UI:**Tauri 2、React 19、TanStack Router、Tailwind、Vercel AI SDK、streamdown + `@streamdown/math`(KaTeX)。
+- **Daemon:**Rust。`/v1/chat/completions`(SSE)。默认从 Hugging Face 下载。
+- **引擎:**基于 mlx 0.30.6 的 C++/Metal。Int4 流式专家(mmap 切片 + LRU 热栈 + SSD offload)、prerouter 预取、不合并的 LoRA、KV 前缀缓存。NAX GEMM 默认关闭(`MLX_METAL_NO_NAX`),因为 mlx 0.30.6 在 M5 上对 edge0-8b 的数值结果有误。
+
+`EDGE0_HOME` 默认为 `~/.edge0`。
diff --git a/python/README.md b/python/README.md
index c3fe3bc..3a323f4 100644
--- a/python/README.md
+++ b/python/README.md
@@ -1,5 +1,7 @@
# edge0 — Python framework
+English | [中文](README_zh.md) | [日本語](README_ja.md) | [Español](README_es.md) | [Français](README_fr.md)
+
This document is for **developers installing and running the edge0 Python
framework from source**. It covers: quick start (install → models → run),
measured performance and quality, and the design behind the stack.
diff --git a/python/README_es.md b/python/README_es.md
new file mode 100644
index 0000000..5276f72
--- /dev/null
+++ b/python/README_es.md
@@ -0,0 +1,215 @@
+# edge0 — Framework de Python
+
+[English](README.md) | [中文](README_zh.md) | [日本語](README_ja.md) | Español | [Français](README_fr.md)
+
+Este documento está dirigido a **desarrolladores que instalan y ejecutan el
+framework de Python de edge0 desde el código fuente**. Cubre: inicio rápido
+(instalación → modelos → ejecución), rendimiento y calidad medidos, y el
+diseño detrás del stack.
+
+edge0 se publica como **monorepo** —
+[`Edge0-AI/edge0`](https://github.com/Edge0-AI/edge0) — cuyo nivel superior
+contiene la documentación compartida (`docs/`) y los subproyectos de
+plataforma (`python/` = este framework, además de `macos/`, `ios/`,
+`android/`, `windows/`). El framework de Python es la implementación de
+referencia de la receta edge0 — **SSD expert offload + Recover-LoRA +
+predicción de enrutamiento del prerouter** — que ejecuta grandes modelos
+sparse-MoE en Apple Silicon mediante MLX, con una memoria pico limitada por el
+conjunto de expertos *activos* en lugar del número de parámetros.
+
+Atribución de terceros: consulta [`NOTICE`](../NOTICE) en la raíz del
+repositorio. Fichas de modelo:
+[Edge0/Edge0-8B-A1B-preview](https://huggingface.co/Edge0/Edge0-8B-A1B-preview)
+· [Edge0/Edge0-35B-A3B-preview](https://huggingface.co/Edge0/Edge0-35B-A3B-preview).
+Todos los comandos siguientes se ejecutan desde este directorio (`python/`).
+
+---
+
+## Inicio rápido
+
+### Requisitos previos
+
+| componente | requisito |
+|---|---|
+| SO / hardware | macOS en Apple Silicon (M1/M2/M3/M4) — el backend MLX es exclusivo de Apple Silicon; un backend CUDA está en la hoja de ruta |
+| Python | 3.10+ (se recomienda 3.12) |
+| MLX | `mlx==0.30.6` / `mlx-metal==0.30.6` con `mlx-lm==0.31.0` (consulta `pyproject.toml`) |
+| Memoria | ~2.9 GB activos pico (edge0-35b), ~1.0 GB (edge0-8b), contextos cortos |
+| Disco | ~23 GB (edge0-35b) / ~4.2 GB (edge0-8b); los pesos de los expertos se mapean con mmap y se leen bajo demanda, no se cargan en RAM por adelantado |
+
+> Una salida ilegible o mezclada de idiomas en Apple A18 / A18 Pro indica un
+> `mlx` antiguo: `pip install 'mlx==0.30.6' 'mlx-metal==0.30.6'`
+> ([#8](https://github.com/Edge0-AI/Edge0/issues/8)).
+
+### Instalación
+
+```bash
+python3.12 -m venv .venv && .venv/bin/pip install -e '.[dev,fetch]'
+```
+
+### Modelos
+
+Ambos niveles están publicados en Hugging Face y ModelScope; cada repositorio
+incluye el checkpoint base y los adaptadores entrenados de LoRA + prerouter en
+**un solo directorio**, de modo que una única descarga es un modelo listo para
+ejecutar:
+
+```bash
+# the repo's helper (defaults to the two published tiers):
+.venv/bin/python scripts/fetch_models.py --tier edge0-8b --target-dir models
+.venv/bin/python scripts/fetch_models.py --tier edge0-35b --target-dir models
+
+# or directly with the CLI:
+.venv/bin/huggingface-cli download Edge0/Edge0-8B-A1B-preview --local-dir models/edge0-8b
+.venv/bin/huggingface-cli download Edge0/Edge0-35B-A3B-preview --local-dir models/edge0-35b
+```
+
+Apunta edge0 a un nivel mediante una variable de entorno, o pasa el directorio
+directamente (el nivel se detecta automáticamente desde `config.json`):
+
+```bash
+export EDGE0_8B_MODEL=$PWD/models/edge0-8b
+```
+
+### Ejecución
+
+```bash
+edge0 demo edge0-8b # one-shot generation demo
+edge0 chat edge0-8b --prompt "Explain streaming inference in one sentence."
+edge0 serve edge0-8b # OpenAI-compatible server on http://127.0.0.1:8000
+```
+
+```bash
+curl http://127.0.0.1:8000/v1/chat/completions \
+ -H 'Content-Type: application/json' \
+ -d '{"model":"edge0-8b","messages":[{"role":"user","content":"Hello!"}],"max_tokens":32}'
+```
+
+`python -m edge0 ...` es equivalente a `edge0 ...`.
+
+### API de Python
+
+```python
+from edge0 import AutoEngine
+from edge0.server.chat import ChatMessage, ChatRequest, ChatSession
+
+engine = AutoEngine.from_pretrained("/path/to/model") # tier auto-detected
+req = ChatRequest(
+ model=engine.name,
+ messages=[ChatMessage(role="user", content="Hello!")],
+ max_tokens=64,
+)
+tokens, meta = ChatSession(engine, req).run()
+print(engine._tok.decode(tokens))
+engine.close() # release mmaps / expert cache
+```
+
+`examples/demo.py` es el mismo recorrido mínimo (`edge0 demo` ejecuta
+exactamente esta ruta).
+
+---
+
+## Rendimiento
+
+Medido con `examples/bench.py` (prefill de un prompt de 3.3k tokens → 10 pasos
+de calentamiento muestreados → 200 tokens de decode muestreados y
+cronometrados, 2 ejecuciones por nivel):
+
+| Nivel | Velocidad de decode | Throughput de prefill (frío / caliente)* | Memoria activa pico | Máquina de pruebas |
+|---|---|---|---|---|
+| `edge0-35b` | 14.9–17.7 tok/s | 113 / 140 tok/s | 2.9 GiB | Mac mini M4 Pro, 24 GB |
+| `edge0-8b` | 23.9–25.3 tok/s | 500 / 1428 tok/s | 1.0 GiB | Mac mini M4 Pro, 24 GB |
+
+*Frío = primera petición tras iniciar el proceso (los pesos de expertos entran
+por fallos de página desde el SSD); caliente = peticiones posteriores
+(residentes en la caché de páginas).*
+
+```bash
+python examples/bench.py edge0-8b # via $EDGE0_8B_MODEL
+python examples/bench.py edge0-35b # via $EDGE0_35B_MODEL
+```
+
+## Calidad
+
+Ejecutado con [OpenCompass](https://github.com/open-compass/opencompass) bajo
+configuraciones idénticas para los modelos edge0 (int4 + adaptadores
+entrenados + prerouter) y las bases fp16 originales. El pipeline edge0 pierde
+poco: **3.9 puntos de media para edge0-35b, 2.8 para edge0-8b** (MMLU-Pro
+incluso supera a la base). Máximo 100:
+
+| Benchmark | edge0-35b (int4) | Qwen3.6-35B-A3B (fp16) | edge0-8b (int4) | Ling 3.0 tiny (fp16) |
+|---|---:|---:|---:|---:|
+| AIME 2026 | 86.6 | 92.7 | 63.3 | 73.3 |
+| HumanEval | 90.9 | 95.1 | 91.5 | 92.7 |
+| GPQA-Diamond | 79.8 | 81.8 | 70.7 | 71.2 |
+| MMLU-Pro | 81.0 | 84.6 | 70.1 | 65.8 |
+| IFBench | 57.9 | 61.7 | 53.9 | 60.6 |
+| **Media** | **79.2** | **83.2** | **69.9** | **72.7** |
+
+---
+
+## Detalles técnicos
+
+### Mecanismos principales
+
+- **SSD expert offload** — los pesos de los expertos se transmiten desde el
+ almacenamiento bajo demanda; la memoria pico está limitada por el conjunto
+ activo, no por el número de parámetros.
+- **Prerouter** — una cabeza entrenada predice el enrutamiento de expertos un
+ paso por delante, de modo que las cargas de expertos se solapan con el
+ forward pass en lugar de bloquearlo (**hasta +59%** de throughput de decode;
+ la ganancia crece con la latencia del almacenamiento, el tamaño del modelo y
+ el ancho de enrutamiento *K*).
+- **Recover-LoRA** — la base int4 está congelada y los adaptadores LoRA se
+ entrenan por destilación desde el teacher FP, recuperando la mayor parte de
+ la pérdida de cuantización a 4 bits. Los adaptadores permanecen sin
+ fusionar: una única base de solo lectura sirve a varios conjuntos de
+ adaptadores.
+
+### Diseño
+
+- **Uso al estilo transformers** — `AutoModel` / `AutoConfig` / `AutoEngine`
+ resuelven el nivel a partir del nombre del modelo.
+- **Aislamiento de backends** — todo el código MLX vive en
+ `src/edge0/backends/mlx/`; la lógica principal (especificaciones de modelos,
+ prerouter, pool de expertos en streaming, servidor) depende solo de la
+ fachada del backend (`backends/base.py`), de modo que un nuevo backend
+ implementa la misma fachada (`backends/cuda/` es un espacio reservado) sin
+ ningún cambio en el código principal.
+- **Adaptadores como safetensors** — los pesos de LoRA y del prerouter son
+ archivos `.safetensors` con metadatos de procedencia (fuente, versión, capas
+ propietarias), resueltos desde el directorio del modelo o la alternativa
+ `artifacts/` ignorada por git.
+- **Modelo + adaptadores en un solo directorio** — un directorio de modelo
+ contiene el checkpoint base y los adaptadores de ese modelo; actualizar los
+ adaptadores solo reemplaza los archivos de adaptadores — la base permanece
+ de solo lectura y nunca se fusiona.
+
+### Estructura del paquete
+
+```
+src/edge0/
+├── backends/mlx/ # MLX backend (isolation boundary; cuda/ reserved)
+├── engine/ models/ moe/ prerouter/ streaming/
+├── adapters/ attention/ server/
+└── cli.py registry.py sampling.py config.py
+```
+
+---
+
+## Documentación
+
+- [Arquitectura](../docs/architecture.md)
+- [Atención](../docs/attention.md) / [MoE](../docs/moe.md) / [Streaming SSD](../docs/streaming.md) / [prerouter](../docs/prerouter.md)
+- [Añadir un modelo](../docs/adding-a-model.md)
+- [edge0-35b](../docs/models/edge0-35b.md) / [edge0-8b](../docs/models/edge0-8b.md)
+- Informe técnico: [The Other Half of the Memory Wall](https://arxiv.org/abs/2609.18063) ([PDF](../paper/main.pdf))
+
+## Pruebas
+
+```bash
+pytest # unit tests (no real weights)
+EDGE0_8B_MODEL=/path/to/edge0-8b pytest -m slow -q # real-weight generation
+.venv/bin/python scripts/e2e_smoke.py \
+ --qwen-dir /path/to/edge0-35b --ling-dir /path/to/edge0-8b
+```
diff --git a/python/README_fr.md b/python/README_fr.md
new file mode 100644
index 0000000..85f51d4
--- /dev/null
+++ b/python/README_fr.md
@@ -0,0 +1,219 @@
+# edge0 — Framework Python
+
+[English](README.md) | [中文](README_zh.md) | [日本語](README_ja.md) | [Español](README_es.md) | Français
+
+Ce document s'adresse aux **développeurs qui installent et exécutent le
+framework Python edge0 depuis les sources**. Il couvre : le démarrage
+rapide (installation → modèles → exécution), les performances et la
+qualité mesurées, ainsi que la conception de la stack.
+
+edge0 est publié sous forme de **monorepo** —
+[`Edge0-AI/edge0`](https://github.com/Edge0-AI/edge0) — dont le niveau
+supérieur contient la documentation partagée (`docs/`) et les
+sous-projets par plateforme (`python/` = ce framework, ainsi que
+`macos/`, `ios/`, `android/`, `windows/`). Le framework Python est
+l'implémentation de référence de la recette edge0 — **SSD expert offload
++ Recover-LoRA + prédiction de routage prerouter** — qui exécute de
+grands modèles MoE creux (sparse-MoE) sur Apple Silicon via MLX, avec une
+mémoire de pointe limitée par l'ensemble *actif* d'experts plutôt que par
+le nombre de paramètres.
+
+Attribution tierce : voir [`NOTICE`](../NOTICE) à la racine du dépôt.
+Cartes de modèles : [Edge0/Edge0-8B-A1B-preview](https://huggingface.co/Edge0/Edge0-8B-A1B-preview)
+· [Edge0/Edge0-35B-A3B-preview](https://huggingface.co/Edge0/Edge0-35B-A3B-preview).
+Toutes les commandes ci-dessous s'exécutent depuis ce répertoire
+(`python/`).
+
+---
+
+## Démarrage rapide
+
+### Prérequis
+
+| composant | exigence |
+|---|---|
+| OS / matériel | macOS sur Apple Silicon (M1/M2/M3/M4) — le backend MLX est réservé à Apple Silicon ; un backend CUDA est sur la feuille de route |
+| Python | 3.10+ (3.12 recommandé) |
+| MLX | `mlx==0.30.6` / `mlx-metal==0.30.6` avec `mlx-lm==0.31.0` (voir `pyproject.toml`) |
+| Mémoire | ~2,9 GB actifs de pointe (edge0-35b), ~1,0 GB (edge0-8b), contextes courts |
+| Disque | ~23 GB (edge0-35b) / ~4,2 GB (edge0-8b) ; les poids des experts sont mmappés et lus à la demande, pas chargés en RAM au démarrage |
+
+> Une sortie illisible ou mêlant plusieurs langues sur Apple A18 / A18 Pro
+> indique une version plus ancienne de `mlx` :
+> `pip install 'mlx==0.30.6' 'mlx-metal==0.30.6'`
+> ([#8](https://github.com/Edge0-AI/Edge0/issues/8)).
+
+### Installation
+
+```bash
+python3.12 -m venv .venv && .venv/bin/pip install -e '.[dev,fetch]'
+```
+
+### Modèles
+
+Les deux gammes sont publiées sur Hugging Face et ModelScope ; chaque
+dépôt regroupe le checkpoint de base et les adaptateurs LoRA + prerouter
+entraînés dans **un seul répertoire**, de sorte qu'un unique
+téléchargement constitue un modèle prêt à l'emploi :
+
+```bash
+# the repo's helper (defaults to the two published tiers):
+.venv/bin/python scripts/fetch_models.py --tier edge0-8b --target-dir models
+.venv/bin/python scripts/fetch_models.py --tier edge0-35b --target-dir models
+
+# or directly with the CLI:
+.venv/bin/huggingface-cli download Edge0/Edge0-8B-A1B-preview --local-dir models/edge0-8b
+.venv/bin/huggingface-cli download Edge0/Edge0-35B-A3B-preview --local-dir models/edge0-35b
+```
+
+Pointez edge0 vers une gamme via une variable d'environnement, ou passez
+directement le répertoire (la gamme est détectée automatiquement depuis
+`config.json`) :
+
+```bash
+export EDGE0_8B_MODEL=$PWD/models/edge0-8b
+```
+
+### Exécution
+
+```bash
+edge0 demo edge0-8b # one-shot generation demo
+edge0 chat edge0-8b --prompt "Explain streaming inference in one sentence."
+edge0 serve edge0-8b # OpenAI-compatible server on http://127.0.0.1:8000
+```
+
+```bash
+curl http://127.0.0.1:8000/v1/chat/completions \
+ -H 'Content-Type: application/json' \
+ -d '{"model":"edge0-8b","messages":[{"role":"user","content":"Hello!"}],"max_tokens":32}'
+```
+
+`python -m edge0 ...` est équivalent à `edge0 ...`.
+
+### API Python
+
+```python
+from edge0 import AutoEngine
+from edge0.server.chat import ChatMessage, ChatRequest, ChatSession
+
+engine = AutoEngine.from_pretrained("/path/to/model") # tier auto-detected
+req = ChatRequest(
+ model=engine.name,
+ messages=[ChatMessage(role="user", content="Hello!")],
+ max_tokens=64,
+)
+tokens, meta = ChatSession(engine, req).run()
+print(engine._tok.decode(tokens))
+engine.close() # release mmaps / expert cache
+```
+
+`examples/demo.py` est le même parcours minimal (`edge0 demo` exécute
+exactement ce chemin).
+
+---
+
+## Performances
+
+Mesurées avec `examples/bench.py` (prefill d'un prompt de 3,3 k tokens →
+10 pas d'échauffement échantillonnés → 200 tokens de decode
+échantillonnés et chronométrés, 2 exécutions par gamme) :
+
+| Gamme | Vitesse de decode | Débit de prefill (à froid / à chaud)* | Mémoire active de pointe | Machine de test |
+|---|---|---|---|---|
+| `edge0-35b` | 14.9–17.7 tok/s | 113 / 140 tok/s | 2.9 GiB | Mac mini M4 Pro, 24 GB |
+| `edge0-8b` | 23.9–25.3 tok/s | 500 / 1428 tok/s | 1.0 GiB | Mac mini M4 Pro, 24 GB |
+
+*À froid = première requête après le démarrage du processus (les poids des
+experts arrivent depuis le SSD par défaut de page) ; à chaud = requêtes
+suivantes (page cache résident).*
+
+```bash
+python examples/bench.py edge0-8b # via $EDGE0_8B_MODEL
+python examples/bench.py edge0-35b # via $EDGE0_35B_MODEL
+```
+
+## Qualité
+
+Exécutée avec [OpenCompass](https://github.com/open-compass/opencompass)
+dans des conditions identiques pour les modèles edge0 (int4 + adaptateurs
+entraînés + prerouter) et les bases fp16 d'origine. Le pipeline edge0 perd
+peu : **3,9 points en moyenne pour edge0-35b, 2,8 pour edge0-8b**
+(MMLU-Pro est même au-dessus de la base). Maximum 100 :
+
+| Benchmark | edge0-35b (int4) | Qwen3.6-35B-A3B (fp16) | edge0-8b (int4) | Ling 3.0 tiny (fp16) |
+|---|---:|---:|---:|---:|
+| AIME 2026 | 86.6 | 92.7 | 63.3 | 73.3 |
+| HumanEval | 90.9 | 95.1 | 91.5 | 92.7 |
+| GPQA-Diamond | 79.8 | 81.8 | 70.7 | 71.2 |
+| MMLU-Pro | 81.0 | 84.6 | 70.1 | 65.8 |
+| IFBench | 57.9 | 61.7 | 53.9 | 60.6 |
+| **Moyenne** | **79.2** | **83.2** | **69.9** | **72.7** |
+
+---
+
+## Détails techniques
+
+### Mécanismes fondamentaux
+
+- **SSD expert offload** — les poids des experts sont lus en streaming
+ depuis le stockage à la demande ; la mémoire de pointe est limitée par
+ l'ensemble actif, et non par le nombre de paramètres.
+- **Prerouter** — une tête entraînée prédit le routage des experts un pas
+ à l'avance, de sorte que les chargements d'experts chevauchent la passe
+ avant au lieu de la bloquer (**jusqu'à +59 %** de débit de decode ; le
+ gain augmente avec la latence du stockage, la taille du modèle et la
+ largeur routée *K*).
+- **Recover-LoRA** — la base int4 est gelée et les adaptateurs LoRA sont
+ entraînés par distillation depuis l'enseignant FP, récupérant
+ l'essentiel de la perte de quantification 4-bit. Les adaptateurs restent
+ non fusionnés : une base unique en lecture seule sert plusieurs jeux
+ d'adaptateurs.
+
+### Conception
+
+- **Utilisation façon transformers** — `AutoModel` / `AutoConfig` / `AutoEngine`
+ résolvent la gamme à partir du nom du modèle.
+- **Isolation du backend** — tout le code MLX se trouve sous
+ `src/edge0/backends/mlx/` ; la logique centrale (spécifications des
+ modèles, prerouter, pool d'experts en streaming, serveur) ne dépend que
+ de la façade du backend (`backends/base.py`), de sorte qu'un nouveau
+ backend implémente la même façade (`backends/cuda/` est un emplacement
+ réservé) sans aucune modification du code central.
+- **Adaptateurs au format safetensors** — les poids LoRA et prerouter sont
+ des fichiers `.safetensors` avec métadonnées de provenance (source,
+ version, couches propriétaires), résolus depuis le répertoire du modèle
+ ou le cache de secours `artifacts/` ignoré par git.
+- **Modèle + adaptateurs dans un même répertoire** — un répertoire de
+ modèle contient le checkpoint de base et les adaptateurs de ce modèle ;
+ la mise à niveau des adaptateurs ne remplace que les fichiers
+ d'adaptateurs — la base reste en lecture seule et n'est jamais
+ fusionnée.
+
+### Structure du paquet
+
+```
+src/edge0/
+├── backends/mlx/ # MLX backend (isolation boundary; cuda/ reserved)
+├── engine/ models/ moe/ prerouter/ streaming/
+├── adapters/ attention/ server/
+└── cli.py registry.py sampling.py config.py
+```
+
+---
+
+## Documentation
+
+- [Architecture](../docs/architecture.md)
+- [Attention](../docs/attention.md) / [MoE](../docs/moe.md) / [Streaming SSD](../docs/streaming.md) / [prerouter](../docs/prerouter.md)
+- [Ajouter un modèle](../docs/adding-a-model.md)
+- [edge0-35b](../docs/models/edge0-35b.md) / [edge0-8b](../docs/models/edge0-8b.md)
+- Rapport technique : [The Other Half of the Memory Wall](https://arxiv.org/abs/2609.18063) ([PDF](../paper/main.pdf))
+
+## Tests
+
+```bash
+pytest # unit tests (no real weights)
+EDGE0_8B_MODEL=/path/to/edge0-8b pytest -m slow -q # real-weight generation
+.venv/bin/python scripts/e2e_smoke.py \
+ --qwen-dir /path/to/edge0-35b --ling-dir /path/to/edge0-8b
+```
diff --git a/python/README_ja.md b/python/README_ja.md
new file mode 100644
index 0000000..8f8fa79
--- /dev/null
+++ b/python/README_ja.md
@@ -0,0 +1,165 @@
+# edge0 — Python フレームワーク
+
+[English](README.md) | [中文](README_zh.md) | 日本語 | [Español](README_es.md) | [Français](README_fr.md)
+
+このドキュメントは、**edge0 Python フレームワークをソースからインストールして実行する開発者**向けのものです。内容は、クイックスタート(インストール → モデル → 実行)、実測のパフォーマンスと品質、そしてスタックの背後にある設計です。
+
+edge0 は**モノレポ**として公開されています — [`Edge0-AI/edge0`](https://github.com/Edge0-AI/edge0) — 最上位階層には共有ドキュメント(`docs/`)とプラットフォームのサブプロジェクト(`python/` = 本フレームワーク、ほかに `macos/`、`ios/`、`android/`、`windows/`)が含まれます。Python フレームワークは edge0 レシピ — **SSD expert offload + Recover-LoRA + prerouter ルーティング予測** — のリファレンス実装であり、MLX を介して Apple Silicon 上で大規模スパース MoE モデルを実行し、ピークメモリはパラメータ数ではなく*アクティブ*なエキスパート集合によって上限が決まります。
+
+サードパーティの帰属表示: リポジトリルートの [`NOTICE`](../NOTICE) を参照してください。モデルカード: [Edge0/Edge0-8B-A1B-preview](https://huggingface.co/Edge0/Edge0-8B-A1B-preview) · [Edge0/Edge0-35B-A3B-preview](https://huggingface.co/Edge0/Edge0-35B-A3B-preview)。以下のすべてのコマンドはこのディレクトリ(`python/`)から実行します。
+
+---
+
+## クイックスタート
+
+### 前提条件
+
+| コンポーネント | 要件 |
+|---|---|
+| OS / ハードウェア | Apple Silicon(M1/M2/M3/M4)搭載の macOS — MLX バックエンドは Apple Silicon 専用;CUDA バックエンドはロードマップ上 |
+| Python | 3.10+(3.12 推奨) |
+| MLX | `mlx==0.30.6` / `mlx-metal==0.30.6` と `mlx-lm==0.31.0`(`pyproject.toml` を参照) |
+| メモリ | ピークアクティブ約 2.9 GB(edge0-35b)、約 1.0 GB(edge0-8b)、短いコンテキストの場合 |
+| ディスク | 約 23 GB(edge0-35b)/ 約 4.2 GB(edge0-8b);エキスパートの重みは mmap されてオンデマンドで読み取られ、事前に RAM へロードされない |
+
+> Apple A18 / A18 Pro で文字化けした言語混在の出力が発生する場合、古い
+> `mlx` が原因です: `pip install 'mlx==0.30.6' 'mlx-metal==0.30.6'`
+> ([#8](https://github.com/Edge0-AI/Edge0/issues/8))。
+
+### インストール
+
+```bash
+python3.12 -m venv .venv && .venv/bin/pip install -e '.[dev,fetch]'
+```
+
+### モデル
+
+両方のティアは Hugging Face と ModelScope で公開されています。各リポジトリは、ベースチェックポイントと訓練済み LoRA + prerouter アダプタを**1 つのディレクトリ**にまとめており、1 回のダウンロードですぐ実行できるモデルが揃います:
+
+```bash
+# the repo's helper (defaults to the two published tiers):
+.venv/bin/python scripts/fetch_models.py --tier edge0-8b --target-dir models
+.venv/bin/python scripts/fetch_models.py --tier edge0-35b --target-dir models
+
+# or directly with the CLI:
+.venv/bin/huggingface-cli download Edge0/Edge0-8B-A1B-preview --local-dir models/edge0-8b
+.venv/bin/huggingface-cli download Edge0/Edge0-35B-A3B-preview --local-dir models/edge0-35b
+```
+
+環境変数で edge0 にティアを指定するか、ディレクトリを直接渡します(ティアは `config.json` から自動検出されます):
+
+```bash
+export EDGE0_8B_MODEL=$PWD/models/edge0-8b
+```
+
+### 実行
+
+```bash
+edge0 demo edge0-8b # one-shot generation demo
+edge0 chat edge0-8b --prompt "Explain streaming inference in one sentence."
+edge0 serve edge0-8b # OpenAI-compatible server on http://127.0.0.1:8000
+```
+
+```bash
+curl http://127.0.0.1:8000/v1/chat/completions \
+ -H 'Content-Type: application/json' \
+ -d '{"model":"edge0-8b","messages":[{"role":"user","content":"Hello!"}],"max_tokens":32}'
+```
+
+`python -m edge0 ...` は `edge0 ...` と等価です。
+
+### Python API
+
+```python
+from edge0 import AutoEngine
+from edge0.server.chat import ChatMessage, ChatRequest, ChatSession
+
+engine = AutoEngine.from_pretrained("/path/to/model") # tier auto-detected
+req = ChatRequest(
+ model=engine.name,
+ messages=[ChatMessage(role="user", content="Hello!")],
+ max_tokens=64,
+)
+tokens, meta = ChatSession(engine, req).run()
+print(engine._tok.decode(tokens))
+engine.close() # release mmaps / expert cache
+```
+
+`examples/demo.py` も同じ最小限のウォークスルーです(`edge0 demo` はまさにこのパスを実行します)。
+
+---
+
+## パフォーマンス
+
+`examples/bench.py` で測定(3.3k トークンのプロンプトのプリフィル → サンプリングによるウォームアップ 10 ステップ → 計測付きのサンプリングデコード 200 トークン、ティアごとに 2 回実行):
+
+| ティア | デコード速度 | プリフィルスループット(コールド / ウォーム)* | ピークアクティブメモリ | テストマシン |
+|---|---|---|---|---|
+| `edge0-35b` | 14.9–17.7 tok/s | 113 / 140 tok/s | 2.9 GiB | Mac mini M4 Pro, 24 GB |
+| `edge0-8b` | 23.9–25.3 tok/s | 500 / 1428 tok/s | 1.0 GiB | Mac mini M4 Pro, 24 GB |
+
+*コールド = プロセス起動後の最初のリクエスト(エキスパートの重みが SSD からフォールトインする);ウォーム = 以降のリクエスト(ページキャッシュに常駐)。*
+
+```bash
+python examples/bench.py edge0-8b # via $EDGE0_8B_MODEL
+python examples/bench.py edge0-35b # via $EDGE0_35B_MODEL
+```
+
+## 品質
+
+edge0 モデル(int4 + 訓練済みアダプタ + prerouter)とオリジナルの fp16 ベースの両方について、同一の設定で [OpenCompass](https://github.com/open-compass/opencompass) を使って実行しました。edge0 パイプラインの損失は小さく、**edge0-35b で平均 3.9 ポイント、edge0-8b で 2.8 ポイント**です(MMLU-Pro はベースを上回ります)。満点 100:
+
+| ベンチマーク | edge0-35b (int4) | Qwen3.6-35B-A3B (fp16) | edge0-8b (int4) | Ling 3.0 tiny (fp16) |
+|---|---:|---:|---:|---:|
+| AIME 2026 | 86.6 | 92.7 | 63.3 | 73.3 |
+| HumanEval | 90.9 | 95.1 | 91.5 | 92.7 |
+| GPQA-Diamond | 79.8 | 81.8 | 70.7 | 71.2 |
+| MMLU-Pro | 81.0 | 84.6 | 70.1 | 65.8 |
+| IFBench | 57.9 | 61.7 | 53.9 | 60.6 |
+| **平均** | **79.2** | **83.2** | **69.9** | **72.7** |
+
+---
+
+## 技術詳細
+
+### コア機構
+
+- **SSD expert offload** — エキスパートの重みは必要に応じてストレージからストリーミングされます。ピークメモリはパラメータ数ではなく、アクティブな集合によって上限が決まります。
+- **Prerouter** — 訓練済みヘッドがエキスパートルーティングを 1 ステップ先に予測するため、エキスパートのロードがフォワードパスを停滞させるのではなくオーバーラップします(**最大 +59%** のデコードスループット。ストレージレイテンシ、モデルサイズ、ルーティング幅 *K* が増すほど効果は大きくなります)。
+- **Recover-LoRA** — int4 のベースは凍結され、FP 教師からの蒸留によって LoRA アダプタが訓練されることで、4-bit 量子化損失の大部分を回復します。アダプタはマージされません。1 つの読み取り専用ベースが複数のアダプタセットに対応します。
+
+### 設計
+
+- **transformers スタイルの使い方** — `AutoModel` / `AutoConfig` / `AutoEngine` がモデル名からティアを解決します。
+- **バックエンド分離** — すべての MLX コードは `src/edge0/backends/mlx/` 配下に置かれます。コアロジック(モデル仕様、prerouter、ストリーミングエキスパートプール、サーバー)はバックエンドファサード(`backends/base.py`)にのみ依存するため、新しいバックエンドは同じファサードを実装するだけで済み(`backends/cuda/` は予約スロット)、コアコードの変更はゼロです。
+- **safetensors 形式のアダプタ** — LoRA と prerouter の重みは、来歴メタデータ(source、version、owner layers)付きの `.safetensors` ファイルであり、モデルディレクトリまたは gitignore 済みの `artifacts/` フォールバックから解決されます。
+- **モデル + アダプタを 1 つのディレクトリに** — モデルディレクトリには、ベースチェックポイントとそのモデルのアダプタが格納されます。アダプタのアップグレードはアダプタファイルの交換のみ — ベースは読み取り専用のままで、決してマージされません。
+
+### パッケージレイアウト
+
+```
+src/edge0/
+├── backends/mlx/ # MLX backend (isolation boundary; cuda/ reserved)
+├── engine/ models/ moe/ prerouter/ streaming/
+├── adapters/ attention/ server/
+└── cli.py registry.py sampling.py config.py
+```
+
+---
+
+## ドキュメント
+
+- [アーキテクチャ](../docs/architecture.md)
+- [アテンション](../docs/attention.md) / [MoE](../docs/moe.md) / [SSD ストリーミング](../docs/streaming.md) / [prerouter](../docs/prerouter.md)
+- [モデルの追加](../docs/adding-a-model.md)
+- [edge0-35b](../docs/models/edge0-35b.md) / [edge0-8b](../docs/models/edge0-8b.md)
+- 技術レポート: [The Other Half of the Memory Wall](https://arxiv.org/abs/2609.18063)([PDF](../paper/main.pdf))
+
+## テスト
+
+```bash
+pytest # unit tests (no real weights)
+EDGE0_8B_MODEL=/path/to/edge0-8b pytest -m slow -q # real-weight generation
+.venv/bin/python scripts/e2e_smoke.py \
+ --qwen-dir /path/to/edge0-35b --ling-dir /path/to/edge0-8b
+```
diff --git a/python/README_zh.md b/python/README_zh.md
new file mode 100644
index 0000000..85d620f
--- /dev/null
+++ b/python/README_zh.md
@@ -0,0 +1,197 @@
+# edge0 — Python 框架
+
+[English](README.md) | 中文 | [日本語](README_ja.md) | [Español](README_es.md) | [Français](README_fr.md)
+
+本文档面向**从源码安装并运行 edge0 Python 框架的开发者**。内容包括:
+快速开始(安装 → 模型 → 运行)、性能与质量实测,以及技术栈背后的设计。
+
+edge0 以 **monorepo** 形式发布 ——
+[`Edge0-AI/edge0`](https://github.com/Edge0-AI/edge0) —— 顶层目录存放共享
+文档(`docs/`)与各平台子项目(`python/` = 本框架,另有 `macos/`、`ios/`、
+`android/`、`windows/`)。Python 框架是 edge0 配方的参考实现 —— **SSD
+专家 offload + Recover-LoRA + prerouter 路由预判** —— 通过 MLX 在
+Apple Silicon 上运行大型稀疏 MoE 模型,峰值内存由*激活*专家集而非参数量
+决定。
+
+第三方声明:见仓库根目录的 [`NOTICE`](../NOTICE)。模型卡:
+[Edge0/Edge0-8B-A1B-preview](https://huggingface.co/Edge0/Edge0-8B-A1B-preview)
+· [Edge0/Edge0-35B-A3B-preview](https://huggingface.co/Edge0/Edge0-35B-A3B-preview)。
+下文所有命令均在本目录(`python/`)下运行。
+
+---
+
+## 快速开始
+
+### 环境要求
+
+| 组件 | 要求 |
+|---|---|
+| 系统 / 硬件 | Apple Silicon 上的 macOS(M1/M2/M3/M4)—— MLX 后端仅支持 Apple Silicon;CUDA 后端在路线图中 |
+| Python | 3.10+(推荐 3.12) |
+| MLX | `mlx==0.30.6` / `mlx-metal==0.30.6`,搭配 `mlx-lm==0.31.0`(见 `pyproject.toml`) |
+| 内存 | 短上下文下峰值激活内存约 2.9 GB(edge0-35b)/ 约 1.0 GB(edge0-8b) |
+| 磁盘 | 约 23 GB(edge0-35b)/ 约 4.2 GB(edge0-8b);专家权重经 mmap 按需读取,不会一次性载入内存 |
+
+> Apple A18 / A18 Pro 上输出乱码、语言混杂,说明 `mlx` 版本过旧:
+> `pip install 'mlx==0.30.6' 'mlx-metal==0.30.6'`
+> ([#8](https://github.com/Edge0-AI/Edge0/issues/8))。
+
+### 安装
+
+```bash
+python3.12 -m venv .venv && .venv/bin/pip install -e '.[dev,fetch]'
+```
+
+### 模型
+
+两个档位均发布在 Hugging Face 与 ModelScope;每个仓库把基模 checkpoint
+与训练好的 LoRA + prerouter 适配器打包在**同一目录**,一次下载即为
+可运行的模型:
+
+```bash
+# the repo's helper (defaults to the two published tiers):
+.venv/bin/python scripts/fetch_models.py --tier edge0-8b --target-dir models
+.venv/bin/python scripts/fetch_models.py --tier edge0-35b --target-dir models
+
+# or directly with the CLI:
+.venv/bin/huggingface-cli download Edge0/Edge0-8B-A1B-preview --local-dir models/edge0-8b
+.venv/bin/huggingface-cli download Edge0/Edge0-35B-A3B-preview --local-dir models/edge0-35b
+```
+
+通过环境变量让 edge0 指向某个档位,或直接传入目录(档位会从
+`config.json` 自动识别):
+
+```bash
+export EDGE0_8B_MODEL=$PWD/models/edge0-8b
+```
+
+### 运行
+
+```bash
+edge0 demo edge0-8b # one-shot generation demo
+edge0 chat edge0-8b --prompt "Explain streaming inference in one sentence."
+edge0 serve edge0-8b # OpenAI-compatible server on http://127.0.0.1:8000
+```
+
+```bash
+curl http://127.0.0.1:8000/v1/chat/completions \
+ -H 'Content-Type: application/json' \
+ -d '{"model":"edge0-8b","messages":[{"role":"user","content":"Hello!"}],"max_tokens":32}'
+```
+
+`python -m edge0 ...` 等价于 `edge0 ...`。
+
+### Python API
+
+```python
+from edge0 import AutoEngine
+from edge0.server.chat import ChatMessage, ChatRequest, ChatSession
+
+engine = AutoEngine.from_pretrained("/path/to/model") # tier auto-detected
+req = ChatRequest(
+ model=engine.name,
+ messages=[ChatMessage(role="user", content="Hello!")],
+ max_tokens=64,
+)
+tokens, meta = ChatSession(engine, req).run()
+print(engine._tok.decode(tokens))
+engine.close() # release mmaps / expert cache
+```
+
+`examples/demo.py` 就是这条最小路径(`edge0 demo` 内部运行的正是这条
+路径)。
+
+---
+
+## 性能实测
+
+使用 `examples/bench.py` 实测(3.3k token prompt prefill → 10 步采样
+warmup → 200 token 计时解码段,每档 2 轮):
+
+| 档位 | 解码速度 | Prefill 吞吐(冷/热)* | 峰值 active 内存 | 测试机器 |
+|---|---|---|---|---|
+| `edge0-35b` | 14.9–17.7 tok/s | 113 / 140 tok/s | 2.9 GiB | Mac mini M4 Pro, 24 GB |
+| `edge0-8b` | 23.9–25.3 tok/s | 500 / 1428 tok/s | 1.0 GiB | Mac mini M4 Pro, 24 GB |
+
+*冷 = 进程启动后首请求(专家权重从 SSD 逐页换入);热 = 后续请求
+(页缓存常驻)。*
+
+```bash
+python examples/bench.py edge0-8b # via $EDGE0_8B_MODEL
+python examples/bench.py edge0-35b # via $EDGE0_35B_MODEL
+```
+
+## 质量
+
+使用 [OpenCompass](https://github.com/open-compass/opencompass) 在完全相同
+的设置下,对 edge0 模型(int4 + 训练适配器 + prerouter)与原 fp16 基座
+模型测得。edge0 管线的损失很小:**edge0-35b 平均仅落后 3.9 分、
+edge0-8b 落后 2.8 分**(MMLU-Pro 甚至反超基座)。满分 100:
+
+| 评测集 | edge0-35b(int4) | Qwen3.6-35B-A3B(fp16) | edge0-8b(int4) | Ling 3.0 tiny(fp16) |
+|---|---:|---:|---:|---:|
+| AIME 2026 | 86.6 | 92.7 | 63.3 | 73.3 |
+| HumanEval | 90.9 | 95.1 | 91.5 | 92.7 |
+| GPQA-Diamond | 79.8 | 81.8 | 70.7 | 71.2 |
+| MMLU-Pro | 81.0 | 84.6 | 70.1 | 65.8 |
+| IFBench | 57.9 | 61.7 | 53.9 | 60.6 |
+| **平均** | **79.2** | **83.2** | **69.9** | **72.7** |
+
+---
+
+## 技术细节
+
+### 核心机制
+
+- **SSD 专家 offload** —— 专家权重按需从存储流式加载;峰值内存由
+ 激活集而非参数量决定。
+- **prerouter** —— 训练头提前一步预测专家路由,专家装载与前向计算重叠
+ 而非阻塞(解码吞吐**最高 +59%**;收益随存储延迟、模型规模与路由宽度
+ *K* 增大)。
+- **Recover-LoRA** —— 冻结 int4 基模,用 FP teacher 蒸馏训练 LoRA
+ 适配器,在 4bit 下恢复绝大部分量化损失。适配器保持不合并:一份只读
+ 基模服务多套适配器。
+
+### 设计
+
+- **像 transformers 一样使用** —— `AutoModel` / `AutoConfig` /
+ `AutoEngine` 按模型名自动解析档位。
+- **后端隔离** —— 全部 MLX 代码收在 `src/edge0/backends/mlx/`;核心
+ 逻辑(模型 spec、prerouter、流式专家池、server)只依赖后端门面
+ (`backends/base.py`),新增后端实现同一门面即可(`backends/cuda/`
+ 为预留插槽),核心代码零改动。
+- **适配器统一为 safetensors** —— LoRA 与 prerouter 权重均为带来源
+ 元数据(source、version、owner 层)的 `.safetensors` 文件,可从模型
+ 目录或 gitignored 的 `artifacts/` 回退目录解析。
+- **模型 + 适配器同目录布局** —— 一个模型目录同时存放基模 checkpoint
+ 与该模型的适配器;升级适配器只换适配器文件 —— 基模保持只读、永不
+ 合并。
+
+### 包结构
+
+```
+src/edge0/
+├── backends/mlx/ # MLX backend (isolation boundary; cuda/ reserved)
+├── engine/ models/ moe/ prerouter/ streaming/
+├── adapters/ attention/ server/
+└── cli.py registry.py sampling.py config.py
+```
+
+---
+
+## 文档
+
+- [架构总览](../docs/architecture.md)
+- [注意力抽象](../docs/attention.md) / [MoE 抽象](../docs/moe.md) / [SSD 流式](../docs/streaming.md) / [prerouter](../docs/prerouter.md)
+- [如何接入新模型](../docs/adding-a-model.md)
+- [edge0-35b](../docs/models/edge0-35b.md) / [edge0-8b](../docs/models/edge0-8b.md)
+- 技术报告:[The Other Half of the Memory Wall](https://arxiv.org/abs/2609.18063)([PDF](../paper/main.pdf))
+
+## 测试
+
+```bash
+pytest # unit tests (no real weights)
+EDGE0_8B_MODEL=/path/to/edge0-8b pytest -m slow -q # real-weight generation
+.venv/bin/python scripts/e2e_smoke.py \
+ --qwen-dir /path/to/edge0-35b --ling-dir /path/to/edge0-8b
+```
diff --git a/windows/README.md b/windows/README.md
index 07cdfa3..3eda58a 100644
--- a/windows/README.md
+++ b/windows/README.md
@@ -1,5 +1,7 @@
# edge0-windows — Release Build Guide
+English | [中文](README_zh.md) | [日本語](README_ja.md) | [Español](README_es.md) | [Français](README_fr.md)
+
This document is for **developers building or evaluating the Windows app from source**. It covers: quick start (build → run → test), measured performance on the reference machine, and the technical choices behind the stack.
edge0 is published as a **monorepo** — [`Edge0-AI/edge0`](https://github.com/Edge0-AI/edge0) — whose top level holds the shared engine supply (`vendor.llama.pin` + the scripts-materialized `vendor/llama.cpp`, `patches/llama.cpp/` band-sets) and the platform subprojects (`windows/` = this app, `android/` = the companion). Inference runs on pinned upstream llama.cpp, patched as a replayable patch set, with dense compute on Vulkan and MoE expert weights served from CPU.
diff --git a/windows/README_es.md b/windows/README_es.md
new file mode 100644
index 0000000..b543da1
--- /dev/null
+++ b/windows/README_es.md
@@ -0,0 +1,179 @@
+# edge0-windows — Guía de compilación de release
+
+[English](README.md) | [中文](README_zh.md) | [日本語](README_ja.md) | Español | [Français](README_fr.md)
+
+Este documento está dirigido a **desarrolladores que compilan o evalúan la aplicación de Windows desde el código fuente**. Cubre: inicio rápido (compilar → ejecutar → probar), rendimiento medido en la máquina de referencia y las decisiones técnicas detrás del stack.
+
+edge0 se publica como **monorepo** — [`Edge0-AI/edge0`](https://github.com/Edge0-AI/edge0) — cuyo nivel superior contiene el suministro compartido del motor (`vendor.llama.pin` + el `vendor/llama.cpp` materializado por los scripts, los conjuntos de bandas de `patches/llama.cpp/`) y los subproyectos de plataforma (`windows/` = esta aplicación, `android/` = el complemento). La inferencia se ejecuta sobre una versión fijada (pin) de llama.cpp upstream, parcheada como un conjunto de parches reejecutable, con cómputo denso en Vulkan y pesos de expertos MoE servidos desde la CPU.
+
+Atribución de terceros: consulta `NOTICE` en este directorio. Fichas de modelo: [Edge0/Edge0-8B-A1B-preview](https://huggingface.co/Edge0/Edge0-8B-A1B-preview) · [Edge0/Edge0-35B-A3B-preview](https://huggingface.co/Edge0/Edge0-35B-A3B-preview).
+
+---
+
+## 1. Inicio rápido
+
+### 1.1 Requisitos previos
+
+| toolchain | requisito |
+|---|---|
+| SO | Windows 10 / 11 x64 |
+| Visual Studio 2022 | carga de trabajo C++ (MSVC) |
+| CMake | ≥ 3.21 |
+| Vulkan SDK | para `ggml-vulkan` (cualquier dGPU AMD/NVIDIA/Intel; la iGPU funciona pero es más lenta) |
+| Rust | stable, con `cargo` (shell de Tauri 2) |
+| Node.js | LTS (`npm`) |
+| Python | 3.10+ con `numpy` (conversor en el dispositivo + benchmarks) |
+| Disco / RAM | ≥ 30 GB de disco libre; RAM: 8 GB+ ejecuta 8B, 16 GB+ ejecuta 35B (limitado por paginación), la máquina de referencia tiene 48 GB |
+
+### 1.2 Compilar el motor (llama.cpp + parches + código de servicio de edge0)
+
+```powershell
+git clone https://github.com/Edge0-AI/edge0
+cd edge0/windows
+pwsh -File scripts/vendor-build.ps1 # first build ≈ 10–20 min (compiles llama.cpp + Vulkan kernels)
+```
+
+El script resuelve el depósito del motor de dos formas y después materializa el suministro:
+
+- **clon del monorepo (ruta normal)** → el directorio padre contiene `vendor.llama.pin` + `patches/llama.cpp/{common,windows}`; el script reejecuta los 8 parches (`git am --3way`) en un worktree de compilación aislado en `../wt/win` (área de compilación ignorada por git) — el árbol del vendor en sí **nunca** se parchea in situ;
+- variable de entorno `EDGE0_DEPOT` → apunta a un depósito existente en otra ubicación.
+
+El árbol de llama.cpp **no** es un submódulo: en la primera ejecución el script clona upstream (shallow de blobs) en `../vendor/llama.cpp` y hace detach del commit fijado en `vendor.llama.pin`; después, ese directorio es simplemente un checkout ignorado por git que puedes refrescar con `git fetch`. Establece `EDGE0_LLAMA_URL` para clonar desde un mirror.
+
+`-AssembleOnly` ejecuta todo menos la compilación (segundos; verifica que la reejecución de los parches sigue aplicando y que los hashes coinciden). Salida:
+
+```
+wt\win\build-vk\bin\Release\llama-server.exe (+ llama.dll, ggml*.dll)
+```
+
+### 1.3 Compilar la aplicación (instalador de Tauri + exe portable)
+
+```powershell
+cd app
+npm install
+npx tauri build
+```
+
+Artefactos:
+
+```
+app\src-tauri\target\release\edge0-app.exe ← portable, no install
+app\src-tauri\target\release\bundle\nsis\edge0_0.1.0_x64-setup.exe ← NSIS installer
+```
+
+El shell localiza el motor mediante `EDGE0_BIN_DIR` (por defecto: el directorio de compilación del motor del depósito indicado arriba — consulta la tabla de variables de entorno en `app/README.md` para ver todas las opciones de sobrescritura). Establécelo si tu compilación del motor está en otra ubicación.
+
+### 1.4 Modelos
+
+Nada que preinstalar: la aplicación descarga desde HuggingFace en el primer uso y después convierte en el dispositivo (una sola vez, ~2–6 min para 8B). El `sha256` de cada archivo se verifica contra un manifiesto publicado y la descarga se puede reanudar mediante HTTP Range.
+
+Precarga manual (máquinas sin conexión): coloca los archivos del repositorio MLX en
+
+```
+~\.edge0\models\edge0-8b\ (chat_template.jinja, model*.safetensors, lora_edge0_8b.safetensors, tokenizer…)
+~\.edge0\models\edge0-35b\ (…sharded safetensors, lora_edge0_35b.safetensors…)
+```
+
+La salida del conversor es `models\edge0-<tier>-gguf\edge0-<tier>.gguf` + adaptador LoRA; la conversión es idempotente (controlada por sha). El directorio principal es `EDGE0_HOME` (por defecto `~\.edge0`).
+
+### 1.5 Ejecutar la aplicación
+
+Inicia `edge0-app.exe` (o instala el paquete NSIS). Flujo típico:
+
+1. **Página Modelos** — elige 8B (rápido, ~5 GB) o 35B (~21 GB); *Descargar* → *Convertir* automáticamente → *Cargar*.
+2. **Página Chat** — respuestas en Markdown transmitidas en streaming; el motor se ejecuta como un proceso hijo supervisado y se termina junto con la aplicación (Windows Job Object, `KILL_ON_JOB_CLOSE`).
+3. **Doctor** (al final de la página Modelos) — chequeo de salud en un clic: binario del motor, archivos de modelos, disco, entorno.
+4. Solución de problemas: los logs del motor/conversión quedan en `~\.edge0\logs\`.
+
+API del motor (la aplicación la usa internamente, puedes apuntar a ella cualquier cliente compatible con OpenAI): `http://127.0.0.1:<port>/v1/chat/completions`, solo loopback. Parámetros de carga (contrato del proceso): `-ngl 99 -cmoe --ctx-size 8192 --flash-attn on --pool-mb <tier×RAM clamp> --mem-budget-mb …`.
+
+### 1.6 Probarla
+
+```powershell
+cd app\src-tauri
+cargo test # fast suite: resume/probe logic against a local fake server
+
+# end-to-end, real model (downloads 4.5 GB if not seeded):
+cargo test --test real8b -- --ignored --nocapture
+
+# throughput reproduction (expects the table in §2, ±day-to-day drift):
+python ..\..\tools\r3_bench.py --tier 8b
+python ..\..\tools\r3_bench.py --tier 35b
+```
+
+`r3_bench.py` resuelve las rutas con el mismo contrato que la aplicación: el motor desde el directorio de compilación del depósito (se respeta la sobrescritura `EDGE0_BIN_DIR`), el GGUF convertido desde el directorio principal de modelos de la aplicación (`EDGE0_HOME`, por defecto `~\.edge0\models`) o un `models/` local del repositorio si existe; los resultados quedan en `benchmarks/r3/`.
+
+```powershell
+# patch-replay gate (no compile, seconds):
+pwsh ..\..\scripts\vendor-build.ps1 -AssembleOnly
+```
+
+---
+
+## 2. Rendimiento
+
+Máquina de referencia: **Intel i7-14700K · AMD Radeon RX 9070 GRE (Vulkan) · 48 GB DDR5 · Windows 11**, estado estacionario (`-ngl 99 -cmoe`), medianas de benchmarks de 3 repeticiones (`tools/r3_bench.py`, prompt mixto de idiomas de ~240 tokens, contexto nativo).
+
+| modelo | prefill (tok/s) | decode (tok/s) | prefill de un prompt de 240 tokens |
+|---|---:|---:|---:|
+| edge0-8B-A1B | ~212 | ~44.8 | ~1.1 s |
+| edge0-35B-A3B | ~70 | ~27.7 | ~3.7 s |
+
+Contexto a tener en cuenta al leer estas cifras:
+
+- Decode es la tasa de *generación de tokens* después de procesar el prompt; el número de parámetros activos de A1B / A3B explica por qué un modelo de 35B decodifica a más de 27 tok/s.
+- Los prompts cortos son mucho más rápidos que la columna de 240 tokens de arriba: la primera petición en vivo de la aplicación con 8B mostró **~0.28 s hasta el primer token** para un prompt de 17 tokens (log del motor). La aplicación se ejecuta con `--ctx-size 8192`; los benchmarks anteriores usan contexto nativo (131k / 262k).
+- Son mediciones con RAM caliente en la máquina de referencia de 48 GB (un banco de pruebas, no un supuesto del producto). En los niveles de producto de 16 GB / 8 GB, los expertos se sirven mediante fallos de página mmap y el decode cae con la presión de memoria; se aplica automáticamente un límite de memoria a nivel de proceso (`--mem-budget-mb`) a partir de la RAM física para mantener el conjunto de trabajo del SO bajo control (de forma medible *ayuda* bajo presión).
+- Una comparación A/B en las mismas condiciones frente a llama.cpp vanilla sin parchear (árbol del vendor omitiendo las bandas de parches) muestra que el conjunto de parches no cuesta nada (8B: 41.5 vs 39.5 en decode; 35B: 27.2 vs 27.4 — dentro de la deriva de la máquina).
+- Espera una deriva diaria de unos pocos puntos porcentuales en esta clase de máquina; si haces benchmarks, compara en igualdad de condiciones, el mismo día y el mismo proceso.
+
+---
+
+## 3. Detalles técnicos
+
+### 3.1 Arquitectura
+
+```mermaid
+flowchart LR
+ subgraph ondevice ["On-device, first run"]
+ A[MLX safetensors<br/>int4 g64] -->|repack, bit-exact<br/>no requant| B[GGUF Q4_1<br/>edge0-tier.gguf]
+ A2[MLX LoRA] -->|fuse + adapt| B2[GGUF adapter]
+ end
+ B --> C[("pinned llama.cpp fork<br/>7ab4ee7 + 8 patches")]
+ B2 --> C
+ C -->|Vulkan: dense attn / GDN / norms| D[(GPU)]
+ C -->|"-cmoe: expert weights"| E[(CPU, mmap +<br/>L1 advisory pool)]
+ C --> F[llama-server<br/>127.0.0.1 OpenAI API]
+ F --> G[Tauri 2 shell<br/>supervisor + chat UI]
+```
+
+```mermaid
+flowchart TB
+ subgraph build ["Source-of-truth layout (open source)"]
+ U[github ggml-org/llama.cpp] -->|detached pin, never edited| V[vendor/llama.cpp @7ab4ee7]
+ P[patches/llama.cpp/common+windows] -->|git am --3way into per-platform worktree| W[wt/win]
+ V --> W
+ S[serve/*.cc edge0 code] -->|CMake glob patch #3| W
+ end
+```
+
+### 3.2 Mapa del repositorio
+```
+serve/ edge0 C++ pieces compiled into libllama (advisory prefetch router, memory budget)
+tools/ MLX→GGUF converter chain (repack + LoRA adapter + catalog) and the throughput bench
+app/ Tauri 2 shell (src-tauri/ Rust, src/ React) — see app/README.md
+scripts/ vendor-build.ps1 — engine assembly: patch replay into an isolated worktree
+```
+
+Los cambios del motor viven en la raíz del monorepo, no en un fork: `vendor/llama.cpp` es el checkout upstream prístino fijado (nunca parcheado in situ) y `patches/llama.cpp/` contiene los 8 parches de puntos de anclaje + el README de bandas (`common/`, `windows/` aquí; `android/` para la aplicación complementaria). `windows/` no incluye deliberadamente **ninguna** copia anidada de `patches/` — una única fuente de verdad, sin deriva.
+
+### 3.3 Limitaciones conocidas (en esta versión)
+
+- El instalador está **sin firmar** (advertencia de SmartScreen en el primer arranque); aún no hay actualizador automático.
+- El motor todavía no se incluye dentro del instalador — las compilaciones portables suponen el directorio de compilación del motor; la inclusión está en la hoja de ruta.
+- El pool L1 de `--pool-mb` está desactivado por variable de entorno en Windows a la espera del A/B definitivo por niveles de memoria; la aplicación limita `--mem-budget-mb` de todos modos.
+- 35B en máquinas de ≤16 GB es funcional pero está limitado por paginación; el mínimo documentado es 8 GB *funcionando con* el límite de memoria, a tok/s reducidos.
+
+---
+
+*Son bienvenidos los issues y los resultados de benchmarks con otro hardware — adjunta `~\.edge0\logs\engine-*.log` y una captura de la página `doctor`.*
diff --git a/windows/README_fr.md b/windows/README_fr.md
new file mode 100644
index 0000000..f875624
--- /dev/null
+++ b/windows/README_fr.md
@@ -0,0 +1,183 @@
+# edge0-windows — Guide de compilation de la release
+
+[English](README.md) | [中文](README_zh.md) | [日本語](README_ja.md) | [Español](README_es.md) | Français
+
+Ce document s'adresse aux **développeurs qui compilent ou évaluent l'application Windows depuis les sources**. Il couvre : le démarrage rapide (compilation → exécution → test), les performances mesurées sur la machine de référence et les choix techniques derrière la stack.
+
+edge0 est publié sous forme de **monorepo** — [`Edge0-AI/edge0`](https://github.com/Edge0-AI/edge0) — dont le niveau supérieur contient l'approvisionnement partagé du moteur (`vendor.llama.pin` + le `vendor/llama.cpp` matérialisé par les scripts, les jeux de bandes `patches/llama.cpp/`) et les sous-projets par plateforme (`windows/` = cette application, `android/` = le compagnon). L'inférence s'exécute sur une version épinglée de llama.cpp upstream, patchée sous forme d'un jeu de patchs rejouable, avec le calcul dense sur Vulkan et les poids d'experts MoE servis depuis le CPU.
+
+Attribution tierce : voir `NOTICE` dans ce répertoire. Cartes de modèles : [Edge0/Edge0-8B-A1B-preview](https://huggingface.co/Edge0/Edge0-8B-A1B-preview) · [Edge0/Edge0-35B-A3B-preview](https://huggingface.co/Edge0/Edge0-35B-A3B-preview).
+
+---
+
+## 1. Démarrage rapide
+
+### 1.1 Prérequis
+
+| chaîne d'outils | exigence |
+|---|---|
+| OS | Windows 10 / 11 x64 |
+| Visual Studio 2022 | charge de travail C++ (MSVC) |
+| CMake | ≥ 3.21 |
+| Vulkan SDK | pour `ggml-vulkan` (tout dGPU AMD/NVIDIA/Intel ; l'iGPU fonctionne mais plus lentement) |
+| Rust | stable, avec `cargo` (shell Tauri 2) |
+| Node.js | LTS (`npm`) |
+| Python | 3.10+ avec `numpy` (convertisseur sur l'appareil + benches) |
+| Disque / RAM | ≥ 30 GB de disque libre ; RAM : 8 GB+ pour le 8B, 16 GB+ pour le 35B (limité par la pagination), la machine de référence est à 48 GB |
+
+### 1.2 Compiler le moteur (llama.cpp + patchs + code de serving edge0)
+
+```powershell
+git clone https://github.com/Edge0-AI/edge0
+cd edge0/windows
+pwsh -File scripts/vendor-build.ps1 # first build ≈ 10–20 min (compiles llama.cpp + Vulkan kernels)
+```
+
+Le script résout le dépôt du moteur de deux manières, puis matérialise l'approvisionnement :
+
+- **clone du monorepo (chemin normal)** → le répertoire parent porte `vendor.llama.pin` + `patches/llama.cpp/{common,windows}` ; le script rejoue les 8 patchs (`git am --3way`) dans un worktree de compilation isolé dans `../wt/win` (zone de compilation ignorée par git) — l'arborescence vendor elle-même n'est **jamais patchée en place** ;
+- variable d'environnement `EDGE0_DEPOT` → pointe vers un dépôt existant ailleurs.
+
+L'arborescence llama.cpp n'est **pas** un sous-module : au premier lancement, le script clone upstream (shallow en blobs) dans `../vendor/llama.cpp` et détache le commit épinglé dans `vendor.llama.pin` ; ensuite, ce répertoire n'est qu'un checkout ignoré par git que vous pouvez rafraîchir avec `git fetch`. Définissez `EDGE0_LLAMA_URL` pour cloner depuis un miroir.
+
+`-AssembleOnly` exécute tout sauf la compilation (quelques secondes ; vérifie que le rejeu des patchs s'applique toujours et que les hashes correspondent). Sortie :
+
+```
+wt\win\build-vk\bin\Release\llama-server.exe (+ llama.dll, ggml*.dll)
+```
+
+### 1.3 Compiler l'application (installeur Tauri + exe portable)
+
+```powershell
+cd app
+npm install
+npx tauri build
+```
+
+Artéfacts :
+
+```
+app\src-tauri\target\release\edge0-app.exe ← portable, no install
+app\src-tauri\target\release\bundle\nsis\edge0_0.1.0_x64-setup.exe ← NSIS installer
+```
+
+Le shell localise le moteur via `EDGE0_BIN_DIR` (par défaut : le répertoire de compilation du moteur du dépôt ci-dessus — voir le tableau des variables d'environnement de `app/README.md` pour toutes les options de substitution). Définissez-le si votre compilation du moteur se trouve ailleurs.
+
+### 1.4 Modèles
+
+Rien à préinstaller : l'application télécharge depuis HuggingFace à la première utilisation, puis convertit sur l'appareil (une seule fois, ~2–6 min pour le 8B). Le `sha256` par fichier est vérifié contre un manifeste publié et le téléchargement est reprenable via HTTP Range.
+
+Amorçage manuel (machines hors ligne) : placez les fichiers du dépôt MLX sous
+
+```
+~\.edge0\models\edge0-8b\ (chat_template.jinja, model*.safetensors, lora_edge0_8b.safetensors, tokenizer…)
+~\.edge0\models\edge0-35b\ (…sharded safetensors, lora_edge0_35b.safetensors…)
+```
+
+La sortie du convertisseur est `models\edge0-<tier>-gguf\edge0-<tier>.gguf` + l'adaptateur LoRA ; la conversion est idempotente (contrôlée par sha). Le répertoire personnel est `EDGE0_HOME` (`~\.edge0` par défaut).
+
+### 1.5 Lancer l'application
+
+Lancez `edge0-app.exe` (ou installez le paquet NSIS). Flux typique :
+
+1. **Page Models** — choisissez 8B (rapide, ~5 GB) ou 35B (~21 GB) ; *Download* → *Convert* automatique → *Load*.
+2. **Page Chat** — réponses Markdown en streaming ; le moteur s'exécute comme un processus enfant supervisé et est tué avec l'application (Windows Job Object, `KILL_ON_JOB_CLOSE`).
+3. **Doctor** (en bas de la page Models) — vérification de santé en un clic : binaire du moteur, fichiers de modèles, disque, environnement.
+4. Dépannage : les journaux du moteur/de conversion se trouvent dans `~\.edge0\logs\`.
+
+API du moteur (l'application l'utilise en interne, vous pouvez pointer n'importe quel client compatible OpenAI dessus) : `http://127.0.0.1:<port>/v1/chat/completions`, loopback uniquement. Paramètres de chargement (contrat du processus) : `-ngl 99 -cmoe --ctx-size 8192 --flash-attn on --pool-mb <tier×RAM clamp> --mem-budget-mb …`.
+
+### 1.6 Tester
+
+```powershell
+cd app\src-tauri
+cargo test # fast suite: resume/probe logic against a local fake server
+
+# end-to-end, real model (downloads 4.5 GB if not seeded):
+cargo test --test real8b -- --ignored --nocapture
+
+# throughput reproduction (expects the table in §2, ±day-to-day drift):
+python ..\..\tools\r3_bench.py --tier 8b
+python ..\..\tools\r3_bench.py --tier 35b
+```
+
+`r3_bench.py` résout les chemins avec le même contrat que l'application : le moteur depuis le répertoire de compilation du dépôt
+(substitution `EDGE0_BIN_DIR` respectée), le GGUF converti depuis le répertoire personnel des modèles de l'application (`EDGE0_HOME`,
+`~\.edge0\models` par défaut) ou un `models/` local au dépôt s'il existe ; les résultats arrivent dans `benchmarks/r3/`.
+
+```powershell
+# patch-replay gate (no compile, seconds):
+pwsh ..\..\scripts\vendor-build.ps1 -AssembleOnly
+```
+
+---
+
+## 2. Performances
+
+Machine de référence : **Intel i7-14700K · AMD Radeon RX 9070 GRE (Vulkan) · 48 GB DDR5 · Windows 11**, régime stable (`-ngl 99 -cmoe`), médianes de bench sur 3 répétitions (`tools/r3_bench.py`, prompt multilingue d'environ 240 tokens, contexte natif).
+
+| modèle | prefill (tok/s) | decode (tok/s) | prefill d'un prompt de 240 tokens |
+|---|---:|---:|---:|
+| edge0-8B-A1B | ~212 | ~44.8 | ~1.1 s |
+| edge0-35B-A3B | ~70 | ~27.7 | ~3.7 s |
+
+Contexte à garder en tête en lisant ces chiffres :
+
+- Le decode est le taux de *génération de tokens* après traitement du prompt ; le nombre de paramètres actifs A1B / A3B explique pourquoi un modèle 35B décode à plus de 27 tok/s.
+- Les prompts courts sont bien plus rapides que la colonne 240 tokens ci-dessus : la première requête réelle de l'application sur le 8B a montré **~0,28 s avant le premier token** pour un prompt de 17 tokens (journal du moteur). L'application s'exécute avec `--ctx-size 8192` ; les benches ci-dessus utilisent le contexte natif (131k / 262k).
+- Ce sont des mesures à chaud en RAM sur la machine de référence de 48 GB (un banc de test, pas une hypothèse produit). Sur les gammes produit 16 GB / 8 GB, les experts sont servis par des défauts de page mmap et le decode chute avec la pression mémoire ; une limite mémoire au niveau du processus (`--mem-budget-mb`) est appliquée automatiquement à partir de la RAM physique pour garder le jeu de travail de l'OS raisonnable (elle *aide* de façon mesurable sous pression).
+- Un A/B dans les mêmes conditions contre llama.cpp vanilla non patché (arborescence vendor avec les bandes de patchs ignorées) montre que le jeu de patchs ne coûte rien (8B : 41,5 contre 39,5 en decode ; 35B : 27,2 contre 27,4 — dans la dérive de la machine).
+- Attendez-vous à une dérive de quelques pourcents d'un jour à l'autre sur cette classe de machine ; comparez à conditions égales, le même jour, le même processus, si vous benchmarkez.
+
+---
+
+## 3. Détails techniques
+
+### 3.1 Architecture
+
+```mermaid
+flowchart LR
+ subgraph ondevice ["On-device, first run"]
+ A[MLX safetensors<br/>int4 g64] -->|repack, bit-exact<br/>no requant| B[GGUF Q4_1<br/>edge0-tier.gguf]
+ A2[MLX LoRA] -->|fuse + adapt| B2[GGUF adapter]
+ end
+ B --> C[("pinned llama.cpp fork<br/>7ab4ee7 + 8 patches")]
+ B2 --> C
+ C -->|Vulkan: dense attn / GDN / norms| D[(GPU)]
+ C -->|"-cmoe: expert weights"| E[(CPU, mmap +<br/>L1 advisory pool)]
+ C --> F[llama-server<br/>127.0.0.1 OpenAI API]
+ F --> G[Tauri 2 shell<br/>supervisor + chat UI]
+```
+
+```mermaid
+flowchart TB
+ subgraph build ["Source-of-truth layout (open source)"]
+ U[github ggml-org/llama.cpp] -->|detached pin, never edited| V[vendor/llama.cpp @7ab4ee7]
+ P[patches/llama.cpp/common+windows] -->|git am --3way into per-platform worktree| W[wt/win]
+ V --> W
+ S[serve/*.cc edge0 code] -->|CMake glob patch #3| W
+ end
+```
+
+### 3.2 Structure du dépôt
+```
+serve/ edge0 C++ pieces compiled into libllama (advisory prefetch router, memory budget)
+tools/ MLX→GGUF converter chain (repack + LoRA adapter + catalog) and the throughput bench
+app/ Tauri 2 shell (src-tauri/ Rust, src/ React) — see app/README.md
+scripts/ vendor-build.ps1 — engine assembly: patch replay into an isolated worktree
+```
+
+Les modifications du moteur se trouvent à la racine du monorepo, pas dans un fork : `vendor/llama.cpp` est le checkout upstream épinglé d'origine (jamais patché en place) et `patches/llama.cpp/` porte les 8
+patchs de points d'accroche + le README de bande (`common/`, `windows/` ici ; `android/` pour l'application compagne).
+`windows/` n'embarque volontairement **aucune** copie imbriquée de `patches/` — une seule source de vérité, aucune dérive.
+
+### 3.3 Lacunes connues (à la date de cette release)
+
+- L'installeur n'est **pas signé** (avertissement SmartScreen au premier lancement) ; pas encore de mise à jour automatique.
+- Le moteur n'est pas encore intégré à l'installeur — les versions portables supposent le répertoire de compilation du moteur ; l'intégration est sur la feuille de route.
+- Le pool L1 `--pool-mb` reste en veille sur Windows dans l'attente de l'A/B final sur les niveaux de mémoire ; l'application plafonne `--mem-budget-mb` quoi qu'il en soit.
+- Le 35B sur des machines ≤ 16 GB est fonctionnel mais limité par la pagination ; le plancher documenté est 8 GB *avec* le plafond mémoire, à un débit de tok/s réduit.
+
+---
+
+*Les issues et résultats de bench sur d'autres matériels sont les bienvenus — joignez `~\.edge0\logs\engine-*.log` et la capture d'écran de la page `doctor`.*
diff --git a/windows/README_ja.md b/windows/README_ja.md
new file mode 100644
index 0000000..fe2660b
--- /dev/null
+++ b/windows/README_ja.md
@@ -0,0 +1,179 @@
+# edge0-windows — リリースビルドガイド
+
+[English](README.md) | [中文](README_zh.md) | 日本語 | [Español](README_es.md) | [Français](README_fr.md)
+
+このドキュメントは、**ソースから Windows アプリをビルドまたは評価する開発者**向けのものです。内容は、クイックスタート(ビルド → 実行 → テスト)、リファレンスマシンでの実測パフォーマンス、そしてスタックの背後にある技術的選択です。
+
+edge0 は**モノレポ**として公開されています — [`Edge0-AI/edge0`](https://github.com/Edge0-AI/edge0) — 最上位階層には共有のエンジンサプライ(`vendor.llama.pin` + スクリプトが実体化する `vendor/llama.cpp`、`patches/llama.cpp/` のバンドセット)とプラットフォームのサブプロジェクト(`windows/` = 本アプリ、`android/` = コンパニオン)が含まれます。推論はピン留めされた上流の llama.cpp 上で実行され、リプレイ可能なパッチセットとしてパッチが適用され、dense 計算は Vulkan 上、MoE エキスパート重みは CPU から供給されます。
+
+サードパーティの帰属表示: このディレクトリの `NOTICE` を参照してください。モデルカード: [Edge0/Edge0-8B-A1B-preview](https://huggingface.co/Edge0/Edge0-8B-A1B-preview) · [Edge0/Edge0-35B-A3B-preview](https://huggingface.co/Edge0/Edge0-35B-A3B-preview)。
+
+---
+
+## 1. クイックスタート
+
+### 1.1 前提条件
+
+| ツールチェーン | 要件 |
+|---|---|
+| OS | Windows 10 / 11 x64 |
+| Visual Studio 2022 | C++ ワークロード(MSVC) |
+| CMake | ≥ 3.21 |
+| Vulkan SDK | `ggml-vulkan` 用(AMD/NVIDIA/Intel の dGPU ならどれでも;iGPU でも動作するがより遅い) |
+| Rust | stable、`cargo` 付き(Tauri 2 シェル) |
+| Node.js | LTS(`npm`) |
+| Python | 3.10+ と `numpy`(デバイス上コンバータ + ベンチ) |
+| ディスク / RAM | 30 GB 以上の空きディスク;RAM: 8 GB+ で 8B、16 GB+ で 35B が動作(ページング律速);リファレンスマシンは 48 GB |
+
+### 1.2 エンジンのビルド(llama.cpp + パッチ + edge0 サービングコード)
+
+```powershell
+git clone https://github.com/Edge0-AI/edge0
+cd edge0/windows
+pwsh -File scripts/vendor-build.ps1 # first build ≈ 10–20 min (compiles llama.cpp + Vulkan kernels)
+```
+
+スクリプトはエンジンデポを 2 つの方法で解決し、サプライを実体化します:
+
+- **モノレポのクローン(通常のパス)** → 親ディレクトリが `vendor.llama.pin` + `patches/llama.cpp/{common,windows}` を持ちます。スクリプトは 8 つのパッチ(`git am --3way`)を `../wt/win` の隔離されたビルドワークツリーにリプレイします(gitignore されたビルド領域)— ベンダーツリー自体は**決してその場でパッチされません**;
+- `EDGE0_DEPOT` 環境変数 → 他の場所にある既存のデポを指定します。
+
+llama.cpp ツリーはサブモジュールでは**ありません**: 初回実行時、スクリプトは上流を(blobs の shallow クローンで)`../vendor/llama.cpp` にクローンし、`vendor.llama.pin` にピン留めされたコミットを detach します。以降、そのディレクトリは `git fetch` で更新できる、gitignore された単なるチェックアウトです。ミラーからクローンするには `EDGE0_LLAMA_URL` を設定します。
+
+`-AssembleOnly` はコンパイル以外のすべてを実行します(数秒;パッチのリプレイが今も適用可能でハッシュが一致することを検証します)。出力:
+
+```
+wt\win\build-vk\bin\Release\llama-server.exe (+ llama.dll, ggml*.dll)
+```
+
+### 1.3 アプリのビルド(Tauri インストーラ + ポータブル exe)
+
+```powershell
+cd app
+npm install
+npx tauri build
+```
+
+成果物:
+
+```
+app\src-tauri\target\release\edge0-app.exe ← portable, no install
+app\src-tauri\target\release\bundle\nsis\edge0_0.1.0_x64-setup.exe ← NSIS installer
+```
+
+シェルは `EDGE0_BIN_DIR` 経由でエンジンを特定します(デフォルト: 上記のデポのエンジンビルドディレクトリ — 完全なオーバーライド一覧は `app/README.md` の環境変数テーブルを参照)。エンジンビルドが他の場所にある場合は設定してください。
+
+### 1.4 モデル
+
+事前インストールは不要です: アプリは初回使用時に HuggingFace からダウンロードし、その後デバイス上で変換します(一度きり;8B で約 2〜6 分)。ファイルごとの `sha256` が公開マニフェストと照合して検証され、HTTP Range 経由で再開可能です。
+
+手動シード(オフラインマシン): MLX リポジトリのファイルを以下に配置します
+
+```
+~\.edge0\models\edge0-8b\ (chat_template.jinja, model*.safetensors, lora_edge0_8b.safetensors, tokenizer…)
+~\.edge0\models\edge0-35b\ (…sharded safetensors, lora_edge0_35b.safetensors…)
+```
+
+コンバータの出力は `models\edge0-<tier>-gguf\edge0-<tier>.gguf` + LoRA アダプタです。変換は冪等です(sha ゲート付き)。ホームディレクトリは `EDGE0_HOME`(デフォルト `~\.edge0`)です。
+
+### 1.5 アプリの実行
+
+`edge0-app.exe` を起動します(または NSIS パッケージをインストール)。典型的なフロー:
+
+1. **Models ページ** — 8B(高速、約 5 GB)または 35B(約 21 GB)を選択;*Download* → 自動で *Convert* → *Load*。
+2. **Chat ページ** — ストリーミングされる Markdown の回答。エンジンは監督付きの子プロセスとして実行され、アプリとともに kill されます(Windows Job Object、`KILL_ON_JOB_CLOSE`)。
+3. **Doctor**(Models ページの下部)— ワンクリックのヘルスチェック: エンジンバイナリ、モデルファイル、ディスク、環境変数。
+4. トラブルシューティング: エンジン/変換のログは `~\.edge0\logs\` に出力されます。
+
+エンジン API(アプリが内部的に使用しています;任意の OpenAI 互換クライアントから指定できます): `http://127.0.0.1:<port>/v1/chat/completions`、ループバック専用。ロードパラメータ(プロセスコントラクト): `-ngl 99 -cmoe --ctx-size 8192 --flash-attn on --pool-mb <tier×RAM clamp> --mem-budget-mb …`。
+
+### 1.6 テスト
+
+```powershell
+cd app\src-tauri
+cargo test # fast suite: resume/probe logic against a local fake server
+
+# end-to-end, real model (downloads 4.5 GB if not seeded):
+cargo test --test real8b -- --ignored --nocapture
+
+# throughput reproduction (expects the table in §2, ±day-to-day drift):
+python ..\..\tools\r3_bench.py --tier 8b
+python ..\..\tools\r3_bench.py --tier 35b
+```
+
+`r3_bench.py` はアプリと同じコントラクトでパスを解決します: エンジンはデポのビルドディレクトリから(`EDGE0_BIN_DIR` のオーバーライドを尊重)、変換済み GGUF はアプリのモデルホーム(`EDGE0_HOME`、デフォルト `~\.edge0\models`)から、または存在する場合はリポジトリローカルの `models/` から。結果は `benchmarks/r3/` に出力されます。
+
+```powershell
+# patch-replay gate (no compile, seconds):
+pwsh ..\..\scripts\vendor-build.ps1 -AssembleOnly
+```
+
+---
+
+## 2. パフォーマンス
+
+リファレンスマシン: **Intel i7-14700K · AMD Radeon RX 9070 GRE(Vulkan)· 48 GB DDR5 · Windows 11**、定常状態(`-ngl 99 -cmoe`)、3 回実行のベンチ中央値(`tools/r3_bench.py`、約 240 トークンの言語混在プロンプト、ネイティブコンテキスト)。
+
+| モデル | プリフィル (tok/s) | デコード (tok/s) | 240 トークンプロンプトのプリフィル |
+|---|---:|---:|---:|
+| edge0-8B-A1B | ~212 | ~44.8 | ~1.1 s |
+| edge0-35B-A3B | ~70 | ~27.7 | ~3.7 s |
+
+これらの数値を読む際に念頭に置くべきコンテキスト:
+
+- デコードはプロンプト処理後の*トークン生成*レートです。A1B / A3B のアクティブパラメータ数が、35B モデルが 27+ tok/s でデコードできる理由を説明します。
+- 短いプロンプトは上記の 240 トークンの列よりはるかに高速です: 8B でのアプリの最初のライブリクエストは、17 トークンのプロンプトで**最初のトークンまで約 0.28 s** を示しました(エンジンログ)。アプリは `--ctx-size 8192` で実行されます;上記のベンチはネイティブコンテキスト(131k / 262k)を使用しています。
+- これらは 48 GB リファレンスマシンでのウォーム RAM の測定値です(テストベッドであり、製品としての前提ではありません)。16 GB / 8 GB の製品ティアでは、エキスパートは mmap のページフォルトによって供給され、メモリプレッシャーに応じてデコードが低下します。プロセスレベルのメモリ上限(`--mem-budget-mb`)が物理 RAM から自動的に適用され、OS のワーキングセットを健全に保ちます(プレッシャー下では測定可能なほど*役立ちます*)。
+- パッチ未適用の素の llama.cpp(パッチバンドをスキップしたベンダーツリー)との同一条件での A/B 比較は、パッチセットのコストがゼロであることを示しています(8B: デコード 41.5 vs 39.5;35B: 27.2 vs 27.4 — マシンのドリフトの範囲内)。
+- このクラスのマシンでは数パーセントの日ごとのドリフトが予想されます。ベンチマークを行う場合は、同一条件で、同じ日に、同じプロセスで比較してください。
+
+---
+
+## 3. 技術詳細
+
+### 3.1 アーキテクチャ
+
+```mermaid
+flowchart LR
+ subgraph ondevice ["On-device, first run"]
+ A[MLX safetensors<br/>int4 g64] -->|repack, bit-exact<br/>no requant| B[GGUF Q4_1<br/>edge0-tier.gguf]
+ A2[MLX LoRA] -->|fuse + adapt| B2[GGUF adapter]
+ end
+ B --> C[("pinned llama.cpp fork<br/>7ab4ee7 + 8 patches")]
+ B2 --> C
+ C -->|Vulkan: dense attn / GDN / norms| D[(GPU)]
+ C -->|"-cmoe: expert weights"| E[(CPU, mmap +<br/>L1 advisory pool)]
+ C --> F[llama-server<br/>127.0.0.1 OpenAI API]
+ F --> G[Tauri 2 shell<br/>supervisor + chat UI]
+```
+
+```mermaid
+flowchart TB
+ subgraph build ["Source-of-truth layout (open source)"]
+ U[github ggml-org/llama.cpp] -->|detached pin, never edited| V[vendor/llama.cpp @7ab4ee7]
+ P[patches/llama.cpp/common+windows] -->|git am --3way into per-platform worktree| W[wt/win]
+ V --> W
+ S[serve/*.cc edge0 code] -->|CMake glob patch #3| W
+ end
+```
+
+### 3.2 リポジトリマップ
+```
+serve/ edge0 C++ pieces compiled into libllama (advisory prefetch router, memory budget)
+tools/ MLX→GGUF converter chain (repack + LoRA adapter + catalog) and the throughput bench
+app/ Tauri 2 shell (src-tauri/ Rust, src/ React) — see app/README.md
+scripts/ vendor-build.ps1 — engine assembly: patch replay into an isolated worktree
+```
+
+エンジンの変更はフォークではなくモノレポのルートにあります: `vendor/llama.cpp` はピン留めされた手付かずの上流チェックアウト(決してその場でパッチされない)であり、`patches/llama.cpp/` が 8 つのフックポイントパッチ + バンド README(`common/` と `windows/` はここ;コンパニオンアプリ用は `android/`)を保持します。`windows/` は意図的にネストした `patches/` のコピーを**一切**同梱しません — 信頼できる単一のソース、ドリフトなし。
+
+### 3.3 既知のギャップ(本リリース時点)
+
+- インストーラは**未署名**です(初回実行時に SmartScreen の警告)。自動アップデータはまだありません。
+- エンジンはまだインストーラ内にバンドルされていません — ポータブルビルドはエンジンビルドディレクトリを前提とします。バンドルはロードマップ上です。
+- `--pool-mb` の L1 プールは、最終的なメモリティア A/B を待つ間、Windows では環境変数レベルで休眠状態です。いずれにせよアプリは `--mem-budget-mb` をクランプします。
+- 16 GB 以下のマシンでの 35B は動作しますが、ページング律速です。ドキュメント化された下限は 8 GB で、メモリ上限と*組み合わせる*ことで動作し、tok/s は低下します。
+
+---
+
+*他のハードウェアでの issue やベンチ結果を歓迎します — `~\.edge0\logs\engine-*.log` と `doctor` ページのスクリーンショットを添付してください。*
diff --git a/windows/README_zh.md b/windows/README_zh.md
new file mode 100644
index 0000000..ec44c38
--- /dev/null
+++ b/windows/README_zh.md
@@ -0,0 +1,179 @@
+# edge0-windows — 发布构建指南
+
+[English](README.md) | 中文 | [日本語](README_ja.md) | [Español](README_es.md) | [Français](README_fr.md)
+
+本文档面向**从源码构建或评估 Windows App 的开发者**。内容包括:快速开始(构建 → 运行 → 测试)、参考机器上的性能实测,以及技术栈背后的技术选型。
+
+edge0 以 **monorepo** 形式发布 —— [`Edge0-AI/edge0`](https://github.com/Edge0-AI/edge0) —— 顶层目录存放共享的引擎供给(`vendor.llama.pin` + 由脚本物化的 `vendor/llama.cpp`、`patches/llama.cpp/` 补丁 band 集)与各平台子项目(`windows/` = 本 App,`android/` = 伙伴项目)。推理运行在固定版本(pinned)的上游 llama.cpp 上,以可重放补丁集的方式打补丁,稠密计算走 Vulkan,MoE 专家权重由 CPU 供给。
+
+第三方声明:见本目录下的 `NOTICE`。模型卡:[Edge0/Edge0-8B-A1B-preview](https://huggingface.co/Edge0/Edge0-8B-A1B-preview) · [Edge0/Edge0-35B-A3B-preview](https://huggingface.co/Edge0/Edge0-35B-A3B-preview)。
+
+---
+
+## 1. 快速开始
+
+### 1.1 环境要求
+
+| 工具链 | 要求 |
+|---|---|
+| 系统 | Windows 10 / 11 x64 |
+| Visual Studio 2022 | C++ 工作负载(MSVC) |
+| CMake | ≥ 3.21 |
+| Vulkan SDK | 用于 `ggml-vulkan`(任意 AMD/NVIDIA/Intel 独显;核显可用但更慢) |
+| Rust | stable 版,带 `cargo`(Tauri 2 外壳) |
+| Node.js | LTS(`npm`) |
+| Python | 3.10+ 且带 `numpy`(端上转换器 + 基准测试) |
+| 磁盘 / 内存 | ≥ 30 GB 可用磁盘;内存:8 GB+ 可运行 8B,16 GB+ 可运行 35B(受分页限制),参考机器为 48 GB |
+
+### 1.2 构建引擎(llama.cpp + 补丁 + edge0 serving 代码)
+
+```powershell
+git clone https://github.com/Edge0-AI/edge0
+cd edge0/windows
+pwsh -File scripts/vendor-build.ps1 # first build ≈ 10–20 min (compiles llama.cpp + Vulkan kernels)
+```
+
+脚本以两种方式解析引擎 depot,然后物化供给:
+
+- **monorepo 克隆(常规路径)** → 父目录带有 `vendor.llama.pin` + `patches/llama.cpp/{common,windows}`;脚本把 8 个补丁(`git am --3way`)重放到 `../wt/win` 的隔离构建 worktree(gitignored 构建区)—— vendor 树本身**绝不就地打补丁**;
+- `EDGE0_DEPOT` 环境变量 → 指向别处已有的 depot。
+
+llama.cpp 树**不是** submodule:首次运行时脚本会把上游克隆(blob 浅克隆)到 `../vendor/llama.cpp`,并 detach 到 `vendor.llama.pin` 固定的提交;此后该目录只是一个 gitignored 的 checkout,可用 `git fetch` 刷新。设置 `EDGE0_LLAMA_URL` 可从镜像克隆。
+
+`-AssembleOnly` 运行除编译外的全部步骤(数秒;验证补丁重放仍可应用且哈希匹配)。输出:
+
+```
+wt\win\build-vk\bin\Release\llama-server.exe (+ llama.dll, ggml*.dll)
+```
+
+### 1.3 构建 App(Tauri 安装包 + 便携版 exe)
+
+```powershell
+cd app
+npm install
+npx tauri build
+```
+
+产物:
+
+```
+app\src-tauri\target\release\edge0-app.exe ← portable, no install
+app\src-tauri\target\release\bundle\nsis\edge0_0.1.0_x64-setup.exe ← NSIS installer
+```
+
+外壳通过 `EDGE0_BIN_DIR` 定位引擎(默认:上文的 depot 引擎构建目录 —— 完整的覆盖项见 `app/README.md` 的环境变量表)。若引擎构建在别处,请设置该变量。
+
+### 1.4 模型
+
+无需预装任何东西:App 首次使用时从 HuggingFace 下载,然后在端上转换(一次性,8B 约 2–6 分钟)。逐文件 `sha256` 会对照已发布清单校验,并支持通过 HTTP Range 断点续传。
+
+手动预置(离线机器):把 MLX 仓库文件放在
+
+```
+~\.edge0\models\edge0-8b\ (chat_template.jinja, model*.safetensors, lora_edge0_8b.safetensors, tokenizer…)
+~\.edge0\models\edge0-35b\ (…sharded safetensors, lora_edge0_35b.safetensors…)
+```
+
+转换器输出为 `models\edge0-<tier>-gguf\edge0-<tier>.gguf` + LoRA 适配器;转换是幂等的(sha 门控)。主目录为 `EDGE0_HOME`(默认 `~\.edge0`)。
+
+### 1.5 运行 App
+
+启动 `edge0-app.exe`(或安装 NSIS 包)。典型流程:
+
+1. **Models 页面** —— 选择 8B(快,约 5 GB)或 35B(约 21 GB);*Download* → 自动 *Convert* → *Load*。
+2. **Chat 页面** —— 流式 Markdown 回答;引擎作为受监督的子进程运行,并随 App 一起被终止(Windows Job Object,`KILL_ON_JOB_CLOSE`)。
+3. **Doctor**(Models 页面底部)—— 一键健康检查:引擎二进制、模型文件、磁盘、环境。
+4. 排障:引擎/转换日志位于 `~\.edge0\logs\`。
+
+引擎 API(App 内部使用,任何 OpenAI 兼容客户端都可指向它):`http://127.0.0.1:<port>/v1/chat/completions`,仅限回环。加载参数(进程契约):`-ngl 99 -cmoe --ctx-size 8192 --flash-attn on --pool-mb <tier×RAM clamp> --mem-budget-mb …`。
+
+### 1.6 测试
+
+```powershell
+cd app\src-tauri
+cargo test # fast suite: resume/probe logic against a local fake server
+
+# end-to-end, real model (downloads 4.5 GB if not seeded):
+cargo test --test real8b -- --ignored --nocapture
+
+# throughput reproduction (expects the table in §2, ±day-to-day drift):
+python ..\..\tools\r3_bench.py --tier 8b
+python ..\..\tools\r3_bench.py --tier 35b
+```
+
+`r3_bench.py` 以与 App 相同的契约解析路径:引擎取自 depot 构建目录(支持 `EDGE0_BIN_DIR` 覆盖),转换后的 GGUF 取自 App 的模型主目录(`EDGE0_HOME`,默认 `~\.edge0\models`)或存在时的仓库本地 `models/`;结果落在 `benchmarks/r3/`。
+
+```powershell
+# patch-replay gate (no compile, seconds):
+pwsh ..\..\scripts\vendor-build.ps1 -AssembleOnly
+```
+
+---
+
+## 2. 性能实测
+
+参考机器:**Intel i7-14700K · AMD Radeon RX 9070 GRE(Vulkan)· 48 GB DDR5 · Windows 11**,稳态(`-ngl 99 -cmoe`),3 轮基准取中位数(`tools/r3_bench.py`,约 240 token 混合语言 prompt,原生上下文)。
+
+| 模型 | prefill(tok/s) | decode(tok/s) | 240 token prompt 的 prefill |
+|---|---:|---:|---:|
+| edge0-8B-A1B | ~212 | ~44.8 | ~1.1 s |
+| edge0-35B-A3B | ~70 | ~27.7 | ~3.7 s |
+
+阅读这些数字时需要了解的背景:
+
+- decode 是 prompt 处理完成后的 *token 生成*速率;A1B / A3B 的激活参数量解释了为什么 35B 模型能以 27+ tok/s 解码。
+- 短 prompt 远快于上表的 240 token 列:App 对 8B 的首个真实请求,17 token 的 prompt **首 token 约 0.28 s**(引擎日志)。App 以 `--ctx-size 8192` 运行;上述基准使用原生上下文(131k / 262k)。
+- 这些是 48 GB 参考机器上的热内存实测(它是测试台,不代表产品假设)。在 16 GB / 8 GB 的产品档位上,专家经 mmap 缺页供给,解码速度随内存压力下降;进程级内存上限(`--mem-budget-mb`)会依据物理内存自动施加,以保持操作系统工作集合理(在压力下它确有可测量的*帮助*)。
+- 与未打补丁的原版 llama.cpp(跳过补丁 band 的 vendor 树)在同条件下 A/B 对比表明补丁集零开销(8B:decode 41.5 对 39.5;35B:27.2 对 27.4 —— 均在机器波动范围内)。
+- 这一级别的机器日间波动可达百分之几;如要跑基准,请在同一天、同一进程内做同类对比。
+
+---
+
+## 3. 技术细节
+
+### 3.1 架构
+
+```mermaid
+flowchart LR
+ subgraph ondevice ["On-device, first run"]
+ A[MLX safetensors<br/>int4 g64] -->|repack, bit-exact<br/>no requant| B[GGUF Q4_1<br/>edge0-tier.gguf]
+ A2[MLX LoRA] -->|fuse + adapt| B2[GGUF adapter]
+ end
+ B --> C[("pinned llama.cpp fork<br/>7ab4ee7 + 8 patches")]
+ B2 --> C
+ C -->|Vulkan: dense attn / GDN / norms| D[(GPU)]
+ C -->|"-cmoe: expert weights"| E[(CPU, mmap +<br/>L1 advisory pool)]
+ C --> F[llama-server<br/>127.0.0.1 OpenAI API]
+ F --> G[Tauri 2 shell<br/>supervisor + chat UI]
+```
+
+```mermaid
+flowchart TB
+ subgraph build ["Source-of-truth layout (open source)"]
+ U[github ggml-org/llama.cpp] -->|detached pin, never edited| V[vendor/llama.cpp @7ab4ee7]
+ P[patches/llama.cpp/common+windows] -->|git am --3way into per-platform worktree| W[wt/win]
+ V --> W
+ S[serve/*.cc edge0 code] -->|CMake glob patch #3| W
+ end
+```
+
+### 3.2 仓库结构
+```
+serve/ edge0 C++ pieces compiled into libllama (advisory prefetch router, memory budget)
+tools/ MLX→GGUF converter chain (repack + LoRA adapter + catalog) and the throughput bench
+app/ Tauri 2 shell (src-tauri/ Rust, src/ React) — see app/README.md
+scripts/ vendor-build.ps1 — engine assembly: patch replay into an isolated worktree
+```
+
+引擎改动位于 monorepo 根目录,而非某个 fork:`vendor/llama.cpp` 是固定版本的原始上游 checkout(绝不就地打补丁),`patches/llama.cpp/` 承载 8 个 hook-point 补丁 + band README(此处为 `common/`、`windows/`;`android/` 供伙伴 App 使用)。`windows/` 刻意**不**携带嵌套的 `patches/` 副本 —— 单一事实来源,杜绝漂移。
+
+### 3.3 已知缺口(截至本版本)
+
+- 安装包**未签名**(首次运行会有 SmartScreen 警告);尚无自动更新。
+- 引擎尚未打包进安装包 —— 便携版构建假定引擎构建目录存在;打包在路线图中。
+- `--pool-mb` L1 池在 Windows 上处于环境休眠状态,等待最终的内存档位 A/B;无论如何 App 都会钳制 `--mem-budget-mb`。
+- ≤16 GB 机器上的 35B 可用但受分页限制;文档化的下限是 8 GB *配合*内存上限工作,tok/s 有所降低。
+
+---
+
+*欢迎提交 issue 与其他硬件上的基准结果 —— 请附上 `~\.edge0\logs\engine-*.log` 与 `doctor` 页面截图。*