RTX 3050 - Order Now
Home / Blog / Tutorials / Product Description Generator with LLM and Image Analysis
Tutorials

Product Description Generator with LLM and Image Analysis

Build a pipeline that analyses product images with a vision model and generates SEO-optimised descriptions with an LLM for e-commerce catalogues on a GPU server.

You will build a pipeline that takes a product photo, analyses it with a vision model to identify features, materials, and style, then generates an SEO-optimised product description, bullet points, and meta tags. The end result: upload 500 product images and receive complete catalogue-ready listings within an hour. No product data leaves your server — important for unreleased products and competitive pricing. Here is the pipeline on dedicated GPU infrastructure.

Pipeline Architecture

StageToolInputOutput
1. Image analysisLLaVA 1.6 / Qwen-VLProduct photoVisual attributes
2. Description genLLaMA 3.1 8BAttributes + categoryFull listing
3. SEO optimisationLLaMA 3.1 8BDescription + keywordsMeta tags, alt text

Stage 1: Vision-Based Product Analysis

from openai import OpenAI
import base64

client = OpenAI(base_url="http://localhost:8001/v1", api_key="none")

def analyse_product_image(image_path: str) -> dict:
    with open(image_path, "rb") as f:
        img_b64 = base64.b64encode(f.read()).decode()

    response = client.chat.completions.create(
        model="llava-v1.6-mistral-7b",
        messages=[{
            "role": "user",
            "content": [
                {"type": "text", "text": "Describe this product image in detail. "
                 "Include: product type, colours, materials, style, notable features, "
                 "size estimation, and target audience. Return as structured JSON."},
                {"type": "image_url",
                 "image_url": {"url": f"data:image/jpeg;base64,{img_b64}"}}
            ]
        }],
        max_tokens=500
    )
    return parse_json(response.choices[0].message.content)

The vision model identifies product attributes that would take a human copywriter minutes to describe. Run on a separate vLLM instance or share the GPU with the text model.

Stage 2: Description Generation

text_client = OpenAI(base_url="http://localhost:8000/v1", api_key="none")

def generate_listing(product_attrs: dict, category: str, brand_voice: str = "") -> dict:
    response = text_client.chat.completions.create(
        model="meta-llama/Llama-3.1-8B-Instruct",
        messages=[{
            "role": "system",
            "content": f"Generate a product listing for an e-commerce site. "
                       f"Category: {category}. {brand_voice}\n"
                       f"Return JSON: {{\"title\": \"\", \"description\": \"150-200 words\", "
                       f"\"bullet_points\": [\"5 key features\"], "
                       f"\"meta_title\": \"under 60 chars\", "
                       f"\"meta_description\": \"under 155 chars\", "
                       f"\"alt_text\": \"image alt text\"}}"
        }, {
            "role": "user",
            "content": f"Product attributes: {json.dumps(product_attrs)}"
        }],
        max_tokens=600, temperature=0.6
    )
    return parse_json(response.choices[0].message.content)

Batch Catalogue Processing

import glob, json

def process_catalogue(image_dir: str, output_dir: str, category: str):
    images = glob.glob(f"{image_dir}/*.jpg") + glob.glob(f"{image_dir}/*.png")
    results = []
    for img_path in images:
        attrs = analyse_product_image(img_path)
        listing = generate_listing(attrs, category)
        listing["source_image"] = img_path
        results.append(listing)
        with open(f"{output_dir}/{slugify(listing['title'])}.json", "w") as f:
            json.dump(listing, f, indent=2)
    return results

Brand Voice Customisation

Inject brand voice through the system prompt. Provide 3-5 examples of existing product descriptions that represent your tone. Include terms to use and avoid. For luxury brands, instruct the model to use aspirational language. For technical products, emphasise specifications. Store brand voice templates in a configuration file so different product lines get different tones.

Quality and Integration

For production: implement a human review queue for new product types; A/B test AI-generated descriptions against human-written ones for conversion rate; integrate with your CMS or e-commerce platform via API; cache results so regenerating with updated brand voice does not require re-analysing images; and use RAG retrieval from competitor listings to ensure differentiated copy. Deploy on private infrastructure for unreleased products. See image generation for creating product lifestyle shots, model options for multilingual descriptions, more tutorials, and e-commerce use cases.

E-Commerce AI GPU Servers

Dedicated GPU servers for product description and catalogue AI pipelines. Process product data on isolated UK infrastructure.

Browse GPU Servers

Need a Dedicated GPU Server?

Deploy from RTX 3050 to RTX 5090. Full root access, NVMe storage, 1Gbps — UK datacenter.

Browse GPU Servers

gigagpu

We benchmark, deploy, and optimise GPU infrastructure for AI workloads. All data in our guides comes from real-world testing on our UK-based dedicated GPU servers.

Ready to deploy your AI workload?

Dedicated GPU servers from our UK datacenter. NVMe storage, 1Gbps networking, full root access.

Browse GPU Servers Contact Sales

Have a question? Need help?