DEV Community

shashank ms
shashank ms

Posted on

Llama 3.3 70B Model Details and Use Cases

I am going to build a support ticket triage agent that ingests raw customer messages and returns structured JSON with a category, urgency, and draft reply. Llama 3.3 70B on Oxlo.ai handles the reasoning, and the flat per-request pricing means long threads do not inflate costs. This is for teams that want to automate first-line support without token math.

What you'll need

Oxlo.ai exposes Llama 3.3 70B through an OpenAI-compatible endpoint at https://api.oxlo.ai/v1, so the SDK works without changes.

Step 1: Test the client

First, I verify that the API key and base URL are correct by sending a short completion.

from openai import OpenAI

client = OpenAI(base_url="https://api.oxlo.ai/v1", api_key="YOUR_OXLO_API_KEY")

response = client.chat.completions.create(
    model="llama-3.3-70b",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Say hello in one word."},
    ],
)

print(response.choices[0].message.content)

If you see a one-word greeting, the client is ready.

Step 2: Write the system prompt

The system prompt locks the model into a structured triage role and forces JSON output. I keep it strict so Llama 3.3 70B does not add markdown or explanation.

SYSTEM_PROMPT = """You are a support ticket triage agent.
Analyze the customer message below and produce a single JSON object with exactly these keys:
- category: one of Billing, Technical, Account, or General
- urgency: one of Low, Medium, High, or Critical
- product_area: the feature or module mentioned, or Unknown
- summary: a one-sentence summary of the issue
- draft_reply: a polite, concise first response for the support team

Rules:
1. Output only valid JSON.
2. Do not wrap the JSON in markdown code fences.
3. If the ticket is vague, set urgency to Medium and product_area to Unknown."""

Step 3: Build the triage function

Next, I wrap the call in a function that accepts a raw ticket string and returns the parsed result.

import json
from openai import OpenAI

client = OpenAI(base_url="https://api.oxlo.ai/v1", api_key="YOUR_OXLO_API_KEY")

SYSTEM_PROMPT = """You are a support ticket triage agent.
Analyze the customer message below and produce a single JSON object with exactly these keys:
- category: one of Billing, Technical, Account, or General
- urgency: one of Low, Medium, High, or Critical
- product_area: the feature or module mentioned, or Unknown
- summary: a one-sentence summary of the issue
- draft_reply: a polite, concise first response for the support team

Rules:
1. Output only valid JSON.
2. Do not wrap the JSON in markdown code fences.
3. If the ticket is vague, set urgency to Medium and product_area to Unknown."""

def triage_ticket(raw_ticket: str) -> dict:
    response = client.chat.completions.create(
        model="llama-3.3-70b",
        messages=[
            {"role": "system", "content": SYSTEM_PROMPT},
            {"role": "user", "content": raw_ticket},
        ],
        response_format={"type": "json_object"},
        temperature=0.2,
    )
    return json.loads(response.choices[0].message.content)

# Quick test
print(triage_ticket("I need a refund."))

Step 4: Add validation

Production code should not trust raw JSON. I add a small validator that checks required keys and fails loudly.

import json
from openai import OpenAI

client = OpenAI(base_url="https://api.oxlo.ai/v1", api_key="YOUR_OXLO_API_KEY")

SYSTEM_PROMPT = """You are a support ticket triage agent.
Analyze the customer message below and produce a single JSON object with exactly these keys:
- category: one of Billing, Technical, Account, or General
- urgency: one of Low, Medium, High, or Critical
- product_area: the feature or module mentioned, or Unknown
- summary: a one-sentence summary of the issue
- draft_reply: a polite, concise first response for the support team

Rules:
1. Output only valid JSON.
2. Do not wrap the JSON in markdown code fences.
3. If the ticket is vague, set urgency to Medium and product_area to Unknown."""

REQUIRED_KEYS = {"category", "urgency", "product_area", "summary", "draft_reply"}

def triage_ticket_safe(raw_ticket: str) -> dict:
    response = client.chat.completions.create(
        model="llama-3.3-70b",
        messages=[
            {"role": "system", "content": SYSTEM_PROMPT},
            {"role": "user", "content": raw_ticket},
        ],
        response_format={"type": "json_object"},
        temperature=0.2,
    )
    parsed = json.loads(response.choices[0].message.content)
    missing = REQUIRED_KEYS - parsed.keys()
    if missing:
        raise ValueError(f"Missing keys in model response: {missing}")
    return parsed

print(triage_ticket_safe("I need a refund."))

Step 5: Run a batch

Because Oxlo.ai uses flat per-request pricing, running this on a backlog of fifty long tickets costs the same whether each ticket is fifty words or five hundred. I process a list in a loop and print each result.

import json
from openai import OpenAI

client = OpenAI(base_url="https://api.oxlo.ai/v1", api_key="YOUR_OXLO_API_KEY")

SYSTEM_PROMPT = """You are a support ticket triage agent.
Analyze the customer message below and produce a single JSON object with exactly these keys:
- category: one of Billing, Technical, Account, or General
- urgency: one of Low, Medium, High, or Critical
- product_area: the feature or module mentioned, or Unknown
- summary: a one-sentence summary of the issue
- draft_reply: a polite, concise first response for the support team

Rules:
1. Output only valid JSON.
2. Do not wrap the JSON in markdown code fences.
3. If the ticket is vague, set urgency to Medium and product_area to Unknown."""

REQUIRED_KEYS = {"category", "urgency", "product_area", "summary", "draft_reply"}

def triage_ticket_safe(raw_ticket: str) -> dict:
    response = client.chat.completions.create(
        model="llama-3.3-70b",
        messages=[
            {"role": "system", "content": SYSTEM_PROMPT},
            {"role": "user", "content": raw_ticket},
        ],
        response_format={"type": "json_object"},
        temperature=0.2,
    )
    parsed = json.loads(response.choices[0].message.content)
    missing = REQUIRED_KEYS - parsed.keys()
    if missing:
        raise ValueError(f"Missing keys in model response: {missing}")
    return parsed

tickets = [
    "Hi, I was charged twice for my Pro subscription this month. Please refund the extra charge.",
    "The API returns a 500 error every time I send a request with Unicode characters in the payload. This is blocking our production deploy.",
    "How do I change my profile picture?",
]

for t in tickets:
    try:
        result = triage_ticket_safe(t)
        print(json.dumps(result, indent=2))
    except Exception as e:
        print("Failed to triage ticket:", e)

Run it

Save the script as triage.py, export your key, and run python triage.py. Here is the output I get for the first ticket:

{
  "category": "Billing",
  "urgency": "High",
  "product_area": "Subscription",
  "summary": "Customer was double-charged for Pro subscription and requests a refund.",
  "draft_reply": "Thanks for reaching out. I have flagged the duplicate charge to our billing team and initiated a refund. You should see the credit within 3 to 5 business days."
}

The model correctly identifies billing urgency even from a short message, and the draft reply is ready to send with minimal editing.

Next steps

Wire this function into an email webhook so every incoming support message is triaged automatically. If you later need deeper reasoning for complex technical tickets, swap the model string to kimi-k2.6 on Oxlo.ai without changing any other client code.

Top comments (0)