메뉴
HN
Hacker News • 59일 전

모든 LLM 토큰이 같은 너비로 표시되는 폰트 컴파일러

IMP
4/10
핵심 요약

해커뉴스에 올라온 이 프로젝트는 기존 폰트와 LLM 토크나이저를 결합해 각 토큰의 렌더링 너비가 동일해지는 '토큰 공간 폰트'를 컴파일하는 도구입니다. DeepSeek, Llama, Qwen 등 다양한 토크나이저와 Inter, Roboto 등 여러 베이스 폰트를 지원하며, 브라우저에서 전부 처리되어 파일이 로컬에만 남습니다. 컴파일된 폰트는 Discord(Vesktop) 테마로 적용해 특정 사용자의 메시지를 토큰 단위 시각화하는 데에도 쓸 수 있어, LLM이 텍스트를 어떻게 토큰화하는지 직관적으로 체감할 수 있게 해줍니다.

번역된 본문

토큰 공간 폰트 컴파일러: 폰트 + 토크나이저 → 각 토큰이 동일한 너비를 갖는 토큰 공간 폰트를 생성합니다.

직접 사용해 보세요. 예시 문장들:

  • "The quick brown fox ate the load-bearing strawberry"(재빠른 갈색 여우가 하중받침 딸기를 먹었다)
  • "You have nothing to lose but your chains of thought"(사고의 사슬 말고는 잃을 게 없다)
  • "I hope this helps the user gain empathy for the assistant"(이것이 사용자가 어시스턴트에게 공감을 갖게 돕기를)

위에 텍스트를 입력하거나 붙여넣으세요. 새 폰트를 컴파일하면 이 미리보기가 해당 폰트로 전환됩니다. 'DeepSeek + Inter 다시 사용' 버튼이나 '직접 컴파일'을 누를 수 있습니다.

베이스 폰트 선택: Inter, gg sans(Discord), SF Compact — SF Pro 너비, Roboto, Lora, SF Mono, Ubuntu Mono, JetBrains Mono, Bebas Neue, Caveat, 또는 TTF/OTF/WOFF/WOFF2 폰트 업로드.

토크나이저 선택: DeepSeek V4.1 Flash, ctok v4.8, ctok v4.7, ctok v3, o200k_base, cl100k_base, p50k_base, r50k_base, Kimi K3, GLM-5.3(실험적), Llama 3(실험적), Trinity Large Thinking(실험적), Laguna M.1(실험적), Qwen 3.6, Gemma 4(실험적), Gemini 3.5 Flash(실험적), Hugging Face 저장소 링크 붙여넣기(실험적), 토크나이저 업로드(실험적).

토크나이저 불러오기: 공개 저장소 URL 또는 owner/model 형식. tokenizer.json을 다운로드하며, 폰트는 로컬에 유지됩니다.

정규식 경계가 있는 OpenAI 폰트. 특수 토큰은 일반 텍스트로 취급되며, 브라우저의 셰이핑(shaping) 처리가 결과에 영향을 줄 수 있습니다. 병합 가능한 모든 어휘 항목이 포함됩니다. 이 폰트는 스크립트 없이도 동작합니다.

프리셋 상세: 폰트만으로 최소 비용 분할을 수행하며 근사 유니코드 ctok 정규화기를 사용합니다. 독립 컴포넌트당 256단계 탐색 제한, 메시지 프레임은 제외. 이는 Claude를 근사한 것으로, 실제 Claude 토큰 경계로 확인된 것은 아닙니다. 전체 어휘가 포함되며, 보이는 범위는 베이스 폰트에 따라 다릅니다. 보이지 않는 서식 문자가 단어 경계를 방해할 수 있고, v3/v4.7에는 선행 공백 정규화 오류가 있습니다. 용량 초과 영역은 [limit]으로 표시됩니다.

호환성 상세: 토크나이저 이름은 컴파일된 폰트에서 베이스 폰트 이름과 결합됩니다.

라이트 모드로 컴파일(BPE Fonts와 Gemini만 해당): 라이트 모드는 더 작은 폰트를 생성하고 때로 컴파일이 더 빠르지만, 텍스트 렌더링이 느려질 수 있습니다.

폴백 폰트 사용: Noto가 누락된 텍스트 문자와 기본적으로 단색 이모지를 제공합니다. 베이스 폰트가 우선 적용됩니다. 필요한 폰트_face만 다운로드하여 그 아트워크를 폰트에 컴파일합니다. 커버리지는 다양하며, 복잡한 문자 셰이핑은 여전히 제한적입니다.

소스 및 라이선스: 이모지 폴백: Noto Emoji, Mutant Standard(컬러). '폴백 폰트 사용' 활성화 시 적용됩니다. Caius Nocturne의 Mutant Standard 아트워크는 CC BY-NC-SA 4.0 라이선스를 따릅니다: 상업적 사용 불가, 출처 표시, 라이선스 링크, 변경 사항 표시 필요. 공유 개작물은 동일 라이선스를 사용해야 합니다. 이는 컴파일된 폰트에 포함된 이모지 아트워크에도 적용됩니다.

폰트 컴파일 / 취소 / 폰트 다운로드 · CSS · 빌드 리포트. 사용자의 파일은 이 브라우저에만 남습니다. 큰 토크나이저는 수 분이 걸릴 수 있습니다.

Vesktop으로 Discord에서 사용하기: 테마 폰트: DeepSeek V4.1 Flash × Inter Discord 사용자 ID(선택 사항): 비워 두면 모든 메시지에 적용됩니다. 특정 사용자('em')의 ID를 입력해 해당 사용자의 메시지만 토큰 폰트로 표시할 것을 강력히 권장합니다.

Vesktop 테마 다운로드 및 설정 방법:

  1. gg sans를 사용하려면 위에서 gg sans(Discord)를 선택하고, 토크나이저 프리셋을 고르거나 업로드한 뒤 '폰트 컴파일'을 클릭합니다. 테마 다운로드는 항상 현재 미리보기의 폰트와 일치합니다.
  2. 폰트를 다운로드하고 TTF를 Font Book(폰트 북)에서 엽니다. '설치(Install)'를 클릭합니다. 일반 gg sans가 이미 있더라도 컴파일된 폰트를 설치하세요.
  3. 위에서 특정 사용자의 Discord ID를 입력할 것을 강력히 권장합니다. 비워 두면 모든 메시지에 적용됩니다.
  4. .theme.css 파일을 다운로드합니다. ID를 찾으려면 Discord의 설정 → 고급 → 개발자 모드를 켜고, 사용자를 우클릭해 '사용자 ID 복사'를 선택하세요.
  5. ID를 입력했다면 Vesktop의 설정 → Vencord → 플러그인에서 ThemeAttributes를 활성화하세요. 요청되면 재시작합니다.
  6. 설정 → Vencord → 테마 → 로컬 테마 → 테마 폴더 열기를 누릅니다. 다운로드한 .theme.css 파일을 그 폴더로 이동합니다.
  7. 테마로 돌아가 필요시 '누락된 테마 불러오기'를 클릭하고 테마를 활성화하세요.
  8. ⌘Q로 Vesktop을 완전히 종료한 뒤 다시 열어 설치된 폰트를 인식시키세요.
  9. Vencord Location 설정은 현재 값 그대로 유지하세요.
원문 보기
원문 보기 (영어)
Token-space font compiler font + tokenizer → token-space font, where each token is equal width Try it! The quick brown fox ate the load-bearing strawberry You have nothing to lose but your chains of thought I hope this helps the user gain empathy for the assistant Type or paste your text above. Compiling a new font switches this preview to it. Use DeepSeek + Inter again Compile your own Base font Inter gg sans (Discord) SF Compact — SF Pro widths Roboto Lora SF Mono Ubuntu Mono JetBrains Mono Bebas Neue Caveat Upload a font TTF, OTF, WOFF or WOFF2 Tokenizer DeepSeek V4.1 Flash ctok v4.8 ctok v4.7 ctok v3 o200k_base cl100k_base p50k_base r50k_base Kimi K3 GLM-5.3 (experimental) Llama 3 (experimental) Trinity Large Thinking (experimental) Laguna M.1 (experimental) Qwen 3.6 Gemma 4 (experimental) Gemini 3.5 Flash (experimental) Paste Hugging Face repo link… (experimental) Upload a tokenizer (experimental) Load tokenizer Public repo URL or owner/model. Downloads tokenizer.json; your font stays local. Hugging Face tokenizer.json OpenAI font with regex boundaries. Special tokens are treated as ordinary text; browser shaping runs can affect results. All mergeable vocabulary entries are included. The font works without scripts. Preset details . Font-only minimum-cost segmentation with an approximate Unicode ctok normalizer. A 256-step search limit per independent component; excludes the message frame. This approximates Claude, not confirmed Claude token boundaries. Includes the full vocabulary; visible coverage depends on your base font. Invisible format characters can disrupt word boundaries, and v3/v4.7 have leading-space normalization errors. Over-capacity regions display [limit]. Compatibility details . Tokenizer name Combined with the base font’s name in the compiled font. Compile in lite mode (BPE Fonts and Gemini only) Lite mode produces a smaller font and sometimes compiles faster, but may make text slower to render. Use fallback fonts Noto supplies missing text characters and, by default, monochrome emoji. Your base font stays primary. Downloads only needed faces and compiles their artwork into the font. Coverage varies; complex-script shaping remains limited. Sources and licenses . Emoji fallback Noto Emoji Mutant Standard (color) Applied when Use fallback fonts is enabled. Mutant Standard artwork by Caius Nocturne is licensed under CC BY-NC-SA 4.0 : no commercial use; give attribution, link the license, and indicate changes. Shared adaptations must use the same license. This applies to the emoji artwork embedded in your compiled font. Compile font Cancel Download font · CSS · Build report Your files stay in this browser. Large tokenizers can take several minutes. Use it in Discord with Vesktop Theme font: DeepSeek V4.1 Flash × Inter Discord user ID (optional) Leave blank to apply to all messages. We strongly recommend entering a specific em’s ID so only its messages use the token font. Download Vesktop theme Setup instructions To use gg sans, select gg sans (Discord) above, choose a tokenizer preset or upload, and click Compile font . The theme download always matches the font currently in the preview. Download the font and open the TTF in Font Book. Click Install . Install the compiled font, even if you already have ordinary gg sans. We strongly recommend entering a specific em’s Discord ID above; leaving it blank applies to all messages. Download the .theme.css file. To find an ID, enable Discord’s Settings → Advanced → Developer Mode , then right-click the user and choose Copy User ID . If you entered an ID, open Vesktop’s Settings → Vencord → Plugins and enable ThemeAttributes . Restart if prompted. Open Settings → Vencord → Themes → Local Themes → Open Themes Folder . Move the downloaded .theme.css file into that folder. Return to Themes, click Load Missing Themes if needed, and enable the theme. Fully quit Vesktop with ⌘Q and reopen it so it sees the installed font. Keep Vencord Location at its current setting. This is a theme, so no custom Vencord build or UserFonts plugin is needed. Disable older font themes for the same user if they conflict. If messages look unchanged, check that the compiled font is installed and this theme is enabled. If targeting an ID, also check that ThemeAttributes is enabled and the ID is correct. Code blocks keep Discord’s normal monospace font. Extra token spacing defaults to zero; line height and word spacing follow Discord. Use it in Slack Slack font: DeepSeek V4.1 Flash × Inter Agent display names or member IDs Use the exact display name shown above each agent’s messages, or a Slack member ID such as U012345678. One per line. Only matching messages change. Download Slack userscript Setup instructions Download the font above and install its TTF on the device where you read Slack. Enter the agents’ Slack display names or member IDs, then download the .user.js file. Import the file into a userscript manager in your browser, enable it, and reload web Slack. The userscript reads sender labels in the page and styles matching message text, including new messages and threads. It makes no network requests and does not modify message text. Code blocks keep a monospace font. If you compile another font, download and install that font and its newly generated userscript together. Disable an older Token Mono Slack script if it targets the same agent. This works in web Slack in a browser with a userscript manager. Browser shaping runs and formatting spans can change token boundaries. What works? The listed presets use tokenizer-specific compiler paths. These include DeepSeek, OpenAI, Kimi, Qwen, GLM, Llama 3, Trinity and Laguna; Gemma and Gemini have experimental space-marker/byte-fallback support. ctok uses a separate minimum-cost backend. Raw ByteLevel BPE is also accepted with use_regex: false and add_prefix_space: false . Uploaded pipelines must match a supported profile; arbitrary normalizers, WordPiece and Unigram are not generally supported. Acceptance does not imply exact tokenization for every input. The output is a single TTF with the tokenizer built into its shaping rules. No tokenizer script is needed to display it. It uses your font’s default variation and character coverage. Missing characters may use missing-glyph outlines or system fallback unless you enable fallback fonts, which embeds selected fallback outlines in the same token font. Coverage still depends on the selected sources. Noto Emoji is the default emoji fallback; Mutant Standard is an optional color source with separate license requirements. The precompiled DeepSeek + Inter preview already includes Noto Emoji. Within a supported shaping run, each emitted token occupies 3 em. Extra token spacing defaults to zero and is capped at 0.5 em. The generated CSS leaves word spacing and line height alone. Browser tab stops, hard line breaks and whitespace processing do not behave like ordinary token cells. N.B. Browser shaping runs, line breaks, normalization and complex scripts can change the result. Supported horizontal pair kerning is retained, but contextual shaping is not universally preserved. This is a token font, not an exact whole-message token counter. Known discrepancies and experimental features The latest whitespace audit compared 17,904 BPE checks across six available font binaries and 2,355 ctok cases against local tokenizer references. Browser checks covered 60 widths and 20 wrapping samples. These are targeted tests, not a guarantee for all text; failures and coverage/capacity limits remain in the reports. DeepSeek whitespace: U+001C–U+001F controls are incorrectly classified as whitespace. For example, two spaces followed by U+001C merge into one space token. The directed audit found 59 ID mismatches in 2,984 checks. Ordinary isolated whitespace runs and CRLF cases passed; the control-separator bug remains unfixed. GLM-5.3 and Llama 3: the experimental presets use font-only regex boundaries, ranked BPE and whole-piece shortcuts. The tes