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-00021-of-00082.safetensors +3 -0
- model-00022-of-00082.safetensors +3 -0
- model-00023-of-00082.safetensors +3 -0
- model-00024-of-00082.safetensors +3 -0
- model-00025-of-00082.safetensors +3 -0
- model-00026-of-00082.safetensors +3 -0
- model-00027-of-00082.safetensors +3 -0
- model-00028-of-00082.safetensors +3 -0
- model-00029-of-00082.safetensors +3 -0
- model-00030-of-00082.safetensors +3 -0
- model-00031-of-00082.safetensors +3 -0
- model-00032-of-00082.safetensors +3 -0
- model-00033-of-00082.safetensors +3 -0
- model-00034-of-00082.safetensors +3 -0
- model-00035-of-00082.safetensors +3 -0
- model-00036-of-00082.safetensors +3 -0
- model-00037-of-00082.safetensors +3 -0
- model-00038-of-00082.safetensors +3 -0
- model-00039-of-00082.safetensors +3 -0
- model-00040-of-00082.safetensors +3 -0
model-00021-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2091b0933d9ca20aabcf91a01141528e498ad5eda01edc6c228bab8174bbccd2
|
| 3 |
+
size 5133828866
|
model-00022-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f1aaf892fd100c646e265fd51563126677e867d85cad4376627524c88cdcadca
|
| 3 |
+
size 5231621732
|
model-00023-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:48e32a1b8806d4bb467d218d2df9c5130bd2f07765fbd23d07c02933dbcb422a
|
| 3 |
+
size 5231621690
|
model-00024-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6f499698fe5d09cea4a3896175332d5effbc9351b22639e3a8ab3b483851afd9
|
| 3 |
+
size 5133828872
|
model-00025-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e80a3df9d98f18a130269522e41dfcec1ac537483a0a4355c6920ee857760518
|
| 3 |
+
size 5231621822
|
model-00026-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bb08ece3a5e919ed5d23392e4d18e95b262b9d07358ec1e7309c0a0baf2e8747
|
| 3 |
+
size 5231621672
|
model-00027-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:57cbe2ba0902ff6d976652ae3416d6672ce342f6826d3845c5ceaf782e70c3f7
|
| 3 |
+
size 5133828866
|
model-00028-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:39d5e0fdaeca35569d0664c7fe6768047a49c7f8682eb18d9c71309d574cee28
|
| 3 |
+
size 5231621830
|
model-00029-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e4b4a154c3cee8527b13bf49f408778d68231dc0b0756272759e4d24bb570e47
|
| 3 |
+
size 5231621774
|
model-00030-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:27523758d803aa2f0e0242234e82f6f349b278647895fe6e746895a55bb8a1a8
|
| 3 |
+
size 5133828868
|
model-00031-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7a1e2bdff82ab27722cea4913f15ddc1e60a7e7a9ec3a7cbed0c8294b1046c92
|
| 3 |
+
size 5231621828
|
model-00032-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a66923cf5c3a1c8f4631daf8ea61001068ffae7a359546da78cce2bb8d9128ee
|
| 3 |
+
size 5231621746
|
model-00033-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:179b409a9b30c778086e4232a6f892f953ae3ec0ed17e0ccafedc7cd4bcc9ddf
|
| 3 |
+
size 5133828872
|
model-00034-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:aa3e1803f1a3500a16e6d01143eb9210c91c19d065f04b31a3c855e411559b54
|
| 3 |
+
size 5231621834
|
model-00035-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:db146426895176295549fed1389fe831352c1aaaef83844f113033f6f77a5cfe
|
| 3 |
+
size 5231621710
|
model-00036-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:657d634040d9b8d173b129e6ba2b046a15e364744a5ce5c940f422d7e869589d
|
| 3 |
+
size 5133828866
|
model-00037-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:301a7c8bcbb53f3e169b008574c03d4fec953b1069c9b621ee07539cd53e9d16
|
| 3 |
+
size 5231621820
|
model-00038-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:670807469e931f645a7ad267e9afbc933536b644a6951347f39e539dd2bc6831
|
| 3 |
+
size 5231621720
|
model-00039-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:74aff226a4dba8009679a64e4a6b7201d30fc1dbf8f851c603541ffd1cdcdf8a
|
| 3 |
+
size 5133828868
|
model-00040-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a1bf5e65f5171ebcc466554bdb66b16ce80a869b0ef891e75dfee751d01febbd
|
| 3 |
+
size 5231621830
|