Addis AI

Text Generation

Chat, summarization, RAG, structured output, and function calling for African languages.

The Text Generation API is powered by Addis-፩-አሌፍ, our flagship large language model.

Use it when your application needs chat, summarization, extraction, classification, RAG, structured output, function calling, or multi-turn conversation in African-language workflows.

Use Text Generation for chat, summarization, extraction, classification, RAG, structured output, and multi-turn conversations. Use the dedicated Translation API for direct language-to-language translation.

Basic request

Send a prompt and a target language to get an immediate response.

import AddisAI from "addisai";

const addis = new AddisAI();
const response = await addis.chat.completions.create({
  messages: [{
    role: "user",
    content: "የአድዋ ጦርነት ታሪክ በአጭሩ",
  }],
  temperature: 0.7,
  max_tokens: 500,
});

console.log(response.choices[0].message.content);
from addisai import AddisAI

addis = AddisAI()
response = addis.chat.completions.create(
    messages=[{
        "role": "user",
        "content": "የአድዋ ጦርነት ታሪክ በአጭሩ",
    }],
    temperature=0.7,
    max_tokens=500,
)

print(response["choices"][0]["message"]["content"])
curl https://api.addisassistant.com/api/v1/chat_generate \
  -H "Content-Type: application/json" \
  -H "x-api-key: $ADDIS_API_KEY" \
  -d '{
    "prompt": "የአድዋ ጦርነት ታሪክ በአጭሩ",
    "target_language": "am",
    "generation_config": {
      "temperature": 0.7,
      "maxOutputTokens": 500
    }
  }'

Guides

API reference

Every request field, generation setting, and response field is documented in POST /api/v1/chat_generate.

Best Practices

Follow these architectural patterns to ensure production readiness.

Temperature

0.1 - 0.3Factual. Extraction, classification, and historical data.
0.7 - 0.9Creative. Storytelling, brainstorming, and casual chat.

Localization

Native Script: Models perform significantly better with Ge'ez input (e.g., "ሰላም") than Latin ("Selam").

Explicit Mode: Always set the target_language param to "am" or "om" to force the correct tokenizer.

Economy

Exact countusage_metadata

Token counts vary by language, script, punctuation, and input structure. For Amharic, one word typically uses around 1.5 to 1.8 tokens. For the exact count, use usage_metadata returned in the REST API response or the corresponding usage value returned by the official SDK.

Robustness

Retries: Implement exponential backoff for 500 or 429 status codes.

Safety: Handle finish_reason: "content_filter" gracefully in your UI if the model refuses a prompt.

Edit on GitHub

Last updated on

On this page