Know what language every message is in, before you act on it

    Detect the language of support tickets, chat messages, queries, and documents across 608 languages, built African-first and accurate on the short text real products see.

    Customer supportTrust & safetyFintech & KYCAnalytics
    0.906
    ACCURACY ON 1-5 WORDS, TRAFFIC MODE
    608
    LANGUAGES
    6,800/s
    TEXTS PER CPU THREAD (LITE)
    / The problem

    Why this breaks today

    Every multilingual pipeline starts with the same question: what language is this? Route on the wrong answer and the ticket lands with an agent who cannot read it, the moderation classifier scores gibberish, and the analytics dashboard reports a language mix that never existed.

    Off-the-shelf detectors are trained on web-scale text where Yorùbá, Igbo, and Hausa barely register. They are also tuned for paragraphs, so they degrade exactly where real products live: a six-word chat message or a three-word search query.

    / How it works

    The pipeline, step by step

    01

    Switch on traffic mode for user input

    Both models ship two modes. Traffic mode adjusts scores by each language’s real-world frequency, so short or ambiguous input leans toward the languages people actually write in. lid-neural-608 reaches 0.960 web-weighted accuracy, 0.906 on 1-5 word inputs and 0.943 on everyday phrases in this mode, ahead of GlotLID and Meta’s fastText LID.

    lid-neural-608
    02

    Put the fast model in front

    lid-lite-608 is a 37 MB fastText model with the same labels and modes, running about 6,800 texts per second on one CPU thread. Use it as a first pass and send only short or uncertain inputs to lid-neural-608.

    lid-lite-608
    03

    Route on the label, gate on the score

    Labels are ISO 639-3 plus script, such as yor_Latn or srp_Cyrl. Send the label to your queue or language-specific model, hold low-confidence predictions for review, and drop zxx_Zxxx, the noise class for numbers, URLs and code.

    / The code

    Running in about ten lines

    The Olaverse SDK wraps the models with sane defaults. If you would rather not add a dependency, the second tab is the same pipeline in plain transformers.

    $pip install "olaverse[deeplearning]"
    route.py
    from olaverse import LIDLite608, LIDNeural608
    
    fast = LIDLite608(mode="traffic")              # 37 MB, CPU
    accurate = LIDNeural608(mode="traffic")        # 140M, GPU or CPU
    
    def detect(message):
        probs = fast.predict_proba(message, top_k=1)
        lang, score = next(iter(probs.items()))
        # Short or uncertain input goes to the neural model
        if score < 0.9 or len(message.split()) <= 5:
            lang, score = max(accurate.predict_proba_batch([message])[0].items(), key=lambda kv: kv[1])
        return lang, score
    
    def route(message):
        lang, score = detect(message)
        if lang == "zxx_Zxxx":                     # numbers, URLs, code
            return "no-language"
        return LANGUAGE_QUEUES.get(lang, "human-review") if score > 0.9 else "human-review"
    
    route("Ẹ kú àárọ̀, ṣé dáadáa ni?")              # yor_Latn → the Yorùbá queue
    / This is you if
    • You run a support inbox, chat product, or marketplace where users write in more than one language.
    • Your existing detector handles English and French fine but guesses on Yorùbá, Igbo, or Hausa.
    • Your text is short: queries, messages, form fields, product titles.

    Every figure on this page comes from the published model cards. Download the weights and check us.

    Want this on your data?

    The weights are open, so you can build it yourself this afternoon. If you would rather we tuned it to your domain, evaluated it properly, and handed it over, tell us what you are working on.