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-00001-of-00082.safetensors +3 -0
- model-00002-of-00082.safetensors +3 -0
- model-00003-of-00082.safetensors +3 -0
- model-00004-of-00082.safetensors +3 -0
- model-00005-of-00082.safetensors +3 -0
- model-00006-of-00082.safetensors +3 -0
- model-00007-of-00082.safetensors +3 -0
- model-00008-of-00082.safetensors +3 -0
- model-00009-of-00082.safetensors +3 -0
- model-00010-of-00082.safetensors +3 -0
- model-00011-of-00082.safetensors +3 -0
- model-00012-of-00082.safetensors +3 -0
- model-00013-of-00082.safetensors +3 -0
- model-00014-of-00082.safetensors +3 -0
- model-00015-of-00082.safetensors +3 -0
- model-00016-of-00082.safetensors +3 -0
- model-00017-of-00082.safetensors +3 -0
- model-00018-of-00082.safetensors +3 -0
- model-00019-of-00082.safetensors +3 -0
- model-00020-of-00082.safetensors +3 -0
model-00001-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d44edf9e4ff91215f1c5cc136cf8e4b4aae8e21aef0e3ecffc6ff1c0f9ce04d4
|
| 3 |
+
size 4411223085
|
model-00002-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b635a8a11f9cb4f2acc0de1cfb9383ee3c700a148a810178f17a18824ea22d85
|
| 3 |
+
size 5231621678
|
model-00003-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:539d63e764341aeae1d693de01a50a81bc9024fd1bdaad0e50ea328551543f95
|
| 3 |
+
size 5133828858
|
model-00004-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f0a4b63b90b556862661a403bf9a7c66f52e8a0347a5e414d55df2dbcb1b8ea2
|
| 3 |
+
size 5231621790
|
model-00005-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:26215f6cd47ef28645b7cb491fc01a6fe6f550f4c210fe33c93e1ee839855ec4
|
| 3 |
+
size 5231621672
|
model-00006-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bc6e5d61f000a6889e682d3cc5cbcf1ffc8583b7840efb304c55210b966aca1d
|
| 3 |
+
size 5133828856
|
model-00007-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:33e87f4698cd64b31d07822cf836215af43c2e1454bde70ae6a75ebf15646c75
|
| 3 |
+
size 5231621814
|
model-00008-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:693b61e87301d02532baa214601295161d86a402d9a470163511e17517a3b56f
|
| 3 |
+
size 5231621748
|
model-00009-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6aab673e7fd2f3bb8dd0f09339324e70883010362553d46774cdd06f8a38e93e
|
| 3 |
+
size 5133828872
|
model-00010-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9dfea391f811ac522737e6a9cdba4e2c6431b1aac0f9406c20f2ec1bdd80e379
|
| 3 |
+
size 5231621780
|
model-00011-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9314e5c98d500601a11e0bf6b664cbee56dc16557f72df9960b90ec2dd039cdc
|
| 3 |
+
size 5231621728
|
model-00012-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5a605e73a0839cc8fddb5aaf3dcbbd739dfea3a6cc8f28ec21c914b3ed266869
|
| 3 |
+
size 5133828872
|
model-00013-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:11685deb71a5b0e2b208efdb9ea99d0e8f0a43117192fa1bd51e4ea663dcdd65
|
| 3 |
+
size 5231621830
|
model-00014-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dea622aa4b03f6c0cb4ca8c400736b21e1227a07e3e58ed91b9d9a6a54fbb8c1
|
| 3 |
+
size 5231621738
|
model-00015-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fdc28fa0d326b183ad8f515c83e7bd22239402d1dc461adf9ec9c1c0bec8be18
|
| 3 |
+
size 5133828862
|
model-00016-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:77c3b7181ffb5c90372315c9f8f1ba3fab4120862fed641f673444d60bfa4d18
|
| 3 |
+
size 5231621830
|
model-00017-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b683c84e4d88f5b45879bd41b07a4869b7032363c5beb3421504ee7ffbcc574a
|
| 3 |
+
size 5231621694
|
model-00018-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:86966490fca11128bb22dc6627186cc190d41f4138d1b66c0198b424e9d29f42
|
| 3 |
+
size 5133828872
|
model-00019-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7d805a2a116019e65b8272b34398f6487df61b6e72ba3b464b9c1ec211365976
|
| 3 |
+
size 5231621830
|
model-00020-of-00082.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:590050e213d7fcdea52d6768a82b81dcb0ac03a0edaecbb364080c482b4e4b3c
|
| 3 |
+
size 5231621710
|