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 to Chat Template for .items() collision w/ user dicts.
#8
by Bennybo - opened
- chat_template.jinja +6 -4
chat_template.jinja
CHANGED
|
@@ -18,7 +18,8 @@
|
|
| 18 |
{%- endif %}
|
| 19 |
{{- '<tool_call>\n<function=' + (tool_call.name | default('') | string) + '>\n' }}
|
| 20 |
{%- if tool_call.arguments is defined and tool_call.arguments is mapping %}
|
| 21 |
-
{%- for args_name
|
|
|
|
| 22 |
{{- '<parameter=' + (args_name | string) + '>\n' }}
|
| 23 |
{%- if args_value is mapping or (args_value is sequence and args_value is not string) %}
|
| 24 |
{{- args_value | tojson | safe }}
|
|
@@ -62,8 +63,9 @@
|
|
| 62 |
{{- '\n<description>' ~ (tool.description | string | trim) ~ '</description>' }}
|
| 63 |
{%- endif %}
|
| 64 |
{{- '\n<parameters>' }}
|
| 65 |
-
{%- if tool.parameters is defined and tool.parameters is mapping and tool.parameters
|
| 66 |
-
{%- for param_name
|
|
|
|
| 67 |
{{- '\n<parameter>\n<name>' ~ (param_name | string) ~ '</name>' }}
|
| 68 |
{%- if param_fields is mapping and param_fields.type is defined and param_fields.type is not none %}
|
| 69 |
{{- '\n<type>' ~ (param_fields.type | string) ~ '</type>' }}
|
|
@@ -156,4 +158,4 @@
|
|
| 156 |
|
| 157 |
{%- if add_generation_prompt %}
|
| 158 |
{{- '<|im_start|>assistant\n<think>' }}
|
| 159 |
-
{%- endif %}
|
|
|
|
| 18 |
{%- endif %}
|
| 19 |
{{- '<tool_call>\n<function=' + (tool_call.name | default('') | string) + '>\n' }}
|
| 20 |
{%- if tool_call.arguments is defined and tool_call.arguments is mapping %}
|
| 21 |
+
{%- for args_name in tool_call.arguments %}
|
| 22 |
+
{%- set args_value = tool_call.arguments[args_name] %}
|
| 23 |
{{- '<parameter=' + (args_name | string) + '>\n' }}
|
| 24 |
{%- if args_value is mapping or (args_value is sequence and args_value is not string) %}
|
| 25 |
{{- args_value | tojson | safe }}
|
|
|
|
| 63 |
{{- '\n<description>' ~ (tool.description | string | trim) ~ '</description>' }}
|
| 64 |
{%- endif %}
|
| 65 |
{{- '\n<parameters>' }}
|
| 66 |
+
{%- if tool.parameters is defined and tool.parameters is mapping and 'properties' in tool.parameters and tool.parameters['properties'] is mapping %}
|
| 67 |
+
{%- for param_name in tool.parameters['properties'] %}
|
| 68 |
+
{%- set param_fields = tool.parameters['properties'][param_name] %}
|
| 69 |
{{- '\n<parameter>\n<name>' ~ (param_name | string) ~ '</name>' }}
|
| 70 |
{%- if param_fields is mapping and param_fields.type is defined and param_fields.type is not none %}
|
| 71 |
{{- '\n<type>' ~ (param_fields.type | string) ~ '</type>' }}
|
|
|
|
| 158 |
|
| 159 |
{%- if add_generation_prompt %}
|
| 160 |
{{- '<|im_start|>assistant\n<think>' }}
|
| 161 |
+
{%- endif %}
|