File size: 1,550 Bytes
67d959b
 
 
 
eb12e0e
67d959b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
title: CHIP  Chinese High-density Instruction Protocol
emoji: 🀄
colorFrom: blue
colorTo: yellow
sdk: gradio
sdk_version: 4.44.0
app_file: app.py
pinned: true
license: apache-2.0
short_description: 数据驱动的中文 prompt 协议化压缩工具
tags:
  - chinese
  - prompt-engineering
  - llm
  - tokenizer
  - compression
---

# CHIP · 中文高密度提示协议

把啰嗦的中文 prompt 自动压成结构化高密度形式 — **数据驱动,不是品味**## 🎯 核心发现

基于 9 个主流 tokenizer × 200 句 FLORES-200 平行语料的 1800 行实测:

- **6 个国产 tokenizer 上中文 prompt token 数 ≤ 等价英文**
  (Baichuan2: 中文省 12.5%,DeepSeek-V3: 省 8.4%,GLM-4: 省 7.6%)
- **OpenAI cl100k 上中文比英文贵 73%**
- **`###` 标签在所有 9 个 tokenizer 上都是 1 token**,完爆方括号方案

## 🔧 怎么用

在左侧粘贴你的中文 prompt,选择目标模型,点压缩。右侧会展示:

1. **压缩后的 prompt**(可一键复制)
2. **Token 统计**(在你选的 tokenizer 上节省了多少)
3. **命中的规则**(audit trail,可追溯每条改动)

## 📦 GitHub / pip

```bash
pip install chip-prompt
```

```python
from chip import compress
compress("请你帮我对下面这段文字进行一个全面的分析")
# → '分析下面这段文字'
```

🔗 [GitHub repo](https://github.com/marcuscw/CHIP) · [SPEC.md](https://github.com/marcuscw/CHIP/blob/main/SPEC.md) · [Datasets](https://github.com/marcuscw/CHIP/tree/main/results)

## ⚖️ License

Apache-2.0