Instructions to use Vipplav/telugu-bpe-23k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Vipplav/telugu-bpe-23k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Vipplav/telugu-bpe-23k")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Vipplav/telugu-bpe-23k", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Vipplav/telugu-bpe-23k with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Vipplav/telugu-bpe-23k" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Vipplav/telugu-bpe-23k", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Vipplav/telugu-bpe-23k
- SGLang
How to use Vipplav/telugu-bpe-23k with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Vipplav/telugu-bpe-23k" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Vipplav/telugu-bpe-23k", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Vipplav/telugu-bpe-23k" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Vipplav/telugu-bpe-23k", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Vipplav/telugu-bpe-23k with Docker Model Runner:
docker model run hf.co/Vipplav/telugu-bpe-23k
🔡 Telugu BPE Tokenizer (23k Vocab)
Purpose-built Tokenizer for Indic & Telugu Language Modeling
Developed by Vipplav AI — India's Most Specialized AI Studio
📌 Overview
Standard multilingual and Western LLM tokenizers (Llama, GPT-4, Mistral) heavily fragment Indic scripts, leading to high fertility rates (splitting a single Telugu word into 4 to 8 distinct tokens). This inflates inference latency, limits context window utility, and increases deployment costs.
Vipplav/telugu-bpe-23k is an optimized Byte-Pair Encoding (BPE) tokenizer trained on over 340,000+ cleaned Telugu text passages sourced from the AI4Bharat Sangraha dataset. It provides high compression efficiency and lower token fertility specifically for Telugu literature, news, and technical vocabulary.
🚀 Quickstart
1. Using with Hugging Face transformers
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("Vipplav/telugu-bpe-23k")
sample_text = "విప్లవ్ AI భారతదేశ భాషల కోసం కృత్రిమ మేధస్సును నిర్మిస్తోంది."
tokens = tokenizer.tokenize(sample_text)
token_ids = tokenizer.encode(sample_text)
print("Original Text:", sample_text)
print("Tokens:", tokens)
print("Token Count:", len(tokens))
2. Using with SentencePiece directly
import sentencepiece as spm
from huggingface_hub import hf_hub_download
model_path = hf_hub_download(repo_id="Vipplav/telugu-bpe-23k", filename="spiece.model")
sp = spm.SentencePieceProcessor(model_file=model_path)
pieces = sp.encode("తెలుగు వార్తలు మరియు సాంకేతిక సమాచారం", out_type=str)
print("SentencePiece pieces:", pieces)
📊 Key Highlights & Efficiency
- Vocabulary Size: 23,000 tokens
- Script Support: Native Telugu script with full conjunct, vowel modifier, and diacritic handling.
- Fertility Improvement: Reduces average tokens-per-word by up to 42% compared to standard Llama/Mistral tokenizers on Telugu corpora.
- Intended Use: Base tokenizer for Indic SLMs (Small Language Models), domain-specific pretraining, and regional language embeddings.
🏢 About Vipplav AI
Vipplav AI is an enterprise AI studio engineering foundational Indic Small Language Models (Rachana) and verifiable agentic automation pipelines.
- Website: https://www.vipplavai.com
- GitHub: https://github.com/vipplavai
- Contact: hello@vipplavai.com