Instructions to use PrimeIntellect/INTELLECT-3-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PrimeIntellect/INTELLECT-3-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PrimeIntellect/INTELLECT-3-Base", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("PrimeIntellect/INTELLECT-3-Base", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("PrimeIntellect/INTELLECT-3-Base", trust_remote_code=True) 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use PrimeIntellect/INTELLECT-3-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PrimeIntellect/INTELLECT-3-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PrimeIntellect/INTELLECT-3-Base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/PrimeIntellect/INTELLECT-3-Base
- SGLang
How to use PrimeIntellect/INTELLECT-3-Base 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 "PrimeIntellect/INTELLECT-3-Base" \ --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": "PrimeIntellect/INTELLECT-3-Base", "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 "PrimeIntellect/INTELLECT-3-Base" \ --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": "PrimeIntellect/INTELLECT-3-Base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use PrimeIntellect/INTELLECT-3-Base with Docker Model Runner:
docker model run hf.co/PrimeIntellect/INTELLECT-3-Base
Remove fallback system prompt
Browse files- chat_template.jinja +7 -3
chat_template.jinja
CHANGED
|
@@ -26,8 +26,6 @@
|
|
| 26 |
{%- else %}
|
| 27 |
{%- if tools is iterable and tools | length > 0 %}
|
| 28 |
{{- "<|im_start|>system\nYou are INTELLECT-3, a helpful assistant developed by Prime Intellect, that can interact with a computer to solve tasks." }}
|
| 29 |
-
{%- else %}
|
| 30 |
-
{{- "<|im_start|>system\nYou are INTELLECT-3, a helpful assistant developed by Prime Intellect." }}
|
| 31 |
{%- endif %}
|
| 32 |
{%- endif %}
|
| 33 |
{%- if tools is iterable and tools | length > 0 %}
|
|
@@ -67,7 +65,13 @@
|
|
| 67 |
{{- "\n</tools>" }}
|
| 68 |
{{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
|
| 69 |
{%- endif %}
|
| 70 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
{%- for message in loop_messages %}
|
| 72 |
{%- if message.role == "assistant" and message.tool_calls is defined and message.tool_calls is iterable and message.tool_calls | length > 0 %}
|
| 73 |
{{- '<|im_start|>' + message.role }}
|
|
|
|
| 26 |
{%- else %}
|
| 27 |
{%- if tools is iterable and tools | length > 0 %}
|
| 28 |
{{- "<|im_start|>system\nYou are INTELLECT-3, a helpful assistant developed by Prime Intellect, that can interact with a computer to solve tasks." }}
|
|
|
|
|
|
|
| 29 |
{%- endif %}
|
| 30 |
{%- endif %}
|
| 31 |
{%- if tools is iterable and tools | length > 0 %}
|
|
|
|
| 65 |
{{- "\n</tools>" }}
|
| 66 |
{{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
|
| 67 |
{%- endif %}
|
| 68 |
+
{%- if system_message is defined %}
|
| 69 |
+
{{- '<|im_end|>\n' }}
|
| 70 |
+
{%- else %}
|
| 71 |
+
{%- if tools is iterable and tools | length > 0 %}
|
| 72 |
+
{{- '<|im_end|>\n' }}
|
| 73 |
+
{%- endif %}
|
| 74 |
+
{%- endif %}
|
| 75 |
{%- for message in loop_messages %}
|
| 76 |
{%- if message.role == "assistant" and message.tool_calls is defined and message.tool_calls is iterable and message.tool_calls | length > 0 %}
|
| 77 |
{{- '<|im_start|>' + message.role }}
|