Languages

How do you build Thai AI apps with Plugsky?

Plugsky processes Thai through the OpenAI-compatible API at https://api.plugsky.com/v1. Because Thai has no word spaces, budget context by measured tokens after segmentation, normalise combining marks, and index with a Thai-aware segmenter. Use plugsky-embed-multilingual for Thai and English retrieval and evaluate polite and colloquial registers separately.

Key facts

Thai scriptNo word spaces; vowels and tone marks combine with consonants
SegmentationThai needs a word segmenter for indexing — spaces are not delimiters
TokenisationSegmentation choices change token counts — 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

  • Thai works on the standard /v1/chat/completions endpoint.
  • Segment Thai words before chunking or keyword indexing.
  • NFC-normalise vowel and tone marks.
  • Measure tokens after segmentation for context sizing.
  • plugsky-embed-multilingual covers Thai 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 Thai 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: NFC-normalise combining marks and segment words before indexing.
  5. For RAG, embed with plugsky-embed-multilingual and test cross-language queries alongside Thai-only queries.
  6. Score candidate models on a Thai 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 Thai promptsto3Count tokens forthose prompts withthe Plugsky token4Normalise textbefore indexing orprompting:5For RAG, embed withplugsky-embed-multilingualand test6Score candidatemodels on a Thaigold set with

Try it yourself

Open the token calculator →

How Plugsky handles Thai text

Thai is written in the Thai script with no spaces between words; vowels can appear before, after, above or below consonants, and tone marks stack on top.

Formal written Thai and colloquial chat Thai differ in pronouns and particles such as ครับ and ค่ะ, and transliterated Thai is common online.

Evaluate with a Thai reviewer on polite and casual samples; check segmentation-dependent spelling, tone marks and whether particles match the intended register.

Tokenisation and cost in Thai

Without spaces, tokenisers must segment Thai statistically, and segmentation errors change token counts and meaning. Combining vowel and tone marks add code points that may split or merge unpredictably.

  • Segment Thai before keyword indexing; do not split on spaces.
  • Normalise combining marks consistently with NFC before embedding.
  • Test polite particles and colloquial chat style separately.
  • Measure tokens after segmentation, not by character count.

Thai retrieval and RAG

Thai retrieval depends on segmentation: use a Thai-aware segmenter for keyword search, and let multilingual embeddings handle meaning.

  • Use plugsky-embed-multilingual for Thai and English corpora.
  • Segment with a Thai tokeniser before keyword indexing.
  • Normalise combining marks and numerals.
  • Evaluate formal and chat-style queries separately.

Code example: a Thai request

Point your existing OpenAI client at https://api.plugsky.com/v1 and pass Thai 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 Thai 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 Thai gold set whenever either changes — language quality regressions usually come from prompt or preprocessing drift, not from the model alone.

Honest comparison

CapabilityPlugskyThai workflow todayBuilding in-house
API compatibilityOpenAI-compatible — change base_url and model nameVaries by provider and SDKFull rewrite
Thai text handlingSegmenter-based indexing with NFC combining marksDepends 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 Thai text?

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

Without spaces, tokenisers must segment Thai statistically, and segmentation errors change token counts and meaning. Use the token calculator at /tools/llm-token-calculator before sizing context windows or chunk lengths.

Do I need a Thai word segmenter?

For keyword search and chunking, yes. Thai has no spaces, so segmentation is required; embeddings handle meaning without explicit segmentation.

How do polite particles affect output?

ครับ and ค่ะ signal politeness and speaker gender. Tell the model the expected register in the system prompt to keep them consistent.

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.