Text Generation
Transformers
Safetensors
qwen2
coder
code
agent
conversational
text-generation-inference
Instructions to use AdminReal/NexusCoder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AdminReal/NexusCoder with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AdminReal/NexusCoder") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("AdminReal/NexusCoder") model = AutoModelForCausalLM.from_pretrained("AdminReal/NexusCoder", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AdminReal/NexusCoder with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AdminReal/NexusCoder" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AdminReal/NexusCoder", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/AdminReal/NexusCoder
- SGLang
How to use AdminReal/NexusCoder with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "AdminReal/NexusCoder" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AdminReal/NexusCoder", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "AdminReal/NexusCoder" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AdminReal/NexusCoder", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use AdminReal/NexusCoder with Docker Model Runner:
docker model run hf.co/AdminReal/NexusCoder
Update README to match Qwen2.5-Coder based Nexus Coder
Browse files
README.md
CHANGED
|
@@ -1,134 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
<div align="center">
|
| 2 |
|
| 3 |
# 🧠 Nexus Coder
|
| 4 |
|
| 5 |
-
### AI Code & Security Engine —
|
| 6 |
-
|
| 7 |
-
**An open architecture for next‑generation code generation and security analysis**
|
| 8 |
-
|
| 9 |
-
[](https://www.python.org/)
|
| 10 |
-
[](https://pytorch.org/)
|
| 11 |
-
[](LICENSE)
|
| 12 |
-
[]()
|
| 13 |
-
[]()
|
| 14 |
-
[](https://github.com/mhieuhonda/NexusCoder)
|
| 15 |
-
[](https://github.com/mhieuhonda/NexusCoder)
|
| 16 |
-
[](https://github.com/mhieuhonda/NexusCoder)
|
| 17 |
|
| 18 |
-
**
|
| 19 |
|
| 20 |
</div>
|
| 21 |
|
| 22 |
## 📖 Introduction
|
| 23 |
|
| 24 |
-
**Nexus Coder** is
|
| 25 |
-
|
| 26 |
-
- **High‑quality code generation** powered by a large‑scale Mixture‑of‑Experts (MoE) Transformer.
|
| 27 |
-
- **Deep security analysis** for source code and systems.
|
| 28 |
-
|
| 29 |
-
The project is under **active development**. This repository provides:
|
| 30 |
|
| 31 |
-
-
|
| 32 |
-
-
|
| 33 |
-
- A **multi‑stage training framework** designed to scale.
|
| 34 |
-
- **60+ skills** and **80+ tools** with automatic registration.
|
| 35 |
-
- Configurations ranging from `tiny` (5M) to `423b` (423B parameters).
|
| 36 |
|
| 37 |
-
|
| 38 |
|
| 39 |
-
|
| 40 |
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
| Total parameters | ~423B |
|
| 44 |
-
| Active parameters per token | ~39B |
|
| 45 |
-
| Context window | 3,000,000 tokens (3M) |
|
| 46 |
-
| Architecture | MoE Transformer (GQA + RoPE/YaRN + RMSNorm + SwiGLU + FlashAttention‑2 + Sliding Window + QK‑norm + KV cache quantization + MLP‑parallel + Gradient checkpointing) |
|
| 47 |
-
| Skills | 60+ (code, devops, ML, data, security, cloud, system, blockchain, language) |
|
| 48 |
-
| Tools | 80+ (file, exec, web, code analysis, database, devops, crypto, math, network) |
|
| 49 |
-
| Data sources | 8+ (GitHub curated corpus, HuggingFace, arXiv, Wikipedia, StackOverflow, The‑Stack v2, StarCoder2‑data, Python‑Alpaca) |
|
| 50 |
-
| Python version | 3.12.13 (strict) |
|
| 51 |
|
| 52 |
-
|
|
|
|
|
|
|
| 53 |
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
# or: pip install -e ".[all]"
|
| 61 |
```
|
| 62 |
|
| 63 |
-
|
| 64 |
|
| 65 |
```bash
|
| 66 |
-
|
| 67 |
-
python -c "from nexus.config import print_config_summary; print_config_summary()"
|
| 68 |
-
|
| 69 |
-
# Tiny demo (CPU)
|
| 70 |
-
python scripts/train.py --config tiny --steps 100
|
| 71 |
-
|
| 72 |
-
# Train larger configurations (requires GPU)
|
| 73 |
-
python scripts/train.py --config large --steps 5000 --use-amp
|
| 74 |
-
python scripts/train.py --config 423b --steps 50000 --use-amp --deepspeed
|
| 75 |
```
|
| 76 |
|
| 77 |
-
📁
|
| 78 |
-
|
| 79 |
-
```
|
| 80 |
-
NexusCoder/
|
| 81 |
-
├── nexus/ # Main package
|
| 82 |
-
│ ├── model/ # MoE Transformer (attention, MoE, layers, ...)
|
| 83 |
-
│ ├── tokenizer/
|
| 84 |
-
│ ├── training/ # Trainer + Dataset
|
| 85 |
-
│ ├── inference/
|
| 86 |
-
│ ├── agent/ # Planner, Router, Memory, Safety
|
| 87 |
-
│ ├── skills/ # 60+ skills (auto‑discovery)
|
| 88 |
-
│ ├── tools/ # 80+ tools (auto‑discovery)
|
| 89 |
-
│ ├── data/ # Collectors + Processors
|
| 90 |
-
│ ├── optim/ # Quantize, LoRA, Distill, Prune
|
| 91 |
-
│ ├── safety/ # Filters, Guardrails
|
| 92 |
-
│ ├── eval/ # Benchmarks, Metrics
|
| 93 |
-
│ ├── integrations/ # litgpt, LlamaFactory, axolotl, OpenHands, omp‑gym
|
| 94 |
-
│ └── utils/
|
| 95 |
-
├── configs/ # YAML configs (tiny → 423B)
|
| 96 |
-
├── scripts/ # CLI scripts
|
| 97 |
-
├── docs/ # ARCHITECTURE, TRAINING, SKILLS, TOOLS, DATA
|
| 98 |
-
├── tests/
|
| 99 |
-
├── ATTRIBUTIONS.md
|
| 100 |
-
├── CHANGELOG.md
|
| 101 |
-
├── LICENSE # NAL‑1.0 (Attribution Required)
|
| 102 |
-
├── requirements.txt
|
| 103 |
-
├── pyproject.toml
|
| 104 |
-
├── setup.py
|
| 105 |
-
└── README.md
|
| 106 |
-
```
|
| 107 |
|
| 108 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
|
| 110 |
-
|
| 111 |
|
| 112 |
-
|
| 113 |
-
· Attribution is required to the original author: Hieu Louis (github.com/mhieuhonda).
|
| 114 |
-
· No warranty. See LICENSE for details.
|
| 115 |
|
| 116 |
-
|
|
|
|
| 117 |
|
| 118 |
-
|
| 119 |
|
| 120 |
Hieu Louis · 2026
|
| 121 |
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
· License: NAL‑1.0 (Attribution Required)
|
| 125 |
-
|
| 126 |
-
</div>
|
| 127 |
-
|
| 128 |
-
<div align="center">
|
| 129 |
-
|
| 130 |
-
Nexus Coder — CyberForge Edition
|
| 131 |
-
|
| 132 |
-
Made by Hieu Louis · 2026
|
| 133 |
-
|
| 134 |
-
</div>
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: Qwen/Qwen2.5-Coder-1.5B-Instruct
|
| 4 |
+
tags:
|
| 5 |
+
- qwen2
|
| 6 |
+
- coder
|
| 7 |
+
- code
|
| 8 |
+
- agent
|
| 9 |
+
- transformers
|
| 10 |
+
- text-generation
|
| 11 |
+
pipeline_tag: text-generation
|
| 12 |
+
library_name: transformers
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
<div align="center">
|
| 16 |
|
| 17 |
# 🧠 Nexus Coder
|
| 18 |
|
| 19 |
+
### AI Code & Security Engine — Qwen2.5-Coder based
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
+
**A deployable coding model: Qwen2.5-Coder-1.5B weights + Nexus Coder agent engine (skills & tools)**
|
| 22 |
|
| 23 |
</div>
|
| 24 |
|
| 25 |
## 📖 Introduction
|
| 26 |
|
| 27 |
+
**Nexus Coder** is a working AI model combining:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
+
- **Model weights:** [Qwen2.5-Coder-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct) (Apache 2.0) — a strong 1.5B coding model.
|
| 30 |
+
- **Agent engine:** the Nexus Coder framework (`nexus/`) — 60+ skills and 80+ tools with automatic registration, agent planner/router/memory/safety, data pipeline, and training utilities.
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
+
## 🚀 Quick Usage
|
| 33 |
|
| 34 |
+
The model is a standard `Qwen2ForCausalLM`. Load it with `transformers`:
|
| 35 |
|
| 36 |
+
```python
|
| 37 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
+
model_id = "AdminReal/NexusCoder"
|
| 40 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 41 |
+
model = AutoModelForCausalLM.from_pretrained(model_id)
|
| 42 |
|
| 43 |
+
messages = [{"role": "system", "content": "You are Nexus Coder, a helpful coding assistant."},
|
| 44 |
+
{"role": "user", "content": "Write a Python function to compute fibonacci."}]
|
| 45 |
+
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 46 |
+
inputs = tokenizer([text], return_tensors="pt")
|
| 47 |
+
out = model.generate(**inputs, max_new_tokens=512)
|
| 48 |
+
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
|
|
|
|
| 49 |
```
|
| 50 |
|
| 51 |
+
CLI chat demo (from source):
|
| 52 |
|
| 53 |
```bash
|
| 54 |
+
python scripts/chat.py --model AdminReal/NexusCoder
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
```
|
| 56 |
|
| 57 |
+
## 📁 Repository Contents
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
+
| Part | What it is | License |
|
| 60 |
+
|------|-----------|---------|
|
| 61 |
+
| `model.safetensors`, `config.json`, `tokenizer.*` | Qwen2.5-Coder-1.5B-Instruct weights | Apache 2.0 |
|
| 62 |
+
| `nexus/` | Agent engine source (skills, tools, agent, data, optim) | NAL-1.0 |
|
| 63 |
+
| `configs/` | Experimental architecture designs (`tiny` → `423b`) — **not** the hosted model | NAL-1.0 |
|
| 64 |
+
| `docs/`, `scripts/`, `tests/` | Documentation, CLI scripts, tests | NAL-1.0 |
|
| 65 |
|
| 66 |
+
> The `configs/nexus_coder_*.yaml` files describe a from-scratch MoE research architecture and are **independent** from the Qwen2-based weights hosted in this repo.
|
| 67 |
|
| 68 |
+
## ⚖️ Licenses
|
|
|
|
|
|
|
| 69 |
|
| 70 |
+
- **Model weights:** Apache 2.0 (from Qwen/Qwen2.5-Coder-1.5B-Instruct). See `LICENSE`.
|
| 71 |
+
- **Source code (nexus engine):** NexusCoder Attribution License v1.0 (NAL-1.0). Attribution required to Hieu Louis (github.com/mhieuhonda).
|
| 72 |
|
| 73 |
+
## 👤 Author
|
| 74 |
|
| 75 |
Hieu Louis · 2026
|
| 76 |
|
| 77 |
+
- GitHub: @mhieuhonda
|
| 78 |
+
- Project: NexusCoder
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|