Languages

How do you build Swahili AI apps with Plugsky?

Plugsky serves Swahili on the same OpenAI-compatible API: change base_url to https://api.plugsky.com/v1 and send UTF-8 text to /v1/chat/completions. Agglutinated verb and noun-class forms fragment into tokens, and English code-switching is normal, so measure mixed text and use plugsky-embed-multilingual for Swahili and English retrieval.

Key facts

Swahili textLatin script, Bantu noun classes and agglutinative verb forms
Code-switchingEnglish mixing is common in technical and business text
TokenisationMorpheme-heavy forms split into subwords — measure with the Plugsky token calculator
API compatibilityOpenAI-compatible POST https://api.plugsky.com/v1/chat/completions — chat, streaming, JSON mode and function calling
Models30+ models behind one endpoint, from free tiers to frontier reasoning
Free tierFree plan with plugsky-micro and plugsky-lite, no card required
DeploymentPlugsky cloud, your VPC, on-prem and air-gapped options
Product statusChat, streaming, JSON mode, function calling, embeddings, RAG and agents live; audio, images, batch and fine-tuning coming soon

TL;DR

  • Swahili works through the standard chat endpoint — one base_url change.
  • Agglutinated forms split into tokens; measure mixed sentences.
  • Treat English code-switching as expected, not an error.
  • Stem prefixes for search; keep them for display.
  • plugsky-embed-multilingual covers Swahili and English retrieval.

How it works, step by step

  1. Create a Plugsky API key on the free plan (no card) and set base_url to https://api.plugsky.com/v1.
  2. Send a small set of real Swahili prompts to /v1/chat/completions and compare output across two or three models.
  3. Count tokens for those prompts with the Plugsky token calculator and set chunk sizes that fit your model context.
  4. Normalise text before indexing or prompting: standardise spelling variants and keep English loanwords as written.
  5. For RAG, embed with plugsky-embed-multilingual and test cross-language queries alongside Swahili-only queries.
  6. Score candidate models on a Swahili gold set with native-speaker review, then cut production traffic over.
1Create a PlugskyAPI key on the freeplan (no card) and2Send a small set ofreal Swahiliprompts to3Count tokens forthose prompts withthe Plugsky token4Normalise textbefore indexing orprompting:5For RAG, embed withplugsky-embed-multilingualand test6Score candidatemodels on a Swahiligold set with

Try it yourself

Open the token calculator →

How Plugsky handles Swahili text

Swahili uses the Latin alphabet and reads left to right, with Bantu noun-class prefixes and agglutinative verb forms.

Standard Kiswahili (Tanzania) and Kenyan usage differ slightly, and English code-switching is common in technical and business text.

Evaluate with a Swahili speaker on pure and code-switched samples; check noun-class agreement, which is the most common error and easy to spot.

Tokenisation and cost in Swahili

Swahili words carry prefixes for noun class, tense and person, so tokens often split at morpheme boundaries; code-switched English words tokenise like English, making mixed sentences uneven.

  • Keep noun-class prefixes intact for display; stem them for search.
  • Handle English code-switching as part of the same corpus.
  • Test Tanzanian and Kenyan spelling and vocabulary variants.
  • Count tokens on mixed Swahili and English text, not pure Swahili only.

Swahili retrieval and RAG

Index Swahili documents with their English loanwords and test queries that mix both languages, because users rarely stay in one language.

  • Use plugsky-embed-multilingual for Swahili and English corpora.
  • Keep code-switched sentences whole when chunking.
  • Add stemmed keys for agglutinated forms.
  • Evaluate pure and mixed-language queries.

Code example: a Swahili request

Point your existing OpenAI client at https://api.plugsky.com/v1 and pass Swahili text in the content field — no language flag and no separate endpoint. Streaming, JSON mode and function calling keep the same request shapes.

client = OpenAI(base_url="https://api.plugsky.com/v1", api_key=os.environ["PLUGSKY_API_KEY"])

client.chat.completions.create(model="plugsky-pro", messages=[{"role": "user", "content": "Fanya muhtasari wa mkataba huu kwa Kiswahili, pointi tatu."}])

Start on the free plan with plugsky-micro and plugsky-lite, then compare paid models on a Swahili gold set before cutover. See the docs for request details.

For production, log the model name and your normalisation settings with each request, and re-run the Swahili gold set whenever either changes — language quality regressions usually come from prompt or preprocessing drift, not from the model alone.

Honest comparison

CapabilityPlugskySwahili workflow todayBuilding in-house
API compatibilityOpenAI-compatible — change base_url and model nameVaries by provider and SDKFull rewrite
Swahili text handlingAgglutinated forms plus expected English code-switchingDepends on provider tokeniser and prompt hygieneYou build normalisation, segmentation and evals
Token budgetFixed tokeniser per model; measure with the Plugsky token calculator and chunk to fitVaries by provider and modelYou host and tune each tokeniser
Multilingual retrievalplugsky-embed-multilingual available for cross-language RAGOften needs a separate embedding vendorYou serve and maintain embeddings
SovereigntyCloud, VPC, on-prem and air-gapped with residency optionsUsually US/EU public endpointsYou own the full stack

Frequently asked questions

Can Plugsky handle Swahili text?

Yes. The API accepts UTF-8 Swahili input on the OpenAI-compatible chat endpoint; output quality depends on the model, so compare two or three on your own prompts before choosing.

How do I estimate token usage for Swahili?

Swahili words carry prefixes for noun class, tense and person, so tokens often split at morpheme boundaries; code-switched English words tokenise like English, making mixed sentences uneven. Use the token calculator at /tools/llm-token-calculator before sizing context windows or chunk lengths.

Is English mixing acceptable in Swahili output?

Define the policy per product. Technical content commonly mixes English terms; consumer chat often does not. State the preference in the system prompt.

Which Swahili standard should I use?

Standard Kiswahili is the safest default. Keep Kenyan and Tanzanian vocabulary variants in separate eval slices if you serve both markets.

Is there a multilingual embedding model?

Yes — plugsky-embed-multilingual is part of the 30+ model catalogue and is built for cross-language retrieval. Keep one embedding model per vector collection.

Can I keep data in my region?

Plugsky supports cloud, VPC, on-prem and air-gapped deployment with data-residency options; confirm your requirements with the docs and the enterprise team.

How do I migrate an existing app?

Change base_url to https://api.plugsky.com/v1 and map the model name. Streaming, JSON mode, function calling and embeddings keep the same request shapes.

Is there a free plan?

Yes — the free plan includes two free models, plugsky-micro and plugsky-lite, with no card. A 14-day full-access trial unlocks the paid catalogue.