Ternary Bonsai 2 27B API

prism-ml/ternary-bonsai-2-27b
A ternary multimodal 27B model from PrismML, good at reasoning, coding, vision, and agentic tool use on local devices.
Context
256K tokens
Input
$0.103155 / 1M tokens
Output
$0.6877 / 1M tokens
Released
Sep 18, 2026

Overview

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

DeveloperPrismML
Model IDprism-ml/ternary-bonsai-2-27b
Release DateSeptember 18, 2026
Context Window262,144 tokens (~262K)
Max Output Tokens32,768 tokens
ModalitiesImage, Text → Text
Capabilitiesreasoning, 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.

Model family positioning
PrismML describes Ternary Bonsai 2 27B as the largest multimodal model in the Bonsai family.

API Pricing

  • Input: $0.103155 / 1M tokens
  • Output: $0.6877 / 1M tokens

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/

Uptime and performance

  • Uptime (24h): 100%
  • Uptime (7d): 100%
  • Availability (24h): 77.0%
  • Error rate (24h): 23.0%
  • End-to-end latency (24h median): 44.3s
  • Throughput (24h median): 2.6 tok/s

Measured on the AI/ML API gateway across live traffic. Figures are medians unless stated. Last updated 2026-10-12.

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.

How to use Ternary Bonsai 2 27B API

Install any OpenAI-compatible SDK, point it at api.aimlapi.com/v1, and set the model to prism-ml/ternary-bonsai-2-27b.
import requests

r = requests.post(
    "https://api.aimlapi.com/v1/chat/completions",
    headers={"Authorization": "Bearer " + AIMLAPI_KEY},
    json={
      "model": "prism-ml/ternary-bonsai-2-27b",
      "messages": [
        {
          "role": "user",
          "content": "Hello!"
        }
      ]
    },
)
print(r.json())
const r = 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": "Hello!"
      }
    ]
  }),
});
console.log(await r.json());
curl -X POST 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":"Hello!"}]}'

OpenAI-compatible — swap the base URL and it works with your existing SDK.

Ternary Bonsai 2 27B API Pricing

TypePrice
Input
$0.103155 / 1M tokens
Output
$0.6877 / 1M tokens

Ternary Bonsai 2 27B is free to integrate using the Puter.js AI API, and Puter’s user-pays model says app developers can add it for $0 because users cover their own AI usage through

Ternary Bonsai 2 27B Benchmarks

BenchmarkScoreWhat it measuresSourceRetrieved
GSM8K
96.66
Grade-school maths word problems requiring multi-step arithmeticSourceSeptember 22, 2026
AIME 2025
95.00
Competition mathematics (AIME), 2025SourceSeptember 22, 2026
LiveCodeBench
90.07
Contamination-free competitive programming problemsSourceSeptember 22, 2026

Frequently asked questions

No items found.

Start building with Ternary Bonsai 2 27B

Get API Key
1000+ models, one API.