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-00066-of-00082.safetensors +3 -0
- model-00067-of-00082.safetensors +3 -0
- model-00068-of-00082.safetensors +3 -0
- model-00069-of-00082.safetensors +3 -0
- model-00070-of-00082.safetensors +3 -0
- model-00071-of-00082.safetensors +3 -0
- model-00072-of-00082.safetensors +3 -0
- model-00073-of-00082.safetensors +3 -0
- model-00074-of-00082.safetensors +3 -0
- model-00075-of-00082.safetensors +3 -0
- model-00076-of-00082.safetensors +3 -0
- model-00077-of-00082.safetensors +3 -0
- model-00078-of-00082.safetensors +3 -0
- model-00079-of-00082.safetensors +3 -0
- model-00080-of-00082.safetensors +3 -0
- model-00081-of-00082.safetensors +3 -0
- model-00082-of-00082.safetensors +3 -0
model-00066-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f3687ea4f3ee918df630b8617ccc8bcd1adbb9ad71fc7633447b280f7a0d618f
|
| 3 |
+
size 5133828872
|
model-00067-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bba5fa3d5877eb4c02d8693f8af81f3db76ed5344e500326eb2e0f328c1d8503
|
| 3 |
+
size 5231621828
|
model-00068-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:eb2a2d51e873355788c48a8e0ee9fe386116f77f2e20a4f8edefd7f0dc29f4f8
|
| 3 |
+
size 5231621690
|
model-00069-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9e16e97744de01a946d4c9510b5cdb2f20b3163e8ead631855110ce766100179
|
| 3 |
+
size 5133828866
|
model-00070-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ea9acb8582d7fef8a28c574e09d2c5741e3adb5096c0c4127b7050a10915b346
|
| 3 |
+
size 5231621790
|
model-00071-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fcac5292afef32426e5300e4d57fe36a70dcfcfd318528005046b4f79a64d2a8
|
| 3 |
+
size 5231621706
|
model-00072-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:118dc5d6ab09532c80168b0c9436c6c6ef83f03995a6dab345f6b894ecd83b12
|
| 3 |
+
size 5133828866
|
model-00073-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1ca553a439a1b048c2ed2f1600f4a793ea38ffa36dde10093b731c2e3a49448e
|
| 3 |
+
size 5231621808
|
model-00074-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:61bf5414b440901b21f798b1a56db47fbe43fb23c3e62fe6d22da243f4d4b4d2
|
| 3 |
+
size 5231621698
|
model-00075-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:68a98b706e360373b7292dd5bd13402d67c5276ee9b24542b71aed7b3aa0d935
|
| 3 |
+
size 5133828868
|
model-00076-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:02017e57d6b3d62deae0376806372a19f04ea27f5557a85985ef8c0660604ac5
|
| 3 |
+
size 5231621818
|
model-00077-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4f88b518f4a2f5728c0cc0343f1a14f7d0dd9aa99b8120fc334ee29aec89e199
|
| 3 |
+
size 5231621696
|
model-00078-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:74a31e26740f2f3d78fa63379f186047a3aea706f069948f93f1f135078ac8c0
|
| 3 |
+
size 5133828864
|
model-00079-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5e76acab92b1a96f6b70ff4082ac0ec1c98e054f3b32f847f3860b814327746d
|
| 3 |
+
size 5231621830
|
model-00080-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3285283251ddc3f8bf31d3606ba6bc01578fb2e0868f3d9030bf19e057460adf
|
| 3 |
+
size 5231621752
|
model-00081-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:141f7c5ea2d308d9f087e4f681076fae4d8819b6c9c5a64d260acdaede13a2b2
|
| 3 |
+
size 5133828866
|
model-00082-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7e0fe281e730f99b004a9b7d67f8ffb1a948edd1c6577f8758378a28a01937d7
|
| 3 |
+
size 3250454813
|