DEV Community

shashank ms
shashank ms

Posted on

Designing with LLMs: A Comprehensive Guide

Large language models have moved beyond copywriting and are now core collaborators in product design. Whether you are generating component libraries, critiquing interface accessibility, or iterating on visual mockups, LLMs can compress hours of manual work into structured, repeatable workflows. This guide covers practical patterns for integrating LLMs into design processes, with concrete code examples and inference strategies that respect real-world budgets.

Understanding LLM Design Workflows

Design work with LLMs typically falls into three patterns: generation, transformation, and critique. Generation produces code, assets, or copy from text prompts. Transformation migrates design systems between formats, such as converting Figma JSON into CSS variables or updating legacy component props. Critique leverages vision-capable models to evaluate contrast ratios, spacing consistency, and accessibility compliance from screenshots. Each pattern demands different context lengths and output structures, so your choice of model and inference backend should match the task.

Structured Design Tokens with JSON Mode

Design tokens are a natural fit for LLM structured output. Instead of parsing unstructured prose, you can enforce a schema for colors, typography, and spacing values. Oxlo.ai supports JSON mode across its chat models, so you can pipe token definitions directly into a design system build step.

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": "user",
        "content": (
            "Generate a dark-mode design token set for a fintech dashboard. "
            "Include colors, typography scale, and spacing. Respond in JSON."
        )
    }],
    response_format={"type": "json_object"}
)

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

The returned JSON can be validated against a schema and committed to a tokens repository. Because Oxlo.ai charges per request rather than per token, you can include exhaustive style-guide context in the prompt without inflating cost.

Generating UI Code and Prototypes

Turning a wireframe description into a working React or Vue prototype is one of the highest-leverage uses of LLMs in design. The key is providing context about your existing component library so the model imports the correct modules rather than inventing new ones.

response = client.chat.completions.create(
    model="qwen-3-32b",
    messages=[{
        "role": "user",
        "content": (
            "Using our internal @acme/core components (Button, Card, DataTable), "
            "build a React dashboard for displaying transaction history. "
            "Include sorting and pagination. Use TypeScript."
        )
    }]
)

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

For purely code-heavy tasks, specialized models like Qwen 3 Coder 30B, DeepSeek Coder, or Oxlo.ai Coder Fast often produce tighter, more syntactically correct output than general-purpose chat models.

Vision Models for Design Review

Vision-capable models can analyze screenshots, wireframes, or exported frames and return structured feedback. This is useful for spotting accessibility issues, inconsistent padding, or missing responsive breakpoints before code review.

import base64

with open("dashboard_mockup.png", "rb") as image_file:
    b64_image = base64.b64encode(image_file.read()).decode("utf-8")

response = client.chat.completions.create(
    model="kimi-k2.6",
    messages=[{
        "role": "user",
        "content": [
            {"type": "text", "text": "Review this dashboard mockup for WCAG contrast issues and inconsistent spacing. Return findings as a bulleted list."},
            {"type": "image_url", "image_url": {"url": f"data:image/png;base64,{b64_image}"}}
        ]
    }]
)

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

Models such as Kimi K2.6, Gemma 3 27B, and Kimi VL A3B handle multimodal inputs well. Because design reviews often involve high-resolution images with large base64 payloads, token-based billing can make this workflow prohibitively expensive. Oxlo.ai's flat per-request pricing keeps the cost predictable regardless of image size or prompt length.

Image Generation for Mockups

Beyond code and critique, LLM platforms can generate visual assets. You can produce hero images, icon sets, or marketing banners directly from text prompts, then iterate quickly without leaving the terminal.

image_response = client.images.generate(
    model="oxlo.ai-image-pro",
    prompt="A minimalist SaaS dashboard hero image, soft gradients, purple and slate tones, no text, 16:9 aspect ratio",
    size="1024x576",
    n=1
)

print(image_response.data[0].url)

Oxlo.ai offers image generation through Oxlo.ai Image Pro, Oxlo.ai Image Ultra, Flux.1, SDXL, and Stable Diffusion 3.5. You can call these through the familiar images/generations endpoint with the same SDK.

Agentic Design Iteration

Design is rarely a single-shot process. An agentic loop, where the model generates a component, a vision model reviews it, and a third model refines the code based on feedback, requires long context windows and multi-turn conversations. Models like GLM 5, Minimax M2.5, DeepSeek V4 Flash, and Kimi K2.6 excel at agentic tool use and long-horizon reasoning.

These workflows accumulate context quickly. A full design system document, previous iteration code, image analysis results, and tool-call histories can push context into the hundreds of thousands of tokens. On token-based providers, this creates a direct tension between design quality and inference cost. With Oxlo.ai, the price remains flat per request, so you can maintain full conversational context without manually trimming history to stay inside a budget.

Cost, Context, and Inference Strategy

Design engineering workloads are uniquely demanding on inference infrastructure. They combine long prompts (design specs, component libraries, accessibility guidelines), multimodal inputs (screenshots, wireframes), and iterative, multi-step agentic flows. Token-based pricing creates a penalty for thoroughness: the more context you provide, the more you pay.

Oxlo.ai inverts this incentive. Its request-based pricing means one flat cost per API call regardless of prompt length or image payload. For long-context and agentic design tasks, this can reduce costs by an order of magnitude compared to token-based alternatives. You can include full design system documentation in every prompt, pass high-resolution images, and run extended multi-turn critiques without watching metered tokens accumulate.

The platform is fully OpenAI SDK compatible, so switching existing design toolchains requires only a base URL change to https://api.oxlo.ai/v1. There are no cold starts on popular models, which keeps interactive prototyping responsive. If you are evaluating providers, the Oxlo.ai pricing page details the Free, Pro, and Premium tiers, including a 7-day full-access trial on the Free plan.

Conclusion

Effective design with LLMs depends on giving models complete context: your component library, your brand tokens, your accessibility standards, and your visual references. An inference backend that charges by the token forces you to ration that context. Oxlo.ai removes that constraint with flat per-request pricing, a broad catalog of code, vision, and image generation models, and drop-in SDK compatibility. For design engineering teams building the next generation of AI-assisted workflows, it is a backend worth considering.

Top comments (0)