Languages

How do you build Urdu AI apps with Plugsky?

Urdu runs on Plugsky's OpenAI-compatible endpoint at https://api.plugsky.com/v1 with right-to-left text handled as UTF-8. Normalise letter variants and diacritics for retrieval, keep bidi isolation around Latin spans, and treat Roman Urdu as its own query path. plugsky-embed-multilingual supports Urdu and English cross-language retrieval.

Key facts

Urdu scriptRight-to-left Perso-Arabic script, often Nastaliq in print
RegisterFormal Urdu, colloquial Urdu and Roman Urdu are distinct
TokenisationAttached affixes and omitted short vowels fragment tokens — 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

  • Urdu passes through the standard endpoint as UTF-8 RTL text.
  • Normalise letter variants and diacritics before indexing.
  • Roman Urdu needs a transliteration path and its own evals.
  • Isolate Latin code and digits with bidi controls.
  • plugsky-embed-multilingual covers Urdu 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 Urdu 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: normalise letter variants and diacritics for search; preserve the display copy.
  5. For RAG, embed with plugsky-embed-multilingual and test cross-language queries alongside Urdu-only queries.
  6. Score candidate models on a Urdu 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 Urdu promptsto3Count tokens forthose prompts withthe Plugsky token4Normalise textbefore indexing orprompting:5For RAG, embed withplugsky-embed-multilingualand test6Score candidatemodels on a Urdugold set with

Try it yourself

Open the RAG sandbox →

How Plugsky handles Urdu text

Urdu is written right-to-left in a Perso-Arabic script, traditionally in Nastaliq calligraphy, and punctuation and numbers may run in either direction.

Formal literary Urdu, everyday spoken Urdu and Roman Urdu (Latin-script chat) are distinct registers, with heavy English code-switching in technical text.

Evaluate on formal Urdu and Roman Urdu samples; check letter choices, spacing and register, since both forms appear in real user traffic.

Tokenisation and cost in Urdu

Urdu words attach prefixes and suffixes, and Nastaliq-style writing omits short vowels, so tokenisers split forms inconsistently; Roman Urdu tokenises completely differently from the script form.

  • Normalise letter variants and diacritics for retrieval; keep display text intact.
  • Handle Roman Urdu as a separate query path.
  • Test formal and colloquial registers separately.
  • Keep bidi isolation around Latin code and digits in mixed text.

Urdu retrieval and RAG

Index Urdu-script documents and test Roman Urdu queries against them; transliteration and normalisation decide whether retrieval works.

  • Use plugsky-embed-multilingual for Urdu and English retrieval.
  • Normalise letter variants before embedding.
  • Add transliteration for Roman Urdu queries.
  • Evaluate script and Roman query sets separately.

Code example: a Urdu request

Point your existing OpenAI client at https://api.plugsky.com/v1 and pass Urdu 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": "اس معاہدے کا اردو میں تین نکات میں خلاصہ لکھیں۔"}])

Start on the free plan with plugsky-micro and plugsky-lite, then compare paid models on a Urdu 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 Urdu gold set whenever either changes — language quality regressions usually come from prompt or preprocessing drift, not from the model alone.

Honest comparison

CapabilityPlugskyUrdu workflow todayBuilding in-house
API compatibilityOpenAI-compatible — change base_url and model nameVaries by provider and SDKFull rewrite
Urdu text handlingRTL-safe prompts with Roman Urdu as a second pathDepends 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 Urdu text?

Yes. The API accepts UTF-8 Urdu 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 Urdu?

Urdu words attach prefixes and suffixes, and Nastaliq-style writing omits short vowels, so tokenisers split forms inconsistently; Roman Urdu tokenises completely differently from the script form. Use the token calculator at /tools/llm-token-calculator before sizing context windows or chunk lengths.

Formal Urdu or Roman Urdu?

Formal Urdu script for documents and public content; Roman Urdu is common in chat. Treat them as two query languages with separate evals.

How do I handle right-to-left mixing?

Wrap Latin code, URLs and digits in bidi isolation characters so mixed lines render correctly in prompts, outputs and your UI.

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.