← Speech data prep and inference API

Conversational Gemma (E4B)

Low-latency, single-stream conversational LLM tuned for natural spoken phone turns and native OpenAI function calling, with thinking disabled by default and automatic prefix caching.

Specifications and limits

Drop-in compatible with the OpenAI Chat Completions SDK (point base_url at https://api.trelis.com/v1). Single-stream turn-by-turn text generation, not full-duplex audio.

EndpointsPOST https://api.trelis.com/v1/chat/completions (stream=true SSE or buffered JSON) and GET https://api.trelis.com/v1/models
Model IDgemma-4-e4b-conversational
Pricing$0.15 / 1M input tokens, $0.03 / 1M cached input tokens (80% automatic prefix-cache discount), $0.45 / 1M output tokens. Exact per-token microdollar billing with no $0.001 turn floor (~$0.0022 per 10-minute spoken call). See current API pricing →
Interaction modeSingle-stream turn-by-turn text chat (not duplex)
Tool callingNative OpenAI function tools (tools, up to 64 per request) with tool_choice supporting auto, none, required, and named functions
Thinking modeDisabled by default for minimal first-token latency in live voice pipelines
Context & output limits16,384-token context window, up to 4,096 output tokens per turn, up to 128 messages per request
Default decodingtemperature=1.0, top_p=0.95, top_k=64
LicenseConversational modifications under PolyForm Small Business License 1.0.0; upstream google/gemma-4-E4B-it base weights under Apache 2.0
Data retentionZero data retention; Trelis does not log or train on prompts, tool calls, or completions

Latency and decode speed

Single-request warm timings measured end-to-end over HTTPS from US East (Ashburn). Automatic prefix caching reuses shared system prompts, tool schemas, and prior turns to keep repeat-turn time-to-first-token around 36 ms.

Turn profileTTFT p50TTFT p90E2E p50Decode speed
Short conversational turn (~40 prompt tokens)28 ms29 ms129 ms108 tok/s (10.1 ms ITL)
Cached multi-turn voice turn (~1,916 prompt tokens, 4 tools)36 ms108 ms213 ms103 tok/s (10.5 ms ITL)

Verified live across auto plain replies, auto tool calls with role: "tool" round-trips, multi-turn caller simulation with end_call, 5/5 forced required calls, and 5/5 forced named-function calls with 0 malformed JSON outputs.

Why Conversational Gemma E4B

Stock instruction-tuned LLMs write verbose, formal replies that sound unnatural when spoken aloud. Conversational Gemma E4B cuts spoken-phone perplexity by 4.2x over stock google/gemma-4-E4B-it (13.96 vs 57.95 on a 600-turn real telephone validation set), keeps turns tighter than stock 31B (17.0 vs 21.0 median words/turn), and beats the 7x larger 31B conversational model on full-call pass rate (62/64 vs 61/64) and openings (31/32 vs 27/32) while holding 91.13% tool accuracy across 789 held-out multi-turn tool attempts.

ModelActive sizeSpoken phone PPL (↓)Median words/turn (↓)Openings /32Whole-call pass /64Tool acc /789 (malformed)
Conversational Gemma E4B (hosted)~4.5B13.9617.031/3262/6491.13% (1)
google/gemma-4-E4B-it (stock E4B)~4.5B57.95----
Trelis/gemma-4-31B-it-conversational (31B ref)31B-14.027/3261/6493.16% (2)
google/gemma-4-31B-it (stock 31B ref)31B-21.032/3263/6495.18% (1)

Spoken phone perplexity is measured on 600 held-out real telephone turns (lower is closer to natural spoken English). Whole-call pass and openings are blinded-graded together across 64 held-out multi-turn telephone calls (32 scenarios × 2 seeds); real telephone callers average ~9 words/turn. Hosted Conversational Gemma E4B scores 64/64 role adherence, 63/64 factual accuracy, 64/64 goal completion, and 63/64 spoken delivery.

Quickstart (OpenAI SDK and curl)

Works with existing OpenAI client libraries. Set stream=true and stream_options.include_usage=true to stream tokens with exact token and cached-token counts.

Python (OpenAI SDK)

from openai import OpenAI

client = OpenAI(
    api_key="tr_live_...",
    base_url="https://api.trelis.com/v1",
)

stream = client.chat.completions.create(
    model="gemma-4-e4b-conversational",
    stream=True,
    stream_options={"include_usage": True},
    messages=[
        {"role": "system", "content": "You answer repair calls for a bike shop. Keep replies brief and spoken."},
        {"role": "user", "content": "Is my repair ready? Ticket B42."},
    ],
    tools=[
        {
            "type": "function",
            "function": {
                "name": "lookup_repair",
                "description": "Look up the status of a repair ticket.",
                "parameters": {
                    "type": "object",
                    "properties": {"ticket": {"type": "string"}},
                    "required": ["ticket"],
                },
            },
        }
    ],
    tool_choice="auto",
)

for chunk in stream:
    if chunk.choices and chunk.choices[0].delta:
        print(chunk.choices[0].delta)

curl (streaming SSE with tool calling)

curl -sN https://api.trelis.com/v1/chat/completions \
  -H "Authorization: Bearer $TRELIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemma-4-e4b-conversational",
    "stream": true,
    "stream_options": {"include_usage": true},
    "messages": [
      {"role": "system", "content": "You answer repair calls for a bike shop. Keep replies brief and spoken."},
      {"role": "user", "content": "Is my repair ready? Ticket B42."}
    ],
    "tools": [
      {
        "type": "function",
        "function": {
          "name": "lookup_repair",
          "description": "Look up the status of a repair ticket.",
          "parameters": {
            "type": "object",
            "properties": {"ticket": {"type": "string"}},
            "required": ["ticket"]
          }
        }
      }
    ],
    "tool_choice": "auto"
  }'

Start building with Conversational Gemma

Sign in with email in the console to create an API key and add prepaid credits, with optional automatic top-up. For dedicated capacity or committed volume, email voice@trelis.com.