AI Product Description Generator: Descriptions, Taglines, and Social Blurbs From One Input
By DevShelfHub
Beginner-friendly project that turns structured product inputs into descriptions, taglines, social blurbs, and benefit-led bullets using Python, Streamlit, and the Groq API.
AI Product Description Generator is a beginner-friendly project that transforms simple product inputs into high-quality marketing copy within seconds. By combining structured user data with targeted prompt engineering, the app generates multiple types of content—including full product descriptions, catchy taglines, social media blurbs, and benefit-driven bullet points.
Built using Python, Streamlit, and the Groq API, this project demonstrates how to integrate large language models into real-world applications. It highlights a practical and reusable pattern: collecting structured input through a UI, dynamically shaping prompts based on user intent, and producing format-specific outputs ready for immediate use.
Whether you’re building e-commerce listings, social media posts, or product pages, this tool streamlines the copywriting process and showcases how AI can enhance productivity for developers and marketers alike.
Purpose: practice writing format-specific system prompts and injecting structured user data into an LLM call—a pattern you’ll reuse in almost every real AI product.
Typical use: drop in your product details, hit generate, copy the short blurb into an Instagram caption and the bullet list into an Amazon listing, then download the full description for your website.
Key features:
- Five tone options (Professional, Casual & Friendly, Luxury, Playful, Technical).
- Four output formats selectable via a radio button—including “All three”.
- Format-specific system message selected at runtime so the model always gets the right instruction.
- Download button that saves the output as a named
.txtfile. - Input validation that blocks the API call when product name or features are missing.
Quick example: enter “EcoBrew Pro” with features like “stainless steel filter” and “built-in scale”, choose Luxury tone and “All three”, and get a description, a blurb, and a bullet list in one shot.
Overall flow
User fills in product name, category, features, tone, format
↓
Clicks "Generate Descriptions"
↓
Input validation (name + features required)
↓
product_details string assembled from form values
↓
Format-specific system message selected from _FORMAT_INSTRUCTIONS dict
↓
Groq chat completion (llama-3.3-70b-versatile)
↓
Generated copy shown with st.markdown()
↓
Download button → saves as {product_name}_descriptions.txt
Demo
Step-by-Step Implementation
-
Set up the project
- Install Python 3.10+
- Create a folder and a virtual environment
-
Install dependencies
-
streamlit,groq,httpx,truststore—this is the lightest dependency set of the three projects.
-
-
Store your API key
-
Put
GROQ_API_KEYin.streamlit/secrets.toml
-
Put
-
Build the form
-
Two
st.columns(2)rows for product name / category and target audience / tone -
st.text_areafor multi-line features (one per line) - Optional price and USP fields in a second column pair
-
st.radiofor output format (horizontal)
-
Two
-
Assemble the prompt
-
Concatenate all non-empty fields into a
product_detailsstring usingfilter(None, [...])to skip blank optional fields -
Select the format-specific instruction from
_FORMAT_INSTRUCTIONSand inject it into the system message - Instruct the model to output only the copy—no preamble—to keep the result paste-ready
-
Concatenate all non-empty fields into a
-
Call Groq and display
-
client.chat.completions.createwith system + user messages -
Render with
st.markdown()so headings and bullets in the “All three” output format correctly -
st.download_buttonnames the file using the slugified product name
-
-
Validation and error handling
- Warn separately when product name or features are missing
- Wrap the API call in
try/except
Code Implementation
# AI Product Description Generator — Streamlit + Groq
# Save as app.py, add GROQ_API_KEY to .streamlit/secrets.toml, then: streamlit run app.py
import ssl
import httpx
import streamlit as st
import truststore
st.set_page_config(page_title="AI Product Description Generator", layout="centered")
st.title("AI Product Description Generator")
st.caption("Fill in your product details and get compelling marketing copy in seconds.")
_ssl_ctx = truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
_CHAT_MODEL = "llama-3.3-70b-versatile"
_TONES = ["Professional", "Casual & Friendly", "Luxury", "Playful", "Technical"]
_CATEGORIES = [
"Electronics", "Fashion", "Home & Kitchen", "Beauty & Personal Care",
"Sports & Outdoors", "Food & Beverage", "Software / App", "Other",
]
_FORMATS = [
"Full description + tagline",
"Short blurb (2-3 sentences)",
"Bullet-point feature highlights",
"All three",
]
_FORMAT_INSTRUCTIONS = {
"Full description + tagline": (
"Write a full product description of 3-4 sentences followed by a punchy tagline "
"on its own line starting with 'Tagline:'."
),
"Short blurb (2-3 sentences)": (
"Write a 2-3 sentence product blurb suitable for an e-commerce listing or social media post."
),
"Bullet-point feature highlights": (
"Write 5-7 bullet-point feature highlights for an e-commerce product page. "
"Lead each bullet with a customer benefit, not just the feature name."
),
"All three": (
"Provide three sections with these headings:\n"
"**Full Description** — 3-4 sentences + a tagline starting with 'Tagline:'.\n"
"**Short Blurb** — 2-3 sentences for social media.\n"
"**Feature Highlights** — 5-7 benefit-led bullet points."
),
}
@st.cache_resource
def _groq_client():
import groq
return groq.Groq(
api_key=st.secrets["GROQ_API_KEY"],
http_client=httpx.Client(timeout=120.0, verify=_ssl_ctx),
)
col1, col2 = st.columns(2)
with col1:
product_name = st.text_input("Product name *", placeholder="EcoBrew Pro")
category = st.selectbox("Category", _CATEGORIES)
with col2:
target_audience = st.text_input("Target audience", placeholder="Eco-conscious coffee lovers")
tone = st.selectbox("Tone", _TONES)
features = st.text_area(
"Key features — one per line *",
height=130,
placeholder=(
"Stainless steel filter — no paper waste\n"
"Built-in scale for precise brewing\n"
"Compact, travel-friendly design"
),
)
col3, col4 = st.columns(2)
with col3:
price_point = st.text_input("Price point", placeholder="$49.99")
with col4:
usp = st.text_input(
"Unique selling point",
placeholder="Only brewer with automatic dose measurement",
)
output_format = st.radio("Output format", _FORMATS, horizontal=True)
if st.button("Generate Descriptions", type="primary"):
if not product_name.strip():
st.warning("Please enter a product name.")
elif not features.strip():
st.warning("Please add at least one feature.")
else:
product_details = "\n".join(
filter(
None,
[
f"Product: {product_name}",
f"Category: {category}",
f"Target audience: {target_audience or 'general consumers'}",
f"Key features:\n{features}",
f"Price point: {price_point}" if price_point else "",
f"Unique selling point: {usp}" if usp else "",
f"Tone: {tone}",
],
)
)
system_msg = (
"You are a professional copywriter specializing in product marketing. "
f"{_FORMAT_INSTRUCTIONS[output_format]} "
"Match the specified tone exactly. Use specific, vivid language. "
"Avoid generic filler phrases like 'game-changing' or 'revolutionary'. "
"Output only the copy — no preamble or meta commentary."
)
with st.spinner("Crafting your product copy…"):
try:
client = _groq_client()
resp = client.chat.completions.create(
model=_CHAT_MODEL,
messages=[
{"role": "system", "content": system_msg},
{"role": "user", "content": product_details},
],
)
result = (resp.choices[0].message.content or "").strip()
st.markdown("### Generated Copy")
st.markdown(result)
filename = product_name.strip().lower().replace(" ", "_")
st.download_button(
"Download as .txt",
data=result,
file_name=f"{filename}_descriptions.txt",
mime="text/plain",
)
except Exception as err:
st.error(f"Something went wrong: {err}")
Complete code — Project link (GitHub)
📖 How the Code Works (Step-by-Step)
1. Constants at the top
-
_TONES,_CATEGORIES, and_FORMATSdrive thest.selectboxandst.radiowidgets—adding a new tone means editing one list, not the UI logic. -
_FORMAT_INSTRUCTIONSmaps each format label to the precise instruction injected into the system message, keeping prompt logic co-located with the format definitions.
2. Cached Groq client
-
@st.cache_resourceensures thegroq.Groqobject and its HTTP client are created once per session. Streamlit reruns the script on every button click; without caching this creates a new connection pool each time.
3. Form and two-column layout
-
Two
st.columns(2)rows let related pairs (name/category, audience/tone, price/USP) sit side by side without a sidebar. -
st.radio(..., horizontal=True)keeps the four format choices compact on one line instead of stacking them vertically.
4. Prompt assembly
-
filter(None, [...])removes falsy entries (empty price or USP strings) before joining, so the model never sees “Price point: ” with nothing after it. - The format-specific instruction is interpolated into the system message with an f-string; the tone phrase appears in both the user data and the system instruction so the model receives the constraint twice.
5. Output and download
-
st.markdown(result)renders the model’s markdown headings (used by the “All three” format) without any post-processing. -
The download filename is built by lower-casing and replacing spaces in the product name—
product_name.strip().lower().replace(" ", "_")—so it is always a valid file name.
6. Validation and errors
-
Two separate
st.warningguards run before the API call—one for a missing name, one for missing features—so the message is specific rather than generic. -
The API call is wrapped in
try/except; errors display viast.error()without crashing the app.
Tips & Production Considerations
Iterate on system prompts, not model parameters
The biggest lever for output quality is the system message, not temperature or top-p. When descriptions sound generic, add a concrete constraint like "mention one specific feature in the opening sentence" or "limit the tagline to eight words." Small, testable prompt edits consistently outperform temperature tweaking.
Batch-generate for product catalogs
For stores with tens or hundreds of SKUs, wrap the Groq call in a loop that reads product rows from a CSV and writes output to a new column. Groq's throughput makes this feasible in minutes. Add a short delay between calls to stay within rate limits and log failures so you can retry only the failed rows.
A/B test generated copy
Generate two or three versions of the same description (vary tone or format) and run them as A/B variants on your product page. Because each generation costs fractions of a cent, you can create multiple candidates and let conversion data decide which tone resonates best with your audience.
Always review before publishing
LLMs can invent features, exaggerate performance claims, or produce wording that conflicts with advertising regulations. Treat generated copy as a first draft: check factual accuracy, remove unsupported superlatives, and confirm the description matches the actual product specification before it goes live.
Swap the model without changing the app
Because the app calls Groq's OpenAI-compatible endpoint, you can point it at any provider with the same
interface. Set GROQ_MODEL to a different model name (or switch to the
OpenAI or Together API by updating the base URL) and the rest of the code stays identical.
AI Product Description Generator FAQ
What is the AI Product Description Generator?
The AI Product Description Generator is a beginner-friendly Streamlit app that turns structured product inputs—name, features, audience, tone—into descriptions, taglines, social blurbs, and benefit-led bullet points in a single click using the Groq API.
Is the AI Product Description Generator free to use?
The source code is free and open on GitHub. You only pay for Groq API usage, and Groq's free tier easily covers hundreds of descriptions per day because each generation is short.
What tech stack does the AI Product Description Generator use?
Python for app logic, Streamlit for the UI, and the Groq Python client for chat completions. There is no database, vector store, or build step—the whole app runs from a single Python file.
How does the AI Product Description Generator structure its output?
The system prompt asks the model to return four labelled sections: long description, short tagline, two social blurbs, and benefit-led bullet points. Each section is rendered with Streamlit's markdown so you can copy any block independently.
Can I customize the output format in the AI Product Description Generator?
Yes. The labelled sections are defined in the system prompt—add or remove sections by editing the prompt template (for example, swap social blurbs for a meta description or a PDP headline).
What are alternatives to the AI Product Description Generator?
For email-tone drafts, see the AI Email Reply Generator. For long-form study or training content, see the Smart Study Assistant. For job-application copy with STAR bullets, see the Resume & Cover Letter Improver.