| Head | Classes | Accuracy | Dataset |
|---|---|---|---|
| coarse | 12 | 100% | Synthetic eval |
| modality | 8 | 100% | Synthetic eval |
| subtype | 24 | 93.8% | Synthetic eval |
| code_lang | 62 | 60.3% | The Heap — 24 real-world langs, 1,200 samples |
| text_lang | 30 | 98.3% | Wikipedia — 30 langs, 1,500 samples |
| file_mime | 90 | 100% | Synthetic eval |
| risk (mAP) | 6 | 100% | Synthetic eval |
| Excellent (90%+) | Good (70–89%) | Needs Work (<50%) |
|---|---|---|
| cpp 96%, dart 98%, erlang 98%, rust 98%, r 94%, swift 92%, python 88%, lua 88% | go 86%, ruby 86%, ocaml 84%, php 78%, csharp 76%, java 76%, kotlin 76%, c 62% | perl 50%, haskell 24%, scala 4%, javascript 2%, clojure 0%, elixir 0%, julia 0%, sql 0% |
Note: Low-accuracy languages have fewer real training samples. More data will improve them.
pip install picotype1# Classify from stdin
2echo "def hello(name):\n return f'Hi {name}'" | picotype --pretty
3
4# Classify a file
5picotype --file document.txt
6
7# Classify clipboard content
8picotype --clip
9
10# All 4 tiers available
11echo "..." | picotype --tier pro1from picotype import load_onnx_model, run_onnx
2
3session = load_onnx_model("base")
4result = run_onnx(session, "def hello(): pass")
5print(result)
6# {
7# "coarse": "code",
8# "code_language": "python",
9# "modality": "textual",
10# "confidence": 0.98,
11# ...
12# }1pip install picotype
2PICOTYPE_MODEL_DIR=./checkpoints python -m model.pico_type.mcp_server1{
2 "mcpServers": {
3 "pico-type": {
4 "command": "python",
5 "args": ["-m", "model.pico_type.mcp_server"],
6 "env": { "PICOTYPE_MODEL_DIR": "./checkpoints" }
7 }
8 }
9}Bytes ─▶ ByteEmbed(256→96d) ─▶ 3×Conv1D(k=3,5,7) ─▶ 2×BiAttention(RoPE) ─▶ Pool ─▶ 7×Matryoshka Heads| Component | Detail |
|---|---|
| ByteEmbed | Lookup-free embedding — each byte value (0–255) maps to a learned 96-dim vector |
| Conv1D | 3 parallel depthwise convolutions (kernel widths 3, 5, 7) with residual + layer norm |
| BiAttention | Bidirectional self-attention with Rotary Position Embeddings (RoPE), 4 heads |
| Pool | Mean + max + std deviation concatenation → fixed-size representation |
| Heads | Matryoshka-style: slice pool dim to 16/64/192/576, project to 7 linear classifiers |
| Tier | Dim | Params | ONNX Size | Accuracy Multiplier |
|---|---|---|---|---|
| tiny | 16 | 1.43M | 9.09 MB | 0.65× |
| small | 64 | 1.45M | 9.13 MB | 0.82× |
| base | 192 | 1.48M | 9.25 MB | 1.0× (reference) |
| pro | 576 | 1.56M | 9.61 MB | 1.05× |
| Head | Classes | What It Detects |
|---|---|---|
| coarse | 12 | text, code, link, image, file, config, markup, data, error, secret, archive, binary |
| modality | 8 | textual, binary_image, binary_archive, binary_executable, binary_document, etc. |
| subtype | 24 | json, yaml, toml, csv, html, markdown, sql, log, dockerfile, makefile, etc. |
| code_lang | 62 | python, javascript, typescript, java, c, cpp, go, rust, ruby, php, swift, kotlin, and 50 more |
| text_lang | 30 | en, es, fr, de, it, pt, nl, ru, zh, ja, ko, vi, th, id, and 15 more |
| file_mime | 90 | application/json, image/png, video/mp4, font/ttf, application/wasm, and 84 more |
| risk | 6 | api_key, jwt, password, email, phone, ssh_key |
| Platform | Link | Notes |
|---|---|---|
| HuggingFace Space | eulogik/pico-type | Gradio web UI, no GPU needed |
| HuggingFace Model | eulogik/pico-type | ONNX models + export metadata |
| GitHub | eulogik/pico-type | Source code, training, paper |
| PyPI | pip install picotype | Python package |
| ONNX Runtime | Use with onnxruntime.js | Browser/Node.js deployment |