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
|
Download CHANGELOG.md from AdminReal/NexusCoder: direct link, hf CLI and curl.
- Browser
- Download file 18.2 kB
-
https://huggingface.co/AdminReal/NexusCoder/resolve/main/CHANGELOG.md
- Command line
-
hf download hf://AdminReal/NexusCoder/CHANGELOG.md
-
curl -L -o CHANGELOG.md https://huggingface.co/AdminReal/NexusCoder/resolve/main/CHANGELOG.md
18.2 kB
Thay đổi / Changelog
v0.4.0 - 2026-08-17 — CyberForge Edition
SUPREME UPGRADE — 423B params, 3M context, CyberGym training methodology
Tác giả / Author: Hieu Louis
New Features
Model architecture — 423B / 39B / 3M context
- New config
423b(DEFAULT for v0.4): 423B total / 39B active params - 24 layers, hidden 7168, 48 experts (4 active), inter 16384
- 3,000,000-token context window via YaRN RoPE scaling (×60)
- Sliding window 32k + QK-norm + KV cache int8 + gradient checkpointing
- Adaptive Density Routing: top-2 → top-8 active experts based on input entropy
CyberGym training methodology (NEW)
- Code Genome Initialization (CGI): weight init from code motifs
- Mutation Pressure Training (MPT): beneficial weight perturbations during training
- Expert Speciation Curriculum (ESC): 48 experts → 48 species (Python/JS/Rust/Go/...)
- Recursive Self-Compression (RSC): periodic self-distillation snapshots
- Context Expansion Protocol (CEP): progressive 32k → 3M context extension
- Adaptive Density Routing (ADR): entropy-based top-k routing
- Orchestrator
CyberForgeTrainerwires all components together
Data pipeline — Code corpus curated
configs/code_corpus.yaml: 1000+ curated GitHub repos across 17 categories- Categories: python_core, python_web, python_data, python_ml, python_dl, python_tools, javascript_core, javascript_frameworks, rust_core, go_core, java_core, c_cpp, devops, security, ai_tools, scientific, systems
Bug Fixes (48 total)
CRITICAL (6 fixes)
nexus/safety/__init__.py: missingget_default_guardrailsexport brokenexus.agentnexus/data/processors/deduplicator.py: wrong import path (.._logging_helpers→...utils.logging)nexus/model/attention.py: INT8 KV cache quantization discarded scale → crash on 2nd decode stepscripts/collect_data.py:CURATED_TAGSwas a class attribute, not module-level → ImportErrornexus/agent/planner.py: invalid dependency IDs silently treated as "met" (security bug)nexus/config.py: 30B / 70B configs were 5×–9× off their advertised size
MAJOR (22 fixes)
- MoE never received
attention_mask(padded tokens polluted aux loss) - LoRA
target_moduleslistedgate_proj/up_projbut v0.3 SwiGLU fuses them intogate_up_proj python_execsandbox: when run as script,__builtins__was a module → sandbox escapepython_exec: timeout was computed but never enforced → infinite loops could hang the agentshell.py: deadif Falsebranch with unimportedos- ALiBi
max_slopeparameter was hardcoded to 8.0 (parameter had no effect) - ALiBi non-power-of-2 head count subselection was wrong (took first N, not closest N)
- GitHub collector:
"c++"language key didn't exist in EXTENSIONS (should be"cpp") - GitHub collector: hardcoded
--branch mainfailed for repos usingmaster - arXiv collector:
.find().textwithout None check crashed entire parse on missing element - arXiv collector: query string not URL-encoded
compute_rouge: rouge_1 was precision, not recall (corrected to F1)compute_bleu: empty references list crashedmin()call- FP8 quantization skip_layers comparison never matched (all params got FP8-quantized)
- Attention mask shape mismatch with KV cache + sliding window
- Trainer: AMP scaler state not checkpointed (resume caused NaN gradients)
quality_filter: off-by-one in 10-gram repetition windowdataset.py: hardcoded pad id 0 (collided with token 0 if user changedpad_token_id)- Tokenizer: Vietnamese char
Ẵwas duplicated asẲ(missingẴ) - Tokenizer: BPE merge lost
</w>marker when first symbol had it - Tokenizer:
tuple(k.split("|"))broke when token contained| scripts/train.py:--configchoices missing30b,70b,423b
MINOR (20 fixes)
- Various unused imports, dead code, type hints
- See git log for full list
License change
- Switched from MIT to NexusCoder Attribution License v1.0 (NAL-1.0)
- Free use for any purpose (commercial/non-commercial/research)
- Mandatory attribution: "Hieu Louis" + link to original repo
- See LICENSE for full terms
Files added
nexus/cybergym/__init__.pynexus/cybergym/mutation.pynexus/cybergym/genome.pynexus/cybergym/adaptive_routing.pynexus/cybergym/speciation.pynexus/cybergym/compression.pynexus/cybergym/context_expansion.pynexus/cybergym/trainer.pyconfigs/nexus_coder_423b.yamlconfigs/code_corpus.yamlADVERTISEMENT.txt
v0.3.0 - 2026-08-16
🚀 MASSIVE UPGRADE - Architecture + 4× Skills + 4× Tools + Massive Data
Tác giả / Author: Hieu Louis
✨ Tính năng mới / New Features
🏗️ Kiến trúc v0.3 (NEW)
- ✅ FlashAttention-2: Optional
flash_attnpackage backend (falls back to SDPA) - ✅ ALiBi position bias: Alternative to RoPE for long-context extrapolation (Press et al., 2022)
- ✅ Sliding Window Attention: Alternating SWA / global layers (Longformer / Mistral style)
- ✅ QK-norm: RMSNorm on query/key for training stability (Llama-3 style)
- ✅ MLP-parallel: Fused gate+up projection (concatenated matmul) — faster on modern GPUs
- ✅ KV cache quantization: int8 / fp8 options for inference memory reduction
- ✅ Gradient checkpointing: Trade compute for VRAM at training time
- ✅ RoPE scaling strategies: linear / dynamic (NTK) / ntk / yarn — supports context extension up to 256k
📊 Multi-Variant Configs (7 variants)
- ✅
tiny- ~5M params (CPU demo) - ✅
small- ~125M params (1 GPU) - ✅
medium- ~1B params (4-8 GPU) - ✅
large- 10B/1.5B (default, 32+ GPU) - ✅
xlarge- ~30B/3B (research, 64+ GPU) - ✅
30b- 30B/3B (v0.3 NEW, 64-128 H100, 64k context) - ✅
70b- 70B/5B (v0.3 NEW, 256+ H100/H200, 128k context with YaRN ×4)
🎯 Skills System (15 → 60+)
- ✅ Existing 15: code_generation, code_review, code_refactor, debugging, documentation, testing, algorithm_design, data_analysis, translation, summarization, reasoning, math_skill, sql_generation, security_audit, performance_opt
- ✅ DevOps (5 NEW): devops_skill, ci_cd_pipeline, release_management, monitoring, logging_analytics
- ✅ ML (10 NEW): ml_training, ml_inference, ml_evaluation, ml_data_preprocessing, ml_feature_engineering, ml_hyperparameter_tuning, ml_model_explainability, ml_model_selection, ml_metrics, anomaly_detection
- ✅ Data (5 NEW): data_pipeline, statistical_analysis, time_series_forecasting, clustering_analysis, knowledge_graph
- ✅ Code (10 NEW): code_translation, code_completion, code_explanation, code_minification, code_documentation_generation, code_duplication_detection, code_dead_code_analysis, code_complexity_analysis, code_dependency_analysis, bug_reproduction
- ✅ System (4 NEW): system_design, api_design, graphql_skill, microservices
- ✅ Language (5 NEW): prompt_engineering, sentiment_analysis, topic_modeling, language_detection, creative_writing
- ✅ Cloud (1 NEW): cloud_deploy
- ✅ Blockchain (1 NEW): blockchain_audit
- ✅ Caching (1 NEW): caching_strategy
- ✅ Classification (1 NEW): classification_automation
- ✅ Regex (1 NEW): regex_master
- ✅ Shell (1 NEW): shell_scripting
🔧 Tools System (18+ → 80+)
- ✅ Existing 24: file_read/write/list/delete, shell_exec, python_exec, git_ops, http_request, web_fetch, web_search, code_search/lint/format, calculator, json/yaml/csv_parse, regex_search, archive, hash, encrypt, datetime, dns_lookup, ping
- ✅ Database (12 NEW): sql_runner, sql_formatter, sql_migrator, postgres, mysql, sqlite, redis, mongo, elasticsearch, kafka, rabbitmq, graphql_client
- ✅ DevOps/Cloud (12 NEW): docker, kubectl, terraform, ansible, aws_cli, gcloud_cli, azure_cli, ssh, scp, rsync, systemd, crontab
- ✅ Code analysis (13 NEW): code_ast, code_complexity, code_dependency, code_metrics, code_smells, code_formatter_advanced, code_minifier, code_transpiler, code_runner, code_tester, code_compiler, code_profiler, code_coverage
- ✅ Web/Network (12 NEW): websocket_client, grpc_client, url_shortener, dns_query, traceroute_tool, port_scanner, ssl_checker, ssl_generator, cert_checker, web_scraper, web_crawler, web_auth
- ✅ Misc/Convert/Security (13 NEW): jwt_tool, oauth_tool, api_key_validator, markdown_converter, pdf_generator, image_processor, statistics_tool, linear_algebra_tool, probability_tool, ml_metrics_tool, model_evaluator, benchmark_runner, log_analyzer
📊 Data Pipeline (5 → 8 sources, 60 → 500+ repos)
- ✅
GitHubCollector(expanded): 60+ → 500+ curated repos (Python, JS, TS, Go, Rust, C/C++, Java, C#, Ruby, PHP, Swift, Kotlin, ...) - ✅
HuggingFaceCollector(expanded): 20+ → 150+ datasets (code, instruction, math, Vietnamese, multilingual) - ✅
ArxivCollector: 20 → 40 queries - ✅
WikipediaCollector: 18 → 50+ topics per language - ✅
StackOverflowCollector: 30 → 47 tags - ✅
TheStackCollector(v0.3 NEW): BigCode's The-Stack v2 (~600 languages) - ✅
StarCoder2Collector(v0.3 NEW): github_code + commits + jupyter notebooks - ✅
PythonAlpacaCollector(v0.3 NEW): aggregates 6 Python instruction datasets
🧠 Processors (4 → 6)
- ✅
TextCleaner,Deduplicator,QualityFilter,CodeFormatter(existing) - ✅
LanguageIdProcessor(v0.3 NEW): identifies vi/en/code, drops mislabeled - ✅
CodeQualityProcessor(v0.3 NEW): scores Python 1-10 (docstring, type hints, no eval, etc.)
🤝 Integrations (5 reference frameworks)
- ✅
litgpt.py: FusedLinear adapter (Apache 2.0, Lightning AI) - ✅
llamafactory.py: dataset format converters (alpaca/sharegpt/chatml/completion → nexus) - ✅
axolotl.py: AxolotlStyleConfig dataclass (typed training config schema) - ✅
openhands.py: AgentLoop pattern (planner/executor/observer/reflector) - ✅
omp_gym.py: OpenMP optimization benchmark tasks
📈 Evaluation Module
- ✅
BenchmarkSuite- 10 benchmarks (HumanEval, MBPP, GSM8K, MMLU, BBH, MATH, ARC, TruthfulQA, AlpacaFarm, OMP-gym) - ✅ Metrics: Perplexity, BLEU, ROUGE, F1, code-pass@k
🔧 Cải tiến / Improvements
- ✅ Auto-discovery registries: Skills + Tools now scan directories dynamically — drop a
.pyfile with aSkill/Toolsubclass and it auto-registers - ✅ Stream-friendly training data:
StreamingNexusDatasetfor >1M example datasets (no RAM pressure) - ✅ Trimmed hardcoded data: AUTHOR_TRAINING_DATA 150+ → 15 core examples (rest loaded from JSONL)
- ✅ Lazy imports: Faster startup; optional deps only imported when needed
- ✅ Type hints: Full typing throughout
- ✅ Safety first: All DANGEROUS/DESTRUCTIVE tools have
requires_confirmation=True+dry_runsupport - ✅ Audit logging: All tool calls logged to JSONL with timestamp, args, result, duration
- ✅ Bilingual: Vietnamese + English throughout
📊 Thông số kỹ thuật / Technical Specs
| Thông số | v0.2 | v0.3 |
|---|---|---|
| Version | 0.2.0 | 0.3.0 |
| Skills | 15 | 60+ |
| Tools | 18+ | 80+ |
| Data sources | 5 | 8 |
| Curated repos | 60+ | 500+ |
| Curated datasets | 20+ | 150+ |
| Configs | 5 | 7 |
| Reference frameworks | 0 | 5 |
| Attention backends | 1 (SDPA) | 3 (SDPA + FA2 + ALiBi) |
| Python version | 3.12.13 | 3.12.13 (strict) |
| PyTorch | >= 2.0 | >= 2.0 (>= 2.3 for 70b config) |
📁 Cấu trúc thư mục v0.3 (key changes)
NexusCoder/
├── nexus/
│ ├── __init__.py # v0.3.0 metadata
│ ├── config.py # + 30b/70b configs + attention features
│ ├── model/
│ │ ├── attention.py # + FA2, ALiBi, SWA, QK-norm, KV quant
│ │ ├── rope.py # + NTK/YaRN scaling
│ │ ├── flash_attention.py # NEW
│ │ ├── alibi.py # NEW
│ │ ├── sliding_window.py # NEW
│ │ ├── layers.py # + MLP-parallel SwiGLU
│ │ └── transformer.py # + gradient checkpointing
│ ├── training/
│ │ └── dataset.py # trimmed + StreamingNexusDataset
│ ├── skills/ # 60+ skills, auto-discovery registry
│ ├── tools/ # 80+ tools, auto-discovery registry
│ ├── data/
│ │ ├── collectors/ # 8 collectors (3 NEW)
│ │ └── processors/ # 6 processors (2 NEW)
│ └── integrations/ # NEW: 5 reference framework adapters
├── configs/
│ ├── nexus_coder_30b.yaml # NEW
│ ├── nexus_coder_70b.yaml # NEW
│ └── sources.yaml # expanded to 500+ repos, 150+ datasets
├── ATTRIBUTIONS.md # NEW
├── requirements.txt # + 30 new optional deps
├── pyproject.toml # v0.3.0 + extras groups
└── setup.py # v0.3.0
🚀 Migration từ v0.2
v0.3 backward compatible với v0.2:
NexusConfig()vẫn hoạt động (default = large 10B)NexusAgent()vẫn hoạt độngAUTHOR_TRAINING_DATAvẫn có (nhưng được tinh gọn)scripts/train.pyvẫn hoạt động (nhưng có thêm config 30b, 70b)
Breaking changes (minor):
nexus.skills.registry._auto_register_defaultsgiờ dùng dynamic discovery thay vì hardcoded importsnexus.tools.registry._auto_register_defaultstương tựAUTHOR_TRAINING_DATAgiảm từ 150+ xuống 15 mẫu (phần còn lại load từdata/processed/*.jsonl)
📦 Dependencies mới
# Database tools
pip install sqlalchemy psycopg2-binary pymysql redis pymongo elasticsearch kafka-python pika
# Web/Network tools
pip install aiohttp websockets grpcio beautifulsoup4 lxml
# DevOps tools
pip install paramiko kubernetes docker
# Media/Convert tools
pip install Pillow reportlab markdown
# ML tools
pip install scikit-learn scipy transformers accelerate peft
# Crypto
pip install pyjwt
# GPU acceleration
pip install flash-attn --no-build-isolation
# All at once
pip install -e ".[all]"
v0.2.0 - 2026-08-16
🚀 Major Upgrade - Skills, Tools, và Data Pipeline
Tác giả / Author: Hieu Louis
✨ Tính năng mới / New Features
🎯 Skills System (15 skills)
- ✅
code_generation- Sinh code từ mô tả (Python, JS, Go, Rust, SQL, ...) - ✅
code_review- Review code: bugs, security, performance - ✅
code_refactor- Tái cấu trúc code (extract, rename, patterns) - ✅
debugging- Debug đa ngôn ngữ với 7-step protocol - ✅
documentation- Sinh docstrings, README, API docs - ✅
testing- Unit/integration/E2E/property/mutation tests - ✅
algorithm_design- Thiết kế thuật toán, complexity analysis - ✅
data_analysis- EDA, statistics, visualization - ✅
translation- Dịch song ngữ Việt-Anh - ✅
summarization- Extractive + abstractive summarization - ✅
reasoning- CoT, ToT, ReAct, self-consistency - ✅
math_skill- Algebra, calculus, linear algebra, statistics - ✅
sql_generation- SQL cho 7 dialects (Postgres, MySQL, ...) - ✅
security_audit- OWASP Top 10, SAST, dependency scan - ✅
performance_optimization- Profiling, bottleneck, optimization
🔧 Tools System (15+ tools)
- ✅
file_read/file_write/file_list/file_delete- File operations - ✅
shell_exec- Execute bash commands (sandboxed) - ✅
python_exec- Execute Python code (restricted namespace) - ✅
git_ops- Git commands với safety classification - ✅
http_request- HTTP GET/POST/PUT/DELETE - ✅
web_fetch- Fetch webpage, extract text - ✅
web_search- Web search (Google/Bing/Brave API) - ✅
code_search- Regex search trong code files - ✅
code_lint/code_format- Lint & format code - ✅
calculator- Safe math expression eval - ✅
json_parse/yaml_parse/csv_parse- Data parsers - ✅
regex_search- Regex search trong files - ✅
archive- ZIP/TAR create/extract/list - ✅
hash/encrypt- Hashing & AES-256-GCM encryption - ✅
datetime- DateTime operations + timezone convert - ✅
dns_lookup/ping- Network diagnostics
📊 Training Data Pipeline
- ✅
GitHubCollector- Thu thập code từ 60+ curated GitHub repos - ✅
HuggingFaceCollector- 20+ curated HF datasets (code, text, Vietnamese) - ✅
ArxivCollector- Scientific papers từ arXiv API - ✅
WikipediaCollector- Vietnamese + English Wikipedia - ✅
StackOverflowCollector- Q&A từ StackOverflow API - ✅
TextCleaner- HTML stripping, unicode normalize, whitespace cleanup - ✅
CodeFormatter- Format code samples, detect language - ✅
Deduplicator- MinHash LSH for near-duplicate detection - ✅
QualityFilter- Quality scoring (length, diversity, repetition) - ✅
CurriculumLearning- 4-stage curriculum (easy → expert)
v0.1.0 - 2026-08-16
🎉 Initial Release - Foundation
Tác giả / Author: Hieu Louis
Thêm mới / Added
- ✅ Kiến trúc Mixture of Experts (MoE) với 24 experts, 3 active mỗi token
- ✅ Tổng 10 tỷ tham số (10B) với chỉ 1.5 tỷ tham số active (1.5B) mỗi token
- ✅ Cửa sổ ngữ cảnh 50,000 tokens với RoPE
- ✅ Grouped Query Attention (GQA) - 16 heads, 4 KV heads
- ✅ RMSNorm + SwiGLU activation
- ✅ BPE Tokenizer song ngữ Việt-Anh
- ✅ Training script với AdamW + cosine LR schedule
- ✅ Inference engine với top-k, top-p, temperature sampling
- ✅ AI Agent wrapper (Nexus Agent) với quản lý hội thoại
- ✅ Hardcoded author info - model luôn nhớ được tạo bởi Hieu Louis
- ✅ Test suite đầy đủ
- ✅ Song ngữ Việt-Anh trong README và giao tiếp
- ✅ MIT License
- ✅ Tương thích Python 3.12.13