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 tests/test_tools.py from Frankenstein-Labs/cortex.6.sol: direct link, hf CLI and curl.
- Browser
- Download file 3.57 kB
-
https://huggingface.co/Frankenstein-Labs/cortex.6.sol/resolve/main/tests/test_tools.py
- Command line
-
hf download hf://Frankenstein-Labs/cortex.6.sol/tests/test_tools.py
-
curl -L -o test_tools.py https://huggingface.co/Frankenstein-Labs/cortex.6.sol/resolve/main/tests/test_tools.py
3.57 kB
| """Tests for the tool registry.""" | |
| import pytest | |
| from cortex_ai.tools import ToolError, ToolRegistry, default_registry, registry_from_names, tool | |
| def test_default_registry_exposes_expected_tools(): | |
| reg = default_registry() | |
| assert set(reg.names()) == {"calculate", "cortex_identity", "current_time", "text_stats"} | |
| assert len(reg) == 4 | |
| def test_openai_schema_shape(): | |
| reg = default_registry() | |
| schemas = {s["function"]["name"]: s for s in reg.to_openai_schemas()} | |
| calc = schemas["calculate"] | |
| assert calc["type"] == "function" | |
| assert calc["function"]["parameters"]["type"] == "object" | |
| assert calc["function"]["parameters"]["properties"]["expression"]["type"] == "string" | |
| assert calc["function"]["parameters"]["required"] == ["expression"] | |
| def test_calculate_returns_the_right_value(): | |
| reg = default_registry() | |
| assert reg.call("calculate", {"expression": "2*(3+4)"}) == "14" | |
| assert reg.call("calculate", {"expression": "10/4"}) == "2.5" | |
| def test_calculate_rejects_non_arithmetic_input(): | |
| reg = default_registry() | |
| # A rejected expression surfaces as an ERROR string, not an exception: the | |
| # model must be able to read the failure and react to it. | |
| assert reg.call("calculate", {"expression": "__import__('os')"}).startswith("ERROR:") | |
| assert reg.call("calculate", {"expression": "9**9**9"}).startswith("ERROR:") | |
| assert "exponentiation" in reg.call("calculate", {"expression": "9**9**9"}) | |
| assert reg.call("calculate", {"expression": "1/0"}).startswith("ERROR:") | |
| def test_calculate_rejects_oversized_input(): | |
| reg = default_registry() | |
| assert reg.call("calculate", {"expression": "1+" * 200 + "1"}).startswith("ERROR:") | |
| def test_arguments_may_be_a_json_string(): | |
| reg = default_registry() | |
| assert reg.call("calculate", '{"expression": "3+4"}') == "7" | |
| def test_unknown_tool_raises(): | |
| reg = default_registry() | |
| with pytest.raises(ToolError, match="unknown tool"): | |
| reg.call("does_not_exist", {}) | |
| def test_missing_required_argument_raises(): | |
| reg = default_registry() | |
| with pytest.raises(ToolError, match="missing required argument"): | |
| reg.call("calculate", {}) | |
| def test_unknown_argument_raises(): | |
| reg = default_registry() | |
| with pytest.raises(ToolError, match="unknown argument"): | |
| reg.call("calculate", {"expression": "1+1", "bogus": 1}) | |
| def test_invalid_json_arguments_raise(): | |
| reg = default_registry() | |
| with pytest.raises(ToolError, match="not valid JSON"): | |
| reg.call("calculate", "{not json") | |
| def test_registry_from_names_restricts_and_orders(): | |
| reg = registry_from_names(["text_stats", "calculate"]) | |
| assert reg.names() == ["calculate", "text_stats"] | |
| def test_registry_from_empty_names_returns_everything(): | |
| assert len(registry_from_names([])) == 4 | |
| def test_cortex_identity_tool_reports_project_attribution(): | |
| from cortex_ai.identity import IDENTITY_STATEMENT | |
| assert default_registry().call("cortex_identity", {}) == IDENTITY_STATEMENT | |
| def test_custom_tool_via_decorator(): | |
| def ajouter(a: int, b: int) -> str: | |
| return str(a + b) | |
| reg = ToolRegistry([ajouter]) | |
| assert reg.names() == ["ajouter"] | |
| assert reg.call("ajouter", {"a": 2, "b": 3}) == "5" | |
| assert reg.to_openai_schemas()[0]["function"]["parameters"]["required"] == ["a", "b"] | |
| def test_tool_returning_a_dict_is_json_encoded(): | |
| reg = default_registry() | |
| out = reg.call("text_stats", {"text": "un deux trois"}) | |
| assert '"mots": 3' in out | |