> ## Documentation Index
> Fetch the complete documentation index at: https://docs.llm.kiwi/llms.txt
> Use this file to discover all available pages before exploring further.

# Use cases

> Real-world LLM.kiwi use cases with prompts and patterns for chatbots, text summarization, data extraction, translation, and AI-assisted content generation.

<style>
  {`
      .chat-assistant-floating-input,
      chat-assistant-floating-input {
      display: none !important;
      }

      #assistant-entry,
      #assistant-entry-mobile {
      position: fixed !important;
      right: max(1rem, env(safe-area-inset-right)) !important;
      bottom: max(1rem, env(safe-area-inset-bottom)) !important;
      z-index: 60 !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      width: 3rem !important;
      min-width: 3rem !important;
      height: 3rem !important;
      padding: 0 !important;
      overflow: hidden !important;
      color: #fff !important;
      background: #16a34a !important;
      border: 1px solid rgb(255 255 255 / 20%) !important;
      border-radius: 9999px !important;
      box-shadow: 0 10px 25px rgb(15 23 42 / 18%), 0 2px 8px rgb(15 23 42 / 12%) !important;
      }

      #assistant-entry:hover,
      #assistant-entry-mobile:hover {
      background: #15803d !important;
      }

      #assistant-entry:focus-visible,
      #assistant-entry-mobile:focus-visible {
      outline: 3px solid rgb(22 163 74 / 35%) !important;
      outline-offset: 3px !important;
      }

      #assistant-entry svg,
      #assistant-entry-mobile svg {
      width: 1.25rem !important;
      height: 1.25rem !important;
      color: currentcolor !important;
      }

      @media (min-width: 768px) {
      #assistant-entry-mobile { display: none !important; }
      }

      @media (max-width: 767px) {
      #assistant-entry { display: none !important; }
      }

      @media print {
      #assistant-entry,
      #assistant-entry-mobile { display: none !important; }
      }
      `}
</style>

LLM.kiwi can power server-side features that turn messages into generated text. Begin with a narrow task, test realistic inputs, and validate every result your application depends on.

<CardGroup cols={2}>
  <Card title="Conversational assistants">
    Maintain relevant message history and provide a focused system instruction.
  </Card>

  <Card title="Summarization">
    Convert long text into short bullets, action items, or structured notes.
  </Card>

  <Card title="Croatian content">
    Draft, rewrite, classify, or translate Croatian text with `hrllm`.
  </Card>

  <Card title="Data extraction">
    Ask for structured fields, then validate the returned format in code.
  </Card>
</CardGroup>

## Customer-support assistant

```python theme={null}
messages = [
    {
        "role": "system",
        "content": (
            "You assist customers using only the policy below. "
            "If the answer is not in the policy, say you do not know.\n\n"
            "Policy: Returns are accepted within 30 days for unused items."
        ),
    },
    {"role": "user", "content": "Can I return an unused item after 14 days?"},
]

response = client.chat.completions.create(model="auto", messages=messages)
print(response.choices[0].message.content)
```

Keep business rules in your own application as well. A model response should not be the only enforcement mechanism for refunds, payments, permissions, or other important actions.

## Summarize text

```python theme={null}
notes = """
The team agreed to launch on Friday. Ana will test checkout on Wednesday.
Marko will prepare the release notes. The remaining blocker is the email template.
"""

response = client.chat.completions.create(
    model="auto",
    messages=[
        {
            "role": "system",
            "content": "Return a concise summary followed by a bullet list of owners and tasks.",
        },
        {"role": "user", "content": notes},
    ],
)
```

For long documents, stay within the model's context limit and split content into meaningful sections when needed.

## Generate Croatian text

```python theme={null}
response = client.chat.completions.create(
    model="hrllm",
    messages=[
        {
            "role": "system",
            "content": "Piši prirodnim hrvatskim jezikom, jasno i bez marketinških fraza.",
        },
        {
            "role": "user",
            "content": "Preoblikuj ovu obavijest u profesionalan email: Paket kasni jedan dan.",
        },
    ],
)
```

Review generated content before publishing it, especially names, prices, dates, legal statements, and factual claims.

## Extract structured data

```python theme={null}
import json

response = client.chat.completions.create(
    model="auto",
    messages=[
        {
            "role": "system",
            "content": (
                "Extract name and email. Return only JSON matching "
                '{"name": string | null, "email": string | null}.'
            ),
        },
        {
            "role": "user",
            "content": "Contact Ana Horvat at ana@example.com.",
        },
    ],
)

raw = response.choices[0].message.content
try:
    result = json.loads(raw)
except json.JSONDecodeError:
    result = {"name": None, "email": None}
```

A prompt asking for JSON does not guarantee valid JSON. Parse it, validate required fields and types, and define a fallback.

## Classify text

```python theme={null}
response = client.chat.completions.create(
    model="auto",
    messages=[
        {
            "role": "system",
            "content": "Classify the message as billing, technical, or other. Output one label only.",
        },
        {"role": "user", "content": "My API request returns 401."},
    ],
)

label = response.choices[0].message.content.strip().lower()
allowed = {"billing", "technical", "other"}
if label not in allowed:
    label = "other"
```

## Production checklist

* Call LLM.kiwi from your backend, not directly from a browser.
* Keep keys in environment variables and rotate leaked keys.
* Set request timeouts and handle API errors.
* Retry only temporary failures, with exponential backoff.
* Limit user input and conversation history.
* Validate structured output before using it.
* Log request IDs and failures without logging secrets.
* Add human review for high-impact actions or published content.

<CardGroup cols={2}>
  <Card title="Best practices" href="/best-practices">
    Prepare an integration for real users.
  </Card>

  <Card title="Code examples" href="/examples">
    Copy complete language-specific examples.
  </Card>
</CardGroup>
