Instructions to use Frankenstein-Labs/Cortex-ai with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Frankenstein-Labs/Cortex-ai with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Frankenstein-Labs/Cortex-ai")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Frankenstein-Labs/Cortex-ai") model = AutoModelForCausalLM.from_pretrained("Frankenstein-Labs/Cortex-ai", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Frankenstein-Labs/Cortex-ai with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Frankenstein-Labs/Cortex-ai" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Frankenstein-Labs/Cortex-ai", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Frankenstein-Labs/Cortex-ai
- SGLang
How to use Frankenstein-Labs/Cortex-ai 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 "Frankenstein-Labs/Cortex-ai" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Frankenstein-Labs/Cortex-ai", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Frankenstein-Labs/Cortex-ai" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Frankenstein-Labs/Cortex-ai", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Frankenstein-Labs/Cortex-ai with Docker Model Runner:
docker model run hf.co/Frankenstein-Labs/Cortex-ai
- CORTEX AI
- What is verified in this repository
- Capabilities
- Architecture
- Model details
- Installation
- Usage
- Requirements
- Native fusion prototype status
- First executable vision path
- Vision architecture status
- The CORTEX Ecosystem
- Vision
- Created by Abdoulaye Coumbassa
- Provenance, license and attribution
- Repository integrity statement
- Disclaimer
CORTEX AI
Next-generation AI for reasoning, mathematics, programming and intelligent software development.
CORTEX AI is the intelligence engine of the CORTEX ecosystem: a developer-oriented distribution and integration surface for advanced language-model capabilities. The project is created and developed by Abdoulaye Coumbassa, founder of Frankenstein-Labs. This is project identity information; it does not replace upstream model attribution.
This repository does not contain a newly trained model. It is a Hugging Face distribution of the upstream DeepSeek-V4-Pro-0813 checkpoint published under the CORTEX AI identity. CORTEX provides the project identity, documentation, integration direction and ecosystem around the model. The upstream model design, training and evaluation remain attributable to DeepSeek AI — see Provenance, license and attribution.
What is verified in this repository
Every number below was read from the files or metadata actually present in
Frankenstein-Labs/Cortex-ai during a full audit on 2026-09-16. No value is estimated.
| Property | Verified value | Source of truth |
|---|---|---|
| Architecture | DeepseekV4ForCausalLM (model_type: deepseek_v4) |
config.json |
| Parameters (HF metadata) | 1,650,497,936,906 (1.6505 T) | Hub safetensors metadata |
| Weight-bearing parameters | 1,650,495,609,866 | computed from all 66 tensor headers |
| Quantization scales | 50,735,763,136 | computed from all 66 tensor headers |
| Routing tables | 2,327,040 | computed from all 66 tensor headers |
| Stored payload | 892,762,490,337 bytes (892.76 GB) | repository file listing |
| Indexed tensor size | 892,727,580,904 bytes | model.safetensors.index.json |
| Transformer layers | 61 (indices 0–60) | tensor names in index |
| MTP layers | 3 (mtp.0, mtp.1, mtp.2) |
tensor names in index |
| Hidden size | 7,168 | config.json |
| Routed experts | 384, with 6 activated per token + 1 shared expert | config.json |
| Vocabulary | 129,280 | config.json |
| Max position embeddings | 1,048,576 | config.json |
| Declared dtype | bfloat16 |
config.json |
| Weight quantization | FP8 e4m3, block size 128×128, scale_fmt: ue8m0 |
config.json |
| Expert storage | expert_dtype: fp4 (float4_e2m1fn_x2, packed) |
config.json + inference/model.py |
| Shards | 66 SafeTensors files | repository file listing |
| Indexed tensors | 149,782 | model.safetensors.index.json |
| License | MIT, Copyright (c) 2023 DeepSeek | LICENSE |
Note on the parameter count
The two figures above are consistent, not contradictory:
- 1,650,497,936,906 is the count published by Hugging Face for this repository. It includes
the weight-bearing parameters plus the 3 routing tables (
ffn.gate.tid2eid, 6 entries per token, 129,280 × 6 × 3), and excludes the quantization-scale tensors. - Independently recomputing from the headers of all 66 shards reproduces exactly this number,
after accounting for the fact that expert tensors are stored FP4-packed: a tensor stored
with shape
[3072, 3584]holds3072 × 7168logical FP4 values.
The audit confirms 149,782 tensors in the shards, matching the index exactly.
Capabilities
Available now
These capabilities follow from the audited configuration of the model in this repository. They describe what the architecture is configured to do.
- Advanced reasoning, including a dedicated reasoning/thinking mode in the tokenizer and encoding layer.
- Software engineering and code generation at large context length.
- Mathematics and technical analysis.
- Long-context understanding up to 1,048,576 tokens.
- Mixture-of-experts inference with 384 routed experts (6 activated per token).
- Agentic and tool-calling conversation formats, implemented in
encoding/. - Multi-token prediction (MTP) heads, as used by the speculative decoding path.
Verified by execution in this audit
Two things were actually run against this repository's files, on CPU, without downloading the weights:
encoding/test suite: 4/4 passed —thinking with tools,thinking without tools,interleaved thinking + search,quick instruction task. These validate message encoding and completion parsing in pure Python.- Tokenizer load and round-trip: passed —
tokenizer.jsonloads with the tokenizers library, reports a vocabulary of 129,280, anddef hello(): return 42encodes and decodes back identically.
Not verified in this audit
Stated plainly, because it matters more than a green checkmark:
- End-to-end model loading was not executed. The checkpoint is ~893 GB; this audit ran on
4 CPU cores, ~15 GiB RAM, no GPU (
nvidia-smiabsent, no/dev/nvidia*device). A fullfrom_pretrainedload was therefore physically impossible here, and no inference output was produced. - No benchmark result in this README was measured by us. Performance figures belong to the upstream project and are linked, not reproduced.
- The
.safetensorspayload hashes were not recomputed byte-by-byte. The repository is served through Xet storage, whose resolve URLs do not support HTTP range reads in the way required for a streaming SHA-256. Integrity was instead established at the hub-storage level: all 67 LFS objects in this repository carry a SHA-256 identical to the upstream source (67/67 match), and the index file hash matches exactly.
CORTEX ecosystem roadmap
The following are intended directions of the CORTEX ecosystem. They are not claimed as implemented by this repository.
- Agent-based task execution and tool orchestration through CORTEX Engine.
- CORTEX IDE integration for AI-native development.
- CORTEX Cloud workflows for assisted cloud development.
Architecture
Repository layout
Cortex-ai
├── Model
│ └── config.json architecture, quantisation, MoE and MTP parameters
├── Weights
│ ├── model-00001..00066 ... .safetensors 66 shards, 149,782 tensors
│ └── model.safetensors.index.json tensor -> shard mapping
├── Tokenizer
│ ├── tokenizer.json BPE, 128,000 vocab + 1,283 added tokens
│ └── tokenizer_config.json PreTrainedTokenizerFast
├── Inference
│ ├── model.py reference model, FP8/FP4 kernels
│ ├── kernel.py GEMM / attention / quantisation kernels
│ ├── generate.py distributed generation entrypoint
│ ├── convert.py checkpoint conversion
│ └── requirements.txt reference dependencies
├── CORTEX adaptation
│ ├── cortex_ai/identity.py project identity and provenance-safe prompt helper
│ ├── cortex_ai/vision/core.py vision encoder/projector/fusion interfaces
│ ├── cortex_ai/vision/config.json explicit experimental status and missing components
│ └── tests/test_cortex_architecture.py identity and adapter-path tests
├── Encoding
│ ├── encoding_dsv4.py chat template encode / parse
│ └── tests/ 4 test cases with fixtures
└── LICENSE MIT, Copyright (c) 2023 DeepSeek
Model structure
Input tokens
│
├─ embed.weight [129280, 7168] BF16
│
├─ layers 0 .. 60 61 transformer layers
│ ├─ attn.* FP8 (F8_E4M3) attention projections
│ ├─ ffn.experts.* FP4-packed MoE experts (384 per layer)
│ ├─ ffn.shared_experts.* 1 shared expert per layer, FP8
│ └─ ffn.gate.tid2eid token -> expert routing table (int64)
│
├─ mtp.0 / mtp.1 / mtp.2 3 multi-token-prediction layers
│ └─ mtp.2.markov_head speculative decoding head
│
└─ head.weight [129280, 7168] BF16 (tie_word_embeddings: false)
Layer 0 additionally carries a compressed-attention branch
(attn.compressor.*) and hyper-connection parameters (hc_attn_base, hc_attn_fn).
Quantization layout
| Component | Stored dtype | Block size | Notes |
|---|---|---|---|
| Attention projections | F8_E4M3 |
128×128 | weights; F8_E8M0 scales stored alongside |
| Shared experts | F8_E4M3 |
128×128 | one shared expert per layer |
| Routed experts | I8 (FP4 packed) |
32 | 2 logical FP4 values per byte; F8_E8M0 scales |
| Norms, embeddings, head | BF16 |
— | full precision |
| Routing tables | I64 |
— | token-to-expert ids |
The FP4 packing is confirmed by the reference implementation: inference/model.py declares
self.weight = nn.Parameter(torch.empty(out_features, in_features // 2, dtype=torch.float4_e2m1fn_x2))
with fp4_block_size = 32.
Future CORTEX ecosystem architecture
CORTEX AI ── intelligence engine and model distribution
│
CORTEX Engine ── orchestration, agents, tasks, runtimes
│
Agents / Reasoning / Tools
│
CORTEX IDE ── AI-native development environment
│
CORTEX Cloud ── assisted cloud development
This is an integration vision, not a description of files present in this repository today.
Model details
| Field | Value |
|---|---|
| Repository | Frankenstein-Labs/Cortex-ai |
| Upstream model | deepseek-ai/DeepSeek-V4-Pro-0813 |
| Architecture class | DeepseekV4ForCausalLM |
| Parameters (HF metadata) | 1,650,497,936,906 |
| Hidden layers | 61 |
| MTP layers | 3 |
| Hidden size | 7,168 |
| Attention heads | 128 |
| Head dim | 512, RoPE head dim 64 |
| KV LoRA rank | 1,536 |
| Routed experts | 384 |
| Experts per token | 6 |
| Shared experts | 1 |
| MoE intermediate size | 3,072 |
| Scoring function | sqrtsoftplus |
| Sliding window | 128 |
| Vocabulary size | 129,280 |
| Max position embeddings | 1,048,576 |
| RoPE | YaRN, factor 16, original max 65,536 |
| Quantization | FP8 e4m3, block 128×128, ue8m0 scales |
| Expert storage | FP4 (expert_dtype: fp4) |
| Declared dtype | bfloat16 |
| Weight format | SafeTensors, 66 shards |
| Tie word embeddings | false |
| Tokenizer | PreTrainedTokenizerFast, BPE |
| Pipeline tag | text-generation |
| License | MIT |
The 3 MTP layers add 79,876,654,887 parameters. Excluding the model card itself, the repository payload is 892,762,490,337 bytes across 91 files; the full repository total is 892,762,493,303 bytes across 92 files.
Installation
Fetch this repository with the Hugging Face tooling (recommended for very large checkpoints):
pip install -U "huggingface_hub[hf_xet]"
hf download Frankenstein-Labs/Cortex-ai
Or, for a specific subset such as the configuration and tokenizer only:
hf download Frankenstein-Labs/Cortex-ai --include "*.json" "LICENSE"
A plain git clone also works but materialises all 892 GB of LFS objects.
The reference inference path in inference/ declares:
pip install -r inference/requirements.txt
which specifies torch>=2.10.0, transformers>=5.0.0, safetensors>=0.7.0,
fast_hadamard_transform and tilelang==0.1.8.
Usage
Calling the identifier
Use the CORTEX AI repository id wherever a model path is expected:
Frankenstein-Labs/Cortex-ai
Transformers
This repository ships a Transformers-compatible config.json and tokenizer, and the Hub
registers it with library_name: transformers. It was not loaded end-to-end during this audit
(no GPU, 15 GiB RAM, 893 GB checkpoint), so the snippet below is provided as the standard
loading path rather than as a reproduced result:
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Frankenstein-Labs/Cortex-ai"
tokenizer = AutoTokenizer.from_pretrained(model_id)
# The architecture requires recent Transformers support for deepseek_v4, and
# enough aggregate accelerator memory to hold a ~1.65T-parameter FP8/FP4 checkpoint.
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
Confirm that your installed Transformers version implements deepseek_v4 before attempting a
full load. See Requirements for sizing guidance.
Chat encoding
The encoding/ module is self-contained pure Python and was verified working in this audit:
from encoding_dsv4 import encode_messages, parse_message_from_completion_text
messages = [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is 2+2?"},
]
prompt = encode_messages(messages, thinking_mode="thinking")
completion = "Simple arithmetic.2 + 2 = 4."
parsed = parse_message_from_completion_text(completion, thinking_mode="thinking")
# => {"role": "assistant", "reasoning_content": "Simple arithmetic.",
# "content": "2 + 2 = 4.", "tool_calls": []}
Multi-token prediction / speculative decoding
The checkpoint carries MTP layers and a DSpark speculative decoding module (dspark_block_size,
dspark_target_layer_ids in config.json; mtp.2.markov_head in the weights). The launch flags
below are reproduced from the upstream documentation and were not executed here:
# vLLM
vllm serve Frankenstein-Labs/Cortex-ai \
--trust-remote-code --kv-cache-dtype fp8 --block-size 256 \
--data-parallel-size 4 --enable-expert-parallel \
--moe-backend deep_gemm_mega_moe \
--attention-config '{"use_fp4_indexer_cache": true}' \
--speculative-config '{"method":"dspark","num_speculative_tokens":7,"draft_sample_method":"greedy"}'
# SGLang
sglang serve \
--trust-remote-code \
--model-path Frankenstein-Labs/Cortex-ai \
--tp 4 \
--moe-runner-backend flashinfer_mxfp4 \
--speculative-algorithm DSPARK \
--mem-fraction-static 0.90 \
--chunked-prefill-size 4096 \
--swa-full-tokens-ratio 0.1
Compatibility depends on your installed release, driver stack and hardware. Consult the upstream vLLM recipe and the SGLang cookbook.
Included reference inference path
inference/ is a conversion-and-distributed-generation workflow, not a single-process script.
It requires a compatible multi-GPU environment:
cd inference
export EXPERTS=256
export MP=4
export CONFIG=config.json
python convert.py --hf-ckpt-path /path/to/Cortex-ai \
--save-path /path/to/converted-checkpoint \
--n-experts "$EXPERTS" --model-parallel "$MP"
torchrun --nproc-per-node "$MP" generate.py \
--ckpt-path /path/to/converted-checkpoint --config "$CONFIG" --interactive
To keep experts in FP8 instead of FP4, remove "expert_dtype": "fp4" from config.json and
pass --expert-dtype fp8 to convert.py.
Requirements
Sizing guidance for teams planning a deployment. These are practical notes, not a guarantee for any specific hardware configuration.
| Item | Value |
|---|---|
| Checkpoint on disk | ~892.8 GB |
| Declared dtype | bfloat16 |
| Weight quantization | FP8 for most weights, FP4 for routed experts |
| Reference CUDA stack | torch>=2.10.0, transformers>=5.0.0 |
| Reference kernels | tilelang==0.1.8, fast_hadamard_transform |
| Upstream reference deployment | 4× GB300 node (see upstream docs) |
The upstream project states that the model is intended for deployment on recent high-memory accelerators. Plan for multi-GPU or multi-node serving; a single-GPU deployment is not a documented configuration.
Native fusion prototype status
A real tensor-level native fusion prototype is now implemented in cortex_ai/vision/native.py:
IMAGE → VISION ENCODER → IMAGE EMBEDDINGS → PROJECTOR
→ PREFIX MULTIMODAL FUSION → inputs_embeds → LANGUAGE CORE
NativeVisionFusion executes this path with any compatible language core that exposes
get_input_embeddings() and accepts inputs_embeds. A minimal test core verifies the actual
embedding shapes, prefix concatenation and attention mask. This is a functional prototype, not
a claim that the 1.65T DeepSeek-V4 checkpoint is already natively multimodal: that checkpoint has
not been modified, and its runtime compatibility with this path remains unverified until a suitable
full inference environment is available. The BLIP caption bridge remains the functional fallback.
First executable vision path
The first operational step is now available through cortex_ai.vision.bridge. It uses an
external, explicitly selected Hugging Face image-to-text model to produce a caption, then builds a
grounded text context that can be passed to the existing CORTEX text inference path:
IMAGE
↓
Salesforce/blip-image-captioning-base
↓
VisionObservation
↓
[CORTEX VISION OBSERVATION] grounded text context
↓
Existing CORTEX text model
Run it with:
pip install -r inference/requirements.txt
python examples/vision_bridge.py /path/to/image.jpg "What is visible?"
For the distributed text inference entrypoint, the same bridge can be used in batch mode with
--vision-image /path/to/image.jpg; the generated observation is prepended to each prompt in the
input file. Interactive native image-token fusion is not claimed by this option.
The bridge is a real image execution path, but it is not native image-token fusion into the DeepSeek-V4 core. The captioner is a separate model with separate weights, downloaded only when first used. Its output is treated as an observation and the text model is instructed to report when that observation is insufficient. This avoids modifying or pretending to extend the existing checkpoint. The selected BLIP model and pipeline pattern follow the official Hugging Face image-to-text documentation and BLIP model documentation.
Vision architecture status
The repository now includes a modular, experimental adaptation layer under cortex_ai/vision/:
IMAGE
↓
IMAGE PROCESSOR (external, not bundled)
↓
VISION ENCODER (external, not bundled)
↓
VISION PROJECTOR / ADAPTER
↓
MULTIMODAL FUSION (reference prefix fusion)
↓
CORTEX AI CORE
↓
REASONING
↓
TEXT RESPONSE
Vision architecture: experimental / in development. The adapter, projector, multimodal
representation and reference fusion path execute with a supplied encoder, and are covered by
tests. The current DeepSeek-V4 core is not modified to consume image embeddings, and no vision
encoder, processor, projector weights or multimodal fine-tuning data are included. Therefore this
repository must not be described as an image-understanding model yet. Making image understanding
operational requires selecting and licensing an image encoder, training or supplying compatible
projector weights, implementing the core inputs_embeds/fusion path, and validating the complete
image-to-response pipeline on suitable hardware.
The identity helper in cortex_ai/identity.py provides the canonical creator response:
“J'ai été créé et développé par Abdoulaye Coumbassa, fondateur de Frankenstein-Labs.” It is wired
as a system context in the reference interactive inference entrypoint. This concerns the CORTEX AI
project; it does not claim that the upstream base model was trained from scratch by Frankenstein-Labs.
The CORTEX Ecosystem
CORTEX AI — the intelligence engine, and the model distribution surface. This repository is its current implementation: the model, its configuration, tokenizer, encoding utilities and reference inference code.
CORTEX Engine — the orchestration layer for agents, reasoning, tasks, tools and runtimes. Planned.
CORTEX IDE — the development environment for AI-native software work. Planned.
CORTEX Cloud — the cloud development environment assisted by CORTEX intelligence. Planned.
These components are designed to work together progressively. Only CORTEX AI exists as a published artefact today; the remaining components are direction, not delivered software.
Vision
Build an AI-native development ecosystem where intelligence, agents, execution environments and software development work together as one system.
CORTEX is oriented toward a development workflow in which model intelligence connects to reasoning, tools, execution environments and developer interfaces. The project's guiding rule is to stay explicit about what is available, what is experimental and what remains on the roadmap.
Created by Abdoulaye Coumbassa
CORTEX AI was created and is developed by Abdoulaye Coumbassa, founder of Frankenstein-Labs. He works on AI, developer tools and software systems.
This section intentionally makes no further claims — no biography, credentials, funding or awards are asserted here.
Provenance, license and attribution
This repository is a distribution of an upstream model, not a newly trained model. The CORTEX AI identity applies to the project, its documentation and its ecosystem integration. It does not replace the upstream attribution.
| Item | Verified information |
|---|---|
| Original model | DeepSeek-V4-Pro-0813 |
| Upstream architecture | DeepseekV4ForCausalLM (model_type: deepseek_v4) |
| Upstream author | DeepSeek AI |
| License | MIT — Copyright (c) 2023 DeepSeek |
| License file | LICENSE, reproduced unchanged |
| Technical report | DeepSeek-V4: Towards Highly Efficient Million-Token Context Intelligence, DeepSeek-AI, 2026 |
| Upstream vLLM recipe | recipes.vllm.ai |
| Upstream SGLang cookbook | docs.sglang.io |
Attribution statement
The model weights in this repository originate from DeepSeek AI. Frankenstein-Labs has not trained, fine-tuned, quantized, altered or re-evaluated them. All model design, training and evaluation credit belongs to DeepSeek AI and the DeepSeek-V4 authors.
The MIT license text and its original copyright notice are retained in LICENSE.
Nothing in this repository grants rights beyond those of that license.
Integrity of the distributed weights
The audited evidence that this is a faithful redistribution:
- All 67 LFS objects in this repository carry a SHA-256 identical to the upstream source (67/67 match).
model.safetensors.index.jsonhas the same hash as upstream (2de2ac1e43134f8b…).- 66/66 shards and all 149,782 indexed tensors are present, with no missing and no extra files.
LICENSEis byte-identical to upstream (1,084 bytes).
The upstream README.md is intentionally not duplicated here. The upstream model card,
benchmarks and reference commands remain available at the source repository linked above; this
document references it rather than restating its results as our own.
Citation
Please cite the upstream work:
@misc{deepseekai2026deepseekv4,
title={DeepSeek-V4: Towards Highly Efficient Million-Token Context Intelligence},
author={DeepSeek-AI},
year={2026},
}
Repository integrity statement
This README is documentation only. It does not modify or delete any .safetensors file,
model.safetensors.index.json, tokenizer file, configuration file, encoding/ file,
inference/ file or the license. The weight payload of this repository is byte-for-byte the
upstream checkpoint, as shown above.
Disclaimer
This checkpoint is extremely large and requires specialised hardware and software support. Validate the runtime, accelerator memory, driver stack and license obligations before deploying it.
Original model attribution
Copyright © 2023 DeepSeek. Original model design, training, evaluation and weights are attributed to DeepSeek AI. The original model reference is retained here.
- Downloads last month
- 639