type a prompt below and press Enter (Shift+Enter for newline). streaming tokens appear here.
bonsai ~ $
Enter to send · Shift+Enter for newline · Esc to stop
// call this model yourself
This demo runs on Hugging Face Inference Providers
(OpenAI-compatible API, routed to Together). You need an HF token with the
Inference Providers permission.
curl
curl https://router.huggingface.co/v1/chat/completions \
-H "Authorization: Bearer $HF_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "prism-ml/Ternary-Bonsai-27B-gguf:together",
"messages": [{"role": "user", "content": "Write a haiku about a bonsai tree."}],
"stream": false
}'
python · openai client
import os
from openai import OpenAI
client = OpenAI(
base_url="https://router.huggingface.co/v1",
api_key=os.environ["HF_TOKEN"],
)
resp = client.chat.completions.create(
model="prism-ml/Ternary-Bonsai-27B-gguf:together",
messages=[{"role": "user", "content": "Write a haiku about a bonsai tree."}],
)
print(resp.choices[0].message.content)
javascript · openai sdk
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://router.huggingface.co/v1",
apiKey: process.env.HF_TOKEN,
});
const res = await client.chat.completions.create({
model: "prism-ml/Ternary-Bonsai-27B-gguf:together",
messages: [{ role: "user", content: "Write a haiku about a bonsai tree." }],
});
console.log(res.choices[0].message.content);