Request model access

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

By requesting access, you confirm your intended use qualifies under the PolyForm Small Business License or is covered by written permission from Trelis Research. You agree to share your details with Trelis and receive one access email.

Log in or Sign Up to review the conditions and access this model content.

gemma-4-31B-it-conversational

Use this model to play the caller in a practice conversation. A sales rep can interview a fictional buyer about their needs; a clinician can practice taking a history from a fictional patient using a clinician-reviewed case. The trainee asks the questions. The caller answers from the case, so the trainee has to discover what matters rather than read a summary up front.

This is a standalone FP8 checkpoint based on Gemma 4 31B Instruct, tuned for conversational English and tool calling. In the private text demo, you answer the call and compare two callers blind. From a cold start, allow about four minutes for the Space to load; the first reply may take another minute or more.

Caller: the model is the person calling

Write the caller’s facts, then describe what they say up front and what the trainee has to ask about. In the bike-shop example, the caller asks about their repair first and mentions the lost ticket only when asked. The Space adds the same phone instructions and end_call schema for both models. To reproduce that prompt locally, use caller.json:

import json
from pathlib import Path
from huggingface_hub import hf_hub_download

caller = json.loads(Path(hf_hub_download("Trelis/gemma-4-31B-it-conversational", "caller.json")).read_text())
card = caller["card"]  # Replace with your own caller facts and opening instructions.
system = caller["system"].replace("<<CALLER>>", card.strip() + "\n\n" + caller["style"])
messages = [{"role": "system", "content": system},
            {"role": "user", "content": "Thanks for calling the shop. How can I help?"}]
tools = caller["tools"]

The trainee speaks as user; the generated assistant message is the caller. When the caller invokes end_call, its farewell argument is the spoken goodbye.

Assistant: the model is the person answering

Use the same chat template. Replace the caller card and speaking instructions with the assistant’s job, what it needs to ask, and when to use its tools. Now user is the caller, and assistant is the shop agent. Pass the tool schema separately:

messages = [{"role": "system", "content": "You answer repair calls for a bike shop. Ask for the ticket number if it is missing. To check repair status, use lookup_repair and tell the caller what it returns."},
            {"role": "user", "content": "Is my repair ready? My ticket is 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"]}
}}]

Your app executes the requested tool. Append the assistant’s tool_calls message, then a role: "tool" message with the matching tool_call_id and the actual result as content. Render again to get the spoken answer. When rendering locally, use a Python dictionary for function.arguments; parse it first if your server returned a JSON string. The caller demo does not execute business tools.

Load the model

Use a CUDA GPU with native FP8 support. The weights are already quantized; no adapter or conversion is needed.

from transformers import AutoModelForImageTextToText, AutoTokenizer

name = "Trelis/gemma-4-31B-it-conversational"
tokenizer = AutoTokenizer.from_pretrained(name)
model = AutoModelForImageTextToText.from_pretrained(name, device_map="cuda", dtype="auto")
inputs = tokenizer.apply_chat_template(messages, tools=tools, add_generation_prompt=True,
                                       enable_thinking=False, tokenize=True, return_dict=True,
                                       return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(output[0, inputs.input_ids.shape[1]:], skip_special_tokens=False))

For vLLM with Gemma 4 and block FP8 support, serve with vllm serve Trelis/gemma-4-31B-it-conversational --max-model-len 4096 --enable-auto-tool-choice --tool-call-parser gemma4. Send structured messages (and tools for the assistant) to /v1/chat/completions. The server applies the template; do not wrap the messages in Gemma tokens yourself.

License

The conversational modifications are offered under the PolyForm Small Business License 1.0.0. The original Gemma 4 weights are licensed under Apache 2.0. This checkpoint incorporates the conversational modifications and converts the resulting weights to FP8.

Downloads last month
35
Safetensors
Model size
31B params
Tensor type
BF16
Β·
F8_E4M3
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for Trelis/gemma-4-31B-it-conversational

Quantized
(380)
this model

Collection including Trelis/gemma-4-31B-it-conversational