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-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
Download examples/cortex_chat.py from Frankenstein-Labs/Cortex-ai: direct link, hf CLI and curl.
- Browser
- Download file 1.45 kB
-
https://huggingface.co/Frankenstein-Labs/Cortex-ai/resolve/main/examples/cortex_chat.py
- Command line
-
hf download hf://Frankenstein-Labs/Cortex-ai/examples/cortex_chat.py
-
curl -L -o cortex_chat.py https://huggingface.co/Frankenstein-Labs/Cortex-ai/resolve/main/examples/cortex_chat.py
1.45 kB
| #!/usr/bin/env python3 | |
| """Exemple : appeler CORTEX AI en local, sans serveur HTTP. | |
| PYTHONPATH=/workspace/project:/workspace/project/encoding \ | |
| python3 examples/cortex_chat.py "Combien font 12 * 8 ?" | |
| Utilise l'adaptateur simule : aucune carte graphique, aucun telechargement. | |
| Pour utiliser le vrai modele, remplacez MockAdapter par HFAdapter et chargez-le. | |
| """ | |
| from __future__ import annotations | |
| import sys | |
| from cortex_ai.adapters import MockAdapter | |
| from cortex_ai.config import CortexConfig, EngineConfig | |
| from cortex_ai.engine import CortexAgent | |
| from cortex_ai.tools import default_registry | |
| def main(question: str) -> int: | |
| config = CortexConfig() | |
| agent = CortexAgent( | |
| MockAdapter(), | |
| default_registry(), | |
| EngineConfig(thinking_mode="thinking", reasoning_effort="high"), | |
| system_prompt=config.system_prompt, | |
| ) | |
| turn = agent.run([{"role": "user", "content": question}]) | |
| print(f"Question : {question}") | |
| print(f"Tours : {turn.rounds}") | |
| if turn.reasoning: | |
| print(f"Raisonnement : {turn.reasoning}") | |
| for call in turn.tool_calls: | |
| statut = "ok" if call.ok else "echec" | |
| print(f"Outil : {call.name}({call.arguments}) -> {call.result} [{statut}]") | |
| print(f"Reponse : {turn.content}") | |
| return 0 | |
| if __name__ == "__main__": | |
| question = " ".join(sys.argv[1:]) or "Combien font 12 * 8 ?" | |
| raise SystemExit(main(question)) | |