Text Generation
Transformers
Safetensors
afmoe
reasoning
agentic
tool-calling
thinking
conversational
custom_code
Eval Results
Instructions to use arcee-ai/Trinity-Large-Thinking with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use arcee-ai/Trinity-Large-Thinking with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="arcee-ai/Trinity-Large-Thinking", 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("arcee-ai/Trinity-Large-Thinking", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("arcee-ai/Trinity-Large-Thinking", 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use arcee-ai/Trinity-Large-Thinking with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "arcee-ai/Trinity-Large-Thinking" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "arcee-ai/Trinity-Large-Thinking", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/arcee-ai/Trinity-Large-Thinking
- SGLang
How to use arcee-ai/Trinity-Large-Thinking 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 "arcee-ai/Trinity-Large-Thinking" \ --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": "arcee-ai/Trinity-Large-Thinking", "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 "arcee-ai/Trinity-Large-Thinking" \ --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": "arcee-ai/Trinity-Large-Thinking", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use arcee-ai/Trinity-Large-Thinking with Docker Model Runner:
docker model run hf.co/arcee-ai/Trinity-Large-Thinking
Update chat_template.jinja
Browse files- chat_template.jinja +16 -5
chat_template.jinja
CHANGED
|
@@ -98,13 +98,24 @@
|
|
| 98 |
{%- if role == "assistant" %}
|
| 99 |
{%- set content_str = '' if message.content is none else (message.content | string) %}
|
| 100 |
{%- set trimmed_content = content_str | trim %}
|
|
|
|
| 101 |
{%- set has_reasoning_content = message.reasoning_content is defined %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
{%- set has_tool_calls = message.tool_calls is defined and message.tool_calls is iterable and message.tool_calls is not string and message.tool_calls | length > 0 %}
|
| 103 |
|
| 104 |
{{- '<|im_start|>assistant\n' }}
|
| 105 |
-
{%- if
|
| 106 |
-
{%- if
|
| 107 |
-
{{- '<think>' + (
|
| 108 |
{%- else %}
|
| 109 |
{{- '<think></think>' }}
|
| 110 |
{%- endif %}
|
|
@@ -121,7 +132,7 @@
|
|
| 121 |
|
| 122 |
{%- if has_tool_calls %}
|
| 123 |
{%- for tool_call in message.tool_calls %}
|
| 124 |
-
{%- set separator = '\n' if ((loop.first and (
|
| 125 |
{{- separator + render_tool_call(tool_call) }}
|
| 126 |
{%- endfor %}
|
| 127 |
{%- endif %}
|
|
@@ -145,4 +156,4 @@
|
|
| 145 |
|
| 146 |
{%- if add_generation_prompt %}
|
| 147 |
{{- '<|im_start|>assistant\n<think>' }}
|
| 148 |
-
{%- endif %}
|
|
|
|
| 98 |
{%- if role == "assistant" %}
|
| 99 |
{%- set content_str = '' if message.content is none else (message.content | string) %}
|
| 100 |
{%- set trimmed_content = content_str | trim %}
|
| 101 |
+
|
| 102 |
{%- set has_reasoning_content = message.reasoning_content is defined %}
|
| 103 |
+
{%- set has_reasoning = has_reasoning_content or (message.reasoning is defined) %}
|
| 104 |
+
|
| 105 |
+
{%- if has_reasoning_content %}
|
| 106 |
+
{%- set reasoning_value = message.reasoning_content %}
|
| 107 |
+
{%- elif message.reasoning is defined %}
|
| 108 |
+
{%- set reasoning_value = message.reasoning %}
|
| 109 |
+
{%- else %}
|
| 110 |
+
{%- set reasoning_value = none %}
|
| 111 |
+
{%- endif %}
|
| 112 |
+
|
| 113 |
{%- set has_tool_calls = message.tool_calls is defined and message.tool_calls is iterable and message.tool_calls is not string and message.tool_calls | length > 0 %}
|
| 114 |
|
| 115 |
{{- '<|im_start|>assistant\n' }}
|
| 116 |
+
{%- if has_reasoning %}
|
| 117 |
+
{%- if reasoning_value %}
|
| 118 |
+
{{- '<think>' + (reasoning_value | string | trim) + '</think>' }}
|
| 119 |
{%- else %}
|
| 120 |
{{- '<think></think>' }}
|
| 121 |
{%- endif %}
|
|
|
|
| 132 |
|
| 133 |
{%- if has_tool_calls %}
|
| 134 |
{%- for tool_call in message.tool_calls %}
|
| 135 |
+
{%- set separator = '\n' if ((loop.first and (has_reasoning or trimmed_content)) or (not loop.first)) else '' -%}
|
| 136 |
{{- separator + render_tool_call(tool_call) }}
|
| 137 |
{%- endfor %}
|
| 138 |
{%- endif %}
|
|
|
|
| 156 |
|
| 157 |
{%- if add_generation_prompt %}
|
| 158 |
{{- '<|im_start|>assistant\n<think>' }}
|
| 159 |
+
{%- endif %}
|