Text Generation
Transformers
Safetensors
Korean
English
qwen3
vocabulary-trimming
trimming
korean
english
conversational
text-generation-inference
Instructions to use ceyda/Qwen3-1.7B-Base-trim-koen-32768 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ceyda/Qwen3-1.7B-Base-trim-koen-32768 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ceyda/Qwen3-1.7B-Base-trim-koen-32768") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ceyda/Qwen3-1.7B-Base-trim-koen-32768") model = AutoModelForCausalLM.from_pretrained("ceyda/Qwen3-1.7B-Base-trim-koen-32768", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ceyda/Qwen3-1.7B-Base-trim-koen-32768 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ceyda/Qwen3-1.7B-Base-trim-koen-32768" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ceyda/Qwen3-1.7B-Base-trim-koen-32768", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ceyda/Qwen3-1.7B-Base-trim-koen-32768
- SGLang
How to use ceyda/Qwen3-1.7B-Base-trim-koen-32768 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 "ceyda/Qwen3-1.7B-Base-trim-koen-32768" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ceyda/Qwen3-1.7B-Base-trim-koen-32768", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "ceyda/Qwen3-1.7B-Base-trim-koen-32768" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ceyda/Qwen3-1.7B-Base-trim-koen-32768", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ceyda/Qwen3-1.7B-Base-trim-koen-32768 with Docker Model Runner:
docker model run hf.co/ceyda/Qwen3-1.7B-Base-trim-koen-32768
Qwen3-1.7B-Base โ vocabulary-trimmed (Korean + English, 32,768)
A vocabulary-trimmed version of Qwen/Qwen3-1.7B-Base:
the byte-level BPE vocabulary is reduced from ~151.7k to 32768 tokens covering Korean + English,
and the (tied) embedding matrix is sliced to match. No retraining โ weights are copied verbatim for
kept tokens, so on kept tokens the model is numerically identical to the original.
Method: Introduction to Trimming.
What changed
| Original | Trimmed | |
|---|---|---|
| Parameters | 1,720,574,976 | 1,476,518,912 (-14.2%) |
| Vocab size | 151,669 | 32,768 |
| Merges | 151,387 | 32,486 |
| Embedding | tied | tied (sliced) |
- All 256 byte-level tokens + all 26 special tokens are kept, plus the most frequent Korean/English tokens and their full BPE merge-derivation closure (so multi-byte Korean stays reachable).
- Verified: lossless round-trip on KO/EN/code; teacher-forced logit equivalence
max|ฮ| = 0.0; greedy generation on natural Korean/English is token-for-token identical to the base model.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "ceyda/Qwen3-1.7B-Base-trim-koen-32768"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo)
ids = tok("๋ํ๋ฏผ๊ตญ์ ์๋๋", return_tensors="pt")
print(tok.decode(model.generate(**ids, max_new_tokens=20)[0], skip_special_tokens=True))
Limitations
- Trimmed for Korean + English prose. Code and rare jargon still encode losslessly but may split into a few extra tokens. Text in other languages falls back to byte tokens (longer sequences).
- This is a base (non-instruction-tuned) model.
Attribution
Derived from Qwen/Qwen3-1.7B-Base (Apache-2.0). Trimming method by Loรฏck Bourdois.
- Downloads last month
- 325
Model tree for ceyda/Qwen3-1.7B-Base-trim-koen-32768
Base model
Qwen/Qwen3-1.7B-Base