1from openai import OpenAI
23client = OpenAI(base_url="http://localhost:28000/v1", api_key="YOUR_KEY")45response = client.chat.completions.create(6 model="Ornith-397B-EXL3-HQ-35bpw",7 messages=[{"role":"user","content":"Write a Python REST API with Flask."}],8 temperature=0.3,9 max_tokens=2048,10)1112msg = response.choices[0].message
13print("Answer:", msg.content)14print("Reasoning:",getattr(msg,"reasoning_content",None))
Korean Language Patch (korean_fix.py)
Problem
Quantized MoE models using BPE tokenizers may produce U+FFFD (replacement character) for certain Korean words (실행, 결과, 선택, 아키텍처, etc.). This is caused by multi-byte Korean sub-tokens being structurally vulnerable to quantization noise — even at 8bpw attention precision.
Root cause: BPE byte-level sub-tokens for Korean syllables produce invalid UTF-8 sequences when the model predicts slightly wrong token IDs. This is a tokenizer-level issue, not a model quality issue.
Solution: Post-correction Module
korean_fix.py intercepts API responses and replaces U+FFFD patterns with context-appropriate Korean words.
Installation:
Copy korean_fix.py to your TabbyAPI directory:
cp korean_fix.py /path/to/tabbyAPI/
Patch TabbyAPI's exllamav3 backend to apply the fix. Add to backends/exllamav3/model.py:
python
1# At the top of the file, after existing imports:2try:3from korean_fix import fix_korean_ufffd
4def_fix_text(text):5return fix_korean_ufffd(text)if text else text
6except ImportError:7def_fix_text(text):8return text
910# In the generation loop, before yielding chunks:11chunk = _fix_text(chunk)# Apply Korean fix to each streaming chunk1213# In handle_finish_chunk:14"full_text": _fix_text(full_text),# Fix the complete response
Preceding/following text matched against keyword rules
3. Partial reconstruct
Korean chars adjacent to U+FFFD used to reconstruct full word
4. Frequency fallback
If no context match, uses most likely word (never outputs placeholder)
Covered Words
실행 (execution) 결과 (result) 선택 (selection) 설계 (design)
적용 (application) 구현 (implementation) 확인 (check) 평가 (evaluation)
아키텍처 (architecture) 다운로드 (download) 페이지 (page)
Ornith-1.0-397B is a 397B MoE model (post-trained on Qwen 3.5) specialized for agentic coding, achieving SOTA on Terminal-Bench 2.1, SWE-Bench, and NL2Repo.
Benchmark
Ornith-397B (BF16)
Terminal-Bench 2.1 (Terminus-2)
77.5
SWE-bench Verified
82.4
SWE-bench Pro
62.2
NL2Repo
48.2
ClawEval Avg
77.1
Citation
bibtex
1@misc{ornith_397b,
2 title = {{Ornith-1.0-397B}: Agentic Coding, Open to All},
3 url = {https://deep-reinforce.com/ornith_1_0.html},
4 author = {{DeepReinforce Team}},
5 year = {2026}
6}