Ternary Bonsai 2 27B overview
Ternary Bonsai 2 27B by PrismML
Send text and image inputs; you get back multimodal reasoning outputs for tasks like reasoning, coding, vision, and agentic tool use.
Ternary Bonsai 2 27B specs
- Model ID
prism-ml/ternary-bonsai-2-27b- Developer
- PrismML
- Context window
- 262,144 tokens
- Max output
- 32,768 tokens
- Input
- Image, Text
- Output
- Text
- API
- OpenAI-compatible, base URL
https://api.aimlapi.com/v1
What Is Ternary Bonsai 2 27B API?
Ternary Bonsai 2 27B is PrismML’s flagship model in the Bonsai line and is presented as the company’s most capable model yet. PrismML describes it as a ternary, multimodal model built on Qwen3.8 27B that accepts vision input alongside text.
PrismML says the model uses ternary weights with FP16 group-wise scaling and is released under the Apache 2.0 license.
Technical Reference
| Developer | PrismML |
|---|---|
| Model ID | prism-ml/ternary-bonsai-2-27b |
| Release Date | September 18, 2026 |
| Context Window | 262,144 tokens (~262K) |
| Max Output Tokens | 32,768 tokens |
| Modalities | Image, Text → Text |
| Capabilities | reasoning, streaming, structured (JSON schema) output, tool/function calling, vision |
What Ternary Bonsai 2 27B Brings to the Table
Ternary weight format
PrismML says the model stores weights as {-1, 0, +1} values with FP16 group-wise scaling and describes this as 1.76 effective bits per weight.
Compact footprint
The company reports a total model footprint of 5.9 GB.
Multimodal input
PrismML says Ternary Bonsai 2 27B accepts vision input alongside text.
Local deployment focus
PrismML positions the model for local devices, emphasizing high local throughput and energy efficiency.
Where Ternary Bonsai 2 27B Makes the Most Sense
Multimodal reasoning
PrismML says the model supports text-and-image input, making it suitable for tasks that combine visual and language understanding.
Agentic tool use
PrismML says the model brings agentic capability and long-horizon tool use to local devices.
Coding and reasoning
PrismML highlights stronger reasoning and coding capability for the model.
Local deployment
PrismML frames the model as a compact option for running on local hardware.
Ternary Bonsai 2 27B vs the Alternatives
Qwen3.8 27B
PrismML says Ternary Bonsai 2 27B is based on Qwen3.8 27B.
Sources: https://prismml.com/news/bonsai-2-27b · https://huggingface.co/prism-ml/Ternary-Bonsai-2-27B-gguf · https://www.marktechpost.com/2026/09/18/prismml-releases-ternary-bonsai-2-27b-a-5-9-gb-apache-2-0-model-retaining-98-2-of-qwen3-8-27b-performance/
Use cases
Laptop-local 27B agents are a documented use case, with the model described as suitable for full 27B reasoning and tool use on a standard laptop, including long-document analysis and full-repository code work.
Privacy-sensitive and offline settings are another documented use case, with on-device execution described as keeping prompts and data on the device and working with intermittent or no connectivity.
Coding-agent loops and computer-use workflows are explicitly listed as intended applications, including local models handling sensitive or high-frequency tasks while escalating selectively to the cloud.
Local assistants, multimodal agents, and private knowledge workflows are also stated use cases, alongside long-running agentic tasks that traditionally depended heavily on cloud inference.
Capabilities
- Reasoning
- Streaming
- Structured outputs
- Function calling
- Vision
Ternary Bonsai 2 27B API pricing
| Usage | Price | Unit |
|---|---|---|
| Input | $0.0794 | 1M tokens |
| Output | $0.529 | 1M tokens |
Prices from the AI/ML API price list, checked on Nov 4, 2026.
Ternary Bonsai 2 27B vs other models: token prices
AI/ML API input and output rates for 5 models, per million tokens.
| Model | Input | Output |
|---|---|---|
| Ternary Bonsai 2 27B | $0.0794 | $0.529 |
| $0.525 | $0.525 | |
| $0.3703 | $0.529 | |
| Cydonia 24B V4.1 | $0.3174 | $0.529 |
| $0.1323 | $0.529 |
How to use the Ternary Bonsai 2 27B API
View docsBuild with your agent
Give your agent the model details, code and documentation.
1Get your API key
Create API keyexport AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"2Make your first request
curl 'https://api.aimlapi.com/v1/chat/completions' \
-H "Authorization: Bearer $AIMLAPI_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "prism-ml/ternary-bonsai-2-27b",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}'import os
import requests
headers = {
"Authorization": f"Bearer {os.environ['AIMLAPI_KEY']}",
"Content-Type": "application/json",
}
payload = {
"model": "prism-ml/ternary-bonsai-2-27b",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}
response = requests.post("https://api.aimlapi.com/v1/chat/completions", headers=headers, json=payload, timeout=120)
response.raise_for_status()
print(response.json())const response = await fetch("https://api.aimlapi.com/v1/chat/completions", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AIMLAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "prism-ml/ternary-bonsai-2-27b",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());Ternary Bonsai 2 27B FAQ
How much does Ternary Bonsai 2 27B cost?
Ternary Bonsai 2 27B costs $0.0794 input and $0.529 output per 1M tokens on AI/ML API, billed as you go with no subscription.
What is the Ternary Bonsai 2 27B model ID?
Use prism-ml/ternary-bonsai-2-27b as the model parameter. Requests go to the OpenAI-compatible endpoint with your AI/ML API key.
What is the context window of Ternary Bonsai 2 27B?
Ternary Bonsai 2 27B accepts up to 262,144 tokens of context and returns up to 32,768 output tokens.