Spaces:
Sleeping
Sleeping
| title: Nexus-Nano Inference API | |
| emoji: π | |
| colorFrom: yellow | |
| colorTo: red | |
| sdk: docker | |
| pinned: false | |
| license: gpl-3.0 | |
| # π Nexus-Nano Inference API | |
| Ultra-lightweight chess engine for instant responses. | |
| [](https://huggingface.co/GambitFlow/Nexus-Nano) | |
| [](https://huggingface.co/GambitFlow/Nexus-Nano) | |
| [](https://huggingface.co/GambitFlow/Nexus-Nano) | |
| ## π― Model Details | |
| **Nexus-Nano** is the fastest model in the GambitFlow series: | |
| - **Model:** [GambitFlow/Nexus-Nano](https://huggingface.co/GambitFlow/Nexus-Nano) | |
| - **Parameters:** 2.8 Million | |
| - **Architecture:** Compact ResNet (6 blocks) | |
| - **Input:** 12-channel board representation | |
| - **Training Data:** [GambitFlow/Elite-Data](https://huggingface.co/datasets/GambitFlow/Elite-Data) (5M+ positions) | |
| - **Strength:** 1800-2000 ELO estimated | |
| ## π¬ Search Algorithm | |
| Ultra-minimal implementation for maximum speed: | |
| ### Core Features | |
| - **Pure Alpha-Beta Pruning** [^1] - Classic minimax | |
| - **Simple MVV-LVA Ordering** [^2] - Capture prioritization | |
| - **No Transposition Table** - Zero memory overhead | |
| - **Iterative Deepening** - Anytime algorithm | |
| ### Design Philosophy | |
| - **Minimal overhead** - Direct evaluation calls | |
| - **Speed over strength** - Optimized for response time | |
| ## π Performance | |
| | Metric | Value | Environment | | |
| |--------|-------|-------------| | |
| | **Depth 3 Search** | ~0.2-0.5 seconds | HF Spaces CPU | | |
| | **Average Nodes** | 2K-5K per move | Typical positions | | |
| | **Memory Usage** | ~1GB RAM | Peak inference | | |
| | **Response Time** | 200-500ms | 95th percentile | | |
| ## π‘ API Endpoints | |
| ### `POST /get-move` | |
| **Request:** | |
| ```json | |
| { | |
| "fen": "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1", | |
| "depth": 3 | |
| } | |
| ``` | |
| **Response:** | |
| ```json | |
| { | |
| "best_move": "e2e4", | |
| "evaluation": 0.18, | |
| "depth_searched": 3, | |
| "nodes_evaluated": 2847, | |
| "time_taken": 234 | |
| } | |
| ``` | |
| ### `GET /health` | |
| Health check endpoint. | |
| ## π§ Parameters | |
| - **fen** (required): Board position in FEN notation | |
| - **depth** (optional): Search depth (1-5, default: 3) | |
| ## π Quick Start | |
| ```python | |
| import requests | |
| response = requests.post( | |
| "https://YOUR-SPACE.hf.space/get-move", | |
| json={ | |
| "fen": "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1", | |
| "depth": 3 | |
| } | |
| ) | |
| data = response.json() | |
| print(f"Best move: {data['best_move']} (took {data['time_taken']}ms)") | |
| ``` | |
| ## π» Use Cases | |
| Perfect for: | |
| - **Bullet chess (1+0, 2+1)** - Lightning-fast moves | |
| - **Chess tutorials** - Instant move suggestions | |
| - **Mobile applications** - Minimal resource usage | |
| - **Live analysis** - Real-time position evaluation | |
| - **Casual play** - Good enough for beginners/intermediate | |
| ## π Research References | |
| [^1]: **Alpha-Beta Pruning**: Knuth, D. E., & Moore, R. W. (1975). "An analysis of alpha-beta pruning". *Artificial Intelligence*, 6(4), 293-326. | |
| [^2]: **MVV-LVA**: Hyatt, R. M., Gower, A. E., & Nelson, H. L. (1990). "Cray Blitz". *Computers, Chess, and Cognition*, 111-130. | |
| ## π Minimalist Design Inspiration | |
| - **MicroMax** - Mulder, H. G. (2007). "1433-byte chess program". https://home.hccnet.nl/h.g.muller/max-src2.html | |
| - **Sunfish** - Fiekas, N. (2013). "Simple chess engine in Python". https://github.com/thomasahle/sunfish | |
| - **Stockfish Lite** - Simplified versions for embedded systems | |
| ## π Model Lineage | |
| **GambitFlow AI Engine Series:** | |
| 1. **Nexus-Nano (2.8M)** - Ultra-fast baseline β¨ | |
| 2. Nexus-Core (13M) - Balanced performance | |
| 3. Synapse-Base (38.1M) - State-of-the-art | |
| ## βοΈ Comparison Table | |
| | Feature | Nexus-Nano | Nexus-Core | Synapse-Base | | |
| |---------|------------|------------|--------------| | |
| | **Speed** | β‘β‘β‘β‘ Lightning | β‘β‘β‘ Ultra-fast | β‘β‘ Fast | | |
| | **Strength** | 1800-2000 ELO | 2000-2200 ELO | 2400-2600 ELO | | |
| | **Memory** | 1GB | 2GB | 5GB | | |
| | **Depth** | 3-4 | 4-5 | 5-7 | | |
| | **Response** | 200-500ms | 500-1000ms | 1000-2000ms | | |
| | **Best for** | Bullet/Mobile | Online/Rapid | Tournament/Analysis | | |
| ## π― When to Use | |
| Choose **Nexus-Nano** if: | |
| - β Speed is critical (bullet games, live demos) | |
| - β Resource-constrained environment (mobile, embedded) | |
| - β Playing against beginners/intermediate (1800-2000 ELO) | |
| - β You need instant move suggestions | |
| Choose **Nexus-Core** if: | |
| - β‘ You want balanced speed and strength | |
| - β‘ Playing online rapid/blitz games | |
| Choose **Synapse-Base** if: | |
| - π Maximum strength is priority | |
| - π Tournament-level play | |
| - π Deep position analysis needed | |
| --- | |
| **Developed by:** [GambitFlow](https://huggingface.co/GambitFlow) / Rafsan1711 | |
| **License:** GPL v3 (GNU General Public License Version 3) | |
| **Citation:** | |
| ```bibtex | |
| @software{gambitflow_nexus_nano_2025, | |
| author = {Rafsan1711}, | |
| title = {Nexus-Nano: Ultra-Lightweight Chess Engine}, | |
| year = {2025}, | |
| publisher = {Hugging Face}, | |
| url = {https://huggingface.co/GambitFlow/Nexus-Nano} | |
| } | |
| ``` | |
| --- | |
| Part of the **GambitFlow Project** β‘βοΈ |