Instructions to use mlx-community/Trinity-Large-Preview-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/Trinity-Large-Preview-8bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("mlx-community/Trinity-Large-Preview-8bit") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Transformers
How to use mlx-community/Trinity-Large-Preview-8bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mlx-community/Trinity-Large-Preview-8bit", 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("mlx-community/Trinity-Large-Preview-8bit", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("mlx-community/Trinity-Large-Preview-8bit", 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
- LM Studio
- vLLM
How to use mlx-community/Trinity-Large-Preview-8bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mlx-community/Trinity-Large-Preview-8bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlx-community/Trinity-Large-Preview-8bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mlx-community/Trinity-Large-Preview-8bit
- SGLang
How to use mlx-community/Trinity-Large-Preview-8bit 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 "mlx-community/Trinity-Large-Preview-8bit" \ --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": "mlx-community/Trinity-Large-Preview-8bit", "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 "mlx-community/Trinity-Large-Preview-8bit" \ --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": "mlx-community/Trinity-Large-Preview-8bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Pi new
How to use mlx-community/Trinity-Large-Preview-8bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "mlx-community/Trinity-Large-Preview-8bit"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "mlx-community/Trinity-Large-Preview-8bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use mlx-community/Trinity-Large-Preview-8bit with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "mlx-community/Trinity-Large-Preview-8bit"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default mlx-community/Trinity-Large-Preview-8bit
Run Hermes
hermes
- MLX LM
How to use mlx-community/Trinity-Large-Preview-8bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "mlx-community/Trinity-Large-Preview-8bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "mlx-community/Trinity-Large-Preview-8bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlx-community/Trinity-Large-Preview-8bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Docker Model Runner
How to use mlx-community/Trinity-Large-Preview-8bit with Docker Model Runner:
docker model run hf.co/mlx-community/Trinity-Large-Preview-8bit
Upload
Browse files- model-00041-of-00082.safetensors +3 -0
- model-00042-of-00082.safetensors +3 -0
- model-00043-of-00082.safetensors +3 -0
- model-00044-of-00082.safetensors +3 -0
- model-00045-of-00082.safetensors +3 -0
- model-00046-of-00082.safetensors +3 -0
- model-00047-of-00082.safetensors +3 -0
- model-00048-of-00082.safetensors +3 -0
- model-00049-of-00082.safetensors +3 -0
- model-00050-of-00082.safetensors +3 -0
- model-00051-of-00082.safetensors +3 -0
- model-00052-of-00082.safetensors +3 -0
- model-00053-of-00082.safetensors +3 -0
- model-00054-of-00082.safetensors +3 -0
- model-00055-of-00082.safetensors +3 -0
- model-00056-of-00082.safetensors +3 -0
- model-00057-of-00082.safetensors +3 -0
- model-00058-of-00082.safetensors +3 -0
- model-00059-of-00082.safetensors +3 -0
- model-00060-of-00082.safetensors +3 -0
- model-00061-of-00082.safetensors +3 -0
- model-00062-of-00082.safetensors +3 -0
- model-00063-of-00082.safetensors +3 -0
- model-00064-of-00082.safetensors +3 -0
- model-00065-of-00082.safetensors +3 -0
model-00041-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:10b82098941941b2f6b024b3b93db6397e8f899da685c24c23878e833c2ab103
|
| 3 |
+
size 5231621712
|
model-00042-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fbe4b2c9c3d96c2d1bd80471160a0eceee8a3643b5c9eae132159e73a723b1fe
|
| 3 |
+
size 5133828864
|
model-00043-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:88d8188aed115c2017ccc28cbe2923d9211c7c933b942598f50b7b32819b346e
|
| 3 |
+
size 5231621828
|
model-00044-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:341f8446305df5717877eb8fb508c03435295f873d6965f6e68e8265f320580f
|
| 3 |
+
size 5231621752
|
model-00045-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:15790e5e47bc76cf97cbeb9d2246e8799da5b5f8f463be62894f8f4791295a23
|
| 3 |
+
size 5133828866
|
model-00046-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:763f44af49a27350f066525ea6cdd4ae338bfe40edb414d2ddf9b24fcf582ce0
|
| 3 |
+
size 5231621830
|
model-00047-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a94a89d7655c67d0ae53b44c1b6f0e4700faa51b5a798b655707ea192e1ae918
|
| 3 |
+
size 5231621714
|
model-00048-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dd235a212a4436b665d8b60ffc5e44ae44b40b8ea37b2469241d09292aa95e6f
|
| 3 |
+
size 5133828866
|
model-00049-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:19d3c15a0836faa327f49fd7c77d4849e6884a8f27b96ebb33a43be016e4d48c
|
| 3 |
+
size 5231621834
|
model-00050-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a0e638ae0d4286f1e5c1805ae977a1133dd8747e0fa88d17a42cb8bd87912648
|
| 3 |
+
size 5231621684
|
model-00051-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f889cb738b8236b242ee568bb793fc90249e55164cf8412131741dfa59536b3d
|
| 3 |
+
size 5133828866
|
model-00052-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f11d6dfa7855216ac498dcc946def32da13c69e58ea77f84642d9e20e32df617
|
| 3 |
+
size 5231621802
|
model-00053-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4522ec71e4fd0947f1532875aefd1e8e54802d41a5df7e21f4636a73566b1db1
|
| 3 |
+
size 5231621690
|
model-00054-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8f12b397676d350019099f296f610518e089f235beb28e0eef26ee778fc6f570
|
| 3 |
+
size 5133828868
|
model-00055-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:00951da0e0ec28d62db9a837b0cc1bff4885e436c897d28960cbde9b5e93c82e
|
| 3 |
+
size 5231621824
|
model-00056-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e77be742c12bcfeba7ece0128deddee65bd96fbedfe02a105ef776735f9ff7fa
|
| 3 |
+
size 5231621742
|
model-00057-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3c678ebf7d8c8bd1dfefc8a8479619f95392f7728c3d6bc6134f75f8567463ca
|
| 3 |
+
size 5133828866
|
model-00058-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:15db7a71faad8ff268d8334b0f48189323de1349ee0738d9075a4a9d5f8a106c
|
| 3 |
+
size 5231621828
|
model-00059-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d53c9046495a5b7e611c364a67eb6108ecc5a7830bc7a6541c3d9249c3c9a99f
|
| 3 |
+
size 5231621680
|
model-00060-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2e102286f92b1a03796ac88dc891c5e36c698534a1f96a9187ecdc68be6805c2
|
| 3 |
+
size 5133828864
|
model-00061-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0f95878d731da79bd732fd9a5903ec896fba45121e956cb9c8408ff858eecbfc
|
| 3 |
+
size 5231621830
|
model-00062-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7d880ccc23e1461dcb91bdeee254377099bf1689964631a5b15bdc2eb39af426
|
| 3 |
+
size 5231621710
|
model-00063-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:403260be974b7e0065615087cf092ff28aecf48318b028d7f7e0051478954ab0
|
| 3 |
+
size 5133828868
|
model-00064-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ccbb11afb1dca46a8f68b9fd12fa4dfa574f2720576a64c02f54738fb7d83b86
|
| 3 |
+
size 5231621830
|
model-00065-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f45bf4db817e34fd356434646a7e77507ec100c8837646f8cd45d19db439d276
|
| 3 |
+
size 5231621742
|