Languages

How do you build Vietnamese AI apps with Plugsky?

Vietnamese uses Latin script with tone diacritics on most syllables, and combining-mark encoding changes token counts. Plugsky serves it on the standard OpenAI-compatible endpoint — set base_url to https://api.plugsky.com/v1 and send UTF-8 text to /v1/chat/completions. Normalise to NFC early, add accent-insensitive search keys for mobile users, and use plugsky-embed-multilingual for Vietnamese and English retrieval.

Key facts

Vietnamese textLatin script with tone diacritics on most syllables; six tones are meaningful
NormalisationNFC versus NFD changes code points and token counts — normalise early
TokenisationDiacritic-heavy text fragments into more subwords — measure with the token calculator
Regional accentsNorthern, central and southern speech differ in tone and vocabulary
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
Product statusChat, streaming, JSON mode, function calling, embeddings, RAG and agents live; audio, images, moderation, files, batch, fine-tuning, assistants and responses coming soon

TL;DR

  • Vietnamese runs on the standard endpoint with one base_url change.
  • Normalise to NFC before counting tokens or embedding.
  • Add accent-insensitive keys so search works on phones without diacritic keyboards.
  • Separate northern, central and southern evaluation slices.
  • plugsky-embed-multilingual covers Vietnamese and English retrieval.

How it works, step by step

  1. Create a free Plugsky key and set base_url to https://api.plugsky.com/v1.
  2. Normalise all input to NFC before sending text, counting tokens or embedding.
  3. Send real Vietnamese prompts to /v1/chat/completions and compare two or three models.
  4. Measure tokens with the token calculator and note the diacritic load in your content.
  5. For search, add accent-insensitive keys and test queries typed without diacritics.
  6. For RAG, embed with plugsky-embed-multilingual and review outputs with native speakers.
1Create a freePlugsky key and setbase_url to2Normalise all inputto NFC beforesending text,3Send realVietnamese promptsto4Measure tokens withthe tokencalculator and note5For search, addaccent-insensitivekeys and test6For RAG, embed withplugsky-embed-multilingualand review outputs

Try it yourself

Open the tokenizer →

How Plugsky handles Vietnamese text

Vietnamese needs no special endpoint: UTF-8 text with tone diacritics goes in and comes back. The engineering issue is encoding form. The same accented letter can be represented as one precomposed code point (NFC) or as a base letter plus a combining mark (NFD); both look identical on screen but tokenise and match differently. Normalising to NFC at the edge removes a whole class of bugs.

Regional speech also matters for consumer products. Northern, central and southern Vietnamese differ in tone realisation and vocabulary, so if your reviewers or users cluster in one region, state which variety the product should write.

Tokenisation and cost in Vietnamese

Vietnamese syllables are short, but each carries diacritics that can split into separate subwords depending on the tokeniser and the encoding form. Accent-heavy prose therefore costs more tokens than the character count suggests, and mixed NFD input can quietly increase counts without changing the text.

  • Normalise to NFC before measuring or embedding.
  • Keep diacritics for display and embedding; fold only for search keys.
  • Test mobile input where users drop tones.
  • Re-measure after model or pipeline changes.

Vietnamese retrieval and RAG

One multilingual collection built with plugsky-embed-multilingual serves Vietnamese documents with Vietnamese or English queries. On phones, users often type without tone marks, so search needs an accent-insensitive path alongside exact matching.

  • Add accent-insensitive keys for keyword search.
  • Normalise NFC consistently across documents and queries.
  • Include English queries common in technical audiences.
  • Keep one embedding model per collection.

Code example: a Vietnamese request

Point your OpenAI client at https://api.plugsky.com/v1; normalise the text before sending if your source data may be NFD.

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": "system", "content": "Trả lời bằng tiếng Việt, giọng lịch sự và ngắn gọn"}, {"role": "user", "content": "Tóm tắt hợp đồng này trong ba điểm"}])

Start on the free plan with plugsky-micro and plugsky-lite, then compare paid models on a Vietnamese gold set. See the docs for the API reference.

Honest comparison

CapabilityPlugskyVietnamese apps todayBuilding in-house
API compatibilityOpenAI-compatible — change base_url and model nameVaries by provider and SDKFull rewrite
Vietnamese text handlingUTF-8 with NFC guidance and accent-insensitive searchDepends on provider tokeniser and preprocessingYou build normalisation and evals
Token budgetFixed tokeniser per model; measure diacritic-heavy text and chunk to fitVaries by provider and modelYou host and tune each tokeniser
Multilingual retrievalplugsky-embed-multilingual for Vietnamese and English 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 Vietnamese text?

Yes. The API accepts UTF-8 Vietnamese input with tone diacritics on the OpenAI-compatible chat endpoint. Compare two or three models on your own prompts.

What is the NFC versus NFD issue?

Accented letters can be encoded as one code point or as a base letter plus a combining mark. Normalising to NFC before tokenising, embedding or matching prevents silent duplication and mismatches.

Should search require correct diacritics?

No. Many users type without tone marks, so add an accent-insensitive search path while keeping diacritics for display and embeddings.

Do regional accents need separate handling?

Vocabulary and some tone conventions differ between north, centre and south. Keep review slices per region if your audience is regionally concentrated.

Is there a multilingual embedding model?

Yes — plugsky-embed-multilingual is part of the 30+ model catalogue and supports Vietnamese and English retrieval from one collection.

Can I deploy in my own environment?

Yes. Plugsky supports cloud, VPC, on-prem and air-gapped deployment with residency options for regulated teams.

Is there a free plan?

Yes — plugsky-micro and plugsky-lite are free with no card, and a 14-day full-access trial covers the paid catalogue.