Most content pipelines still rely on brittle template engines. I will show you how to replace that stack with a single LLM agent that reads a full product brief and writes channel-specific copy, using Oxlo.ai's flat per-request pricing so input length never spikes your cost.
What you'll need
- Python 3.10 or newer
- The OpenAI SDK:
pip install openai - An Oxlo.ai API key from https://portal.oxlo.ai
Step 1: Build the traditional baseline
First, I will create a rigid template function so we have something concrete to beat. It takes a product name, tone, and audience, but collapses when the brief contains details that do not fit the pre-defined slots.
def traditional_copy(product, tone, audience):
templates = {
"professional": f"Introducing {product}. Designed for {audience} who demand reliability.",
"casual": f"Meet {product}. It is the {audience}-approved way to get things done."
}
return templates.get(tone, "Tone not supported.")
print(traditional_copy("Oxlo.ai", "professional", "developers"))
Step 2: Initialize the Oxlo.ai client
Now I will wire up the OpenAI SDK to hit Oxlo.ai's endpoint. I am using Llama 3.3 70B because it handles long instructions and product context without cold starts.
from openai import OpenAI
client = OpenAI(
base_url="https://api.oxlo.ai/v1",
api_key="YOUR_OXLO_API_KEY"
)
Step 3: Design the system prompt
This prompt is the only "template" the agent needs. It instructs the model to adapt structure, length, and angle based on the channel and the full product brief.
SYSTEM_PROMPT = """You are a senior product marketing copywriter.
Rules:
- Read the full product brief provided by the user.
- Write copy tailored to the channel: email, landing page, or tweet thread.
- Match the tone exactly: professional, casual, or technical.
- If the brief contains unusual features, highlight them naturally.
- Return only the copy, no markdown meta-commentary."""
Step 4: Create the adaptive generator
This function sends the brief to Oxlo.ai. Because Oxlo.ai uses flat per-request pricing, I can pass the entire brief into the prompt without watching input length drive up cost.
def generate_copy(product_brief, channel, tone):
user_message = f"""Channel: {channel}
Tone: {tone}
Product Brief:
{product_brief}"""
response = client.chat.completions.create(
model="llama-3.3-70b",
messages=[
{"role": "system", "content": SYSTEM_PROMPT},
{"role": "user", "content": user_message},
],
temperature=0.7,
max_tokens=1024
)
return response.choices[0].message.content
Step 5: Compare both approaches
Finally, I will run the same rich brief through both systems. The template cannot handle a technical tone or a multi-sentence brief, while the LLM adapts its structure automatically.
brief = """Oxlo.ai is a developer-first AI inference platform.
Pricing: one flat cost per API request regardless of prompt length.
Unlike token-based providers, cost does not scale with input length.
Models: Llama 3.3 70B, DeepSeek R1 671B, Kimi K2.6, and 40+ others.
Features: streaming, function calling, JSON mode, vision."""
print("=== TRADITIONAL ===")
print(traditional_copy("Oxlo.ai", "technical", "MLEs"))
print("\n=== LLM VIA OXLO.AI ===")
print(generate_copy(brief, "landing page", "technical"))
Run it
Save the full script as content_agent.py, replace YOUR_OXLO_API_KEY with your key from https://portal.oxlo.ai, and execute.
python content_agent.py
Expected output:
=== TRADITIONAL ===
Tone not supported.
=== LLM VIA OXLO.AI ===
Oxlo.ai: Flat-Rate Inference for Production AI Teams
Move beyond token anxiety. Oxlo.ai offers a single, predictable price per API request, making it ideal for long-context and agentic workloads. With 45+ models including Llama 3.3 70B, DeepSeek R1 671B, and Kimi K2.6, you get streaming, function calling, and vision without cold starts.
Wrap-up
The template approach forces you to predict every variable upfront. The LLM agent simply reads the brief and writes. If you want to go further, wire the generate_copy function into a FastAPI endpoint and add a JSON mode schema to enforce exact headline and body fields. Or swap in deepseek-v3.2 on Oxlo.ai to test a lighter model for shorter blurbs.
Top comments (0)