Skip to main content
Sunflower is Sunbird AI’s large language model, fine-tuned for Ugandan languages and cultural context. It can engage in multi-turn conversations, answer questions, and assist with translations.

Endpoints

We offer two ways to interact with Sunflower:
  1. Chat Inference (/tasks/sunflower_inference): For full multi-turn conversations with history.
  2. Simple Inference (/tasks/sunflower_simple): For single-turn instructions or questions.

Chat Inference (Multi-turn)

This endpoint expects a list of messages, allowing the model to maintain context.

Message Format

Each message in the list must have a role and content.
  • system: Sets the behavior and persona of the AI.
  • user: The input from the human user.
  • assistant: The response from the AI (used for history).

Example Request

import requests

url = "https://api.sunbird.ai/tasks/sunflower_inference"
payload = {
    "messages": [
        {"role": "system", "content": "You are a helpful assistant who speaks Luganda."},
        {"role": "user", "content": "Translate 'Welcome' to Luganda."},
        {"role": "assistant", "content": "In Luganda, 'Welcome' is 'Tukusanyukidde'."},
        {"role": "user", "content": "How do I respond to that?"}
    ]
}
headers = {
    "Authorization": "Bearer <YOUR_TOKEN>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)
print(response.json())

Response

{
  "output": {
    "role": "assistant",
    "content": "You can respond by saying 'Kale' (Okay) or 'Weebale' (Thank you)."
  }
}

Simple Inference (Single-turn)

Use this for quick questions where history doesn’t matter.

Parameters

  • instruction: The user’s prompt.
  • model_type: qwen (default) or gemma.
  • temperature: Controls creativity (0.0 - 1.0).

Example Request

import requests

url = "https://api.sunbird.ai/tasks/sunflower_simple"
payload = {
    "instruction": "Explain the concept of Ubuntu."
}
headers = {
    "Authorization": "Bearer <YOUR_TOKEN>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)