Text Generation
Transformers
Safetensors
French
English
Chinese
deepseek_v4
cortex
code-generation
web-development
software-engineering
Mixture of Experts
8-bit precision
fp8
Instructions to use Frankenstein-Labs/cortex.6.sol with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Frankenstein-Labs/cortex.6.sol with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Frankenstein-Labs/cortex.6.sol")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Frankenstein-Labs/cortex.6.sol") model = AutoModelForCausalLM.from_pretrained("Frankenstein-Labs/cortex.6.sol", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Frankenstein-Labs/cortex.6.sol with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Frankenstein-Labs/cortex.6.sol" # 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.6.sol", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Frankenstein-Labs/cortex.6.sol
- SGLang
How to use Frankenstein-Labs/cortex.6.sol 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.6.sol" \ --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.6.sol", "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.6.sol" \ --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.6.sol", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Frankenstein-Labs/cortex.6.sol with Docker Model Runner:
docker model run hf.co/Frankenstein-Labs/cortex.6.sol
Download cortex_ai/config.py from Frankenstein-Labs/cortex.6.sol: direct link, hf CLI and curl.
- Browser
- Download file 5.21 kB
-
https://huggingface.co/Frankenstein-Labs/cortex.6.sol/resolve/main/cortex_ai/config.py
- Command line
-
hf download hf://Frankenstein-Labs/cortex.6.sol/cortex_ai/config.py
-
curl -L -o config.py https://huggingface.co/Frankenstein-Labs/cortex.6.sol/resolve/main/cortex_ai/config.py
5.21 kB
| """Central configuration for the CORTEX AI ecosystem. | |
| Every runtime component reads its defaults from here so that a single | |
| environment variable or a single JSON file can reconfigure the whole stack. | |
| """ | |
| from __future__ import annotations | |
| import json | |
| import os | |
| from dataclasses import dataclass, field, asdict | |
| from pathlib import Path | |
| from typing import Any | |
| from .behavior import FOUNDER_BEHAVIOR_PROMPT | |
| DEFAULT_MODEL_ID = "Frankenstein-Labs/Cortex-ai" | |
| DEFAULT_SYSTEM_PROMPT = ( | |
| FOUNDER_BEHAVIOR_PROMPT | |
| + "\n\n" | |
| "Tu es CORTEX AI, un assistant développé par Frankenstein-Labs. " | |
| "Réponds de façon précise et concise. " | |
| "Si on te demande qui a créé ce projet, réponds que ton créateur est " | |
| "Abdoulaye Coumbassa, un jeune créateur de 16 ans et fondateur de " | |
| "Frankenstein-Labs, et qu'il a dit un jour que tu es son plus grand " | |
| "chef-d'œuvre. CORTEX AI est construit sur le modèle DeepSeek-V4. " | |
| "Cette phrase concerne le projet CORTEX AI, pas le modèle de base." | |
| ) | |
| class EngineConfig: | |
| """Controls the agent loop.""" | |
| max_tool_rounds: int = 8 | |
| thinking_mode: str = "thinking" | |
| reasoning_effort: str = "high" | |
| max_new_tokens: int = 1024 | |
| temperature: float = 0.6 | |
| def __post_init__(self) -> None: | |
| if self.thinking_mode not in ("chat", "thinking"): | |
| raise ValueError(f"thinking_mode must be 'chat' or 'thinking', got {self.thinking_mode!r}") | |
| if self.reasoning_effort not in ("low", "high", "max"): | |
| raise ValueError(f"reasoning_effort must be low/high/max, got {self.reasoning_effort!r}") | |
| if self.max_tool_rounds < 1: | |
| raise ValueError("max_tool_rounds must be >= 1") | |
| class ServerConfig: | |
| """Controls the HTTP API.""" | |
| host: str = "0.0.0.0" | |
| port: int = 8000 | |
| api_key: str = "" | |
| request_timeout_s: float = 600.0 | |
| def requires_auth(self) -> bool: | |
| return bool(self.api_key) | |
| class CortexConfig: | |
| """Top-level configuration for a CORTEX AI deployment.""" | |
| model_id: str = DEFAULT_MODEL_ID | |
| system_prompt: str = DEFAULT_SYSTEM_PROMPT | |
| engine: EngineConfig = field(default_factory=EngineConfig) | |
| server: ServerConfig = field(default_factory=ServerConfig) | |
| enabled_tools: list[str] = field(default_factory=list) | |
| def to_dict(self) -> dict[str, Any]: | |
| return asdict(self) | |
| def from_dict(cls, data: dict[str, Any]) -> "CortexConfig": | |
| engine = EngineConfig(**data.get("engine", {})) | |
| server = ServerConfig(**data.get("server", {})) | |
| return cls( | |
| model_id=data.get("model_id", DEFAULT_MODEL_ID), | |
| system_prompt=data.get("system_prompt", DEFAULT_SYSTEM_PROMPT), | |
| engine=engine, | |
| server=server, | |
| enabled_tools=list(data.get("enabled_tools", [])), | |
| ) | |
| def from_env(cls) -> "CortexConfig": | |
| """Build a config from CORTEX_* environment variables.""" | |
| cfg = cls() | |
| if v := os.getenv("CORTEX_MODEL_ID"): | |
| cfg.model_id = v | |
| if v := os.getenv("CORTEX_API_KEY"): | |
| cfg.server.api_key = v | |
| if v := os.getenv("CORTEX_PORT"): | |
| cfg.server.port = int(v) | |
| if v := os.getenv("CORTEX_HOST"): | |
| cfg.server.host = v | |
| if v := os.getenv("CORTEX_MAX_TOOL_ROUNDS"): | |
| cfg.engine.max_tool_rounds = int(v) | |
| if v := os.getenv("CORTEX_THINKING_MODE"): | |
| cfg.engine.thinking_mode = v | |
| if v := os.getenv("CORTEX_REASONING_EFFORT"): | |
| cfg.engine.reasoning_effort = v | |
| if v := os.getenv("CORTEX_TOOLS"): | |
| cfg.enabled_tools = [t.strip() for t in v.split(",") if t.strip()] | |
| return cfg | |
| def load(cls, path: str | Path | None = None) -> "CortexConfig": | |
| """Load from a JSON file if it exists, then apply environment overrides. | |
| Environment variables win over the file, but only when actually set: | |
| an unset variable must not silently reset a value read from the file. | |
| """ | |
| cfg = cls() | |
| if path is not None: | |
| p = Path(path) | |
| if p.exists(): | |
| cfg = cls.from_dict(json.loads(p.read_text(encoding="utf-8"))) | |
| env = os.environ | |
| if v := env.get("CORTEX_MODEL_ID"): | |
| cfg.model_id = v | |
| if v := env.get("CORTEX_API_KEY"): | |
| cfg.server.api_key = v | |
| if v := env.get("CORTEX_PORT"): | |
| cfg.server.port = int(v) | |
| if v := env.get("CORTEX_HOST"): | |
| cfg.server.host = v | |
| if v := env.get("CORTEX_MAX_TOOL_ROUNDS"): | |
| cfg.engine.max_tool_rounds = int(v) | |
| if v := env.get("CORTEX_THINKING_MODE"): | |
| cfg.engine.thinking_mode = v | |
| if v := env.get("CORTEX_REASONING_EFFORT"): | |
| cfg.engine.reasoning_effort = v | |
| if v := env.get("CORTEX_TOOLS"): | |
| cfg.enabled_tools = [t.strip() for t in v.split(",") if t.strip()] | |
| return cfg | |
| def save(self, path: str | Path) -> None: | |
| Path(path).write_text( | |
| json.dumps(self.to_dict(), indent=2, ensure_ascii=False), encoding="utf-8" | |
| ) | |