lm-detector README

The project's README from github.com/Ikaleio/lm-detector. As one markdown file: README.md.

LM Fingerpoint Detector

让模型随手写几百个整数,识别 API 背后的大语言模型

简体中文 · English

npm Web Docs Bun License

在线检测 · 文档 · 快速开始 · 命令行 · 原理


简介

中转站或第三方 API 声称提供某个模型,实际接入的可能是另一个模型。LM Fingerpoint Detector 用一个与语义无关的任务核对这一点:让模型凭第一反应写出约 300 个 1–355 之间的整数。语言模型写出的“随机数”并不均匀,每个模型偏好的数值、区间和末位数字相对稳定。检测器把这组分布与参考库比对,给出最接近的候选模型。

[!IMPORTANT] 检测结果是参考库内的封闭集合排序。不在库中的模型也会得到一个“最像”的候选,排名分数和置信度都不是身份证明。判断渠道是否可信时,请固定请求参数、重复多轮,并结合其他证据。

快速开始

网页:打开 lm.ikale.io,选择手动或 API 模式。每条回答至少需要 80 个有效整数;三条回答都有效时,页面给出排名和每个候选的置信度。API 模式打开分词器探测后,页面还会单独显示探测结果。

命令行:无需安装,任选一种运行时:

# Node.js ≥ 22
npx lmfpd@latest -b https://api.example.com/v1 -k sk-xxx -m gpt-6-astra

# Bun ≥ 1.4.2
bunx --bun lmfpd@latest -b https://api.example.com/v1 -k sk-xxx -m gpt-6-astra

本地开发:

bun install
bun run dev          # 同步数据并启动 Web 开发服务器(已接入 /api/proxy)
bun run dev:docs     # 启动文档开发服务器
bun run typecheck    # 网页、命令行与文档的 TypeScript 类型检查
bun run build        # 构建网站和文档到 web/dist
bun run build:cli    # 打包 npm CLI 到 dist/fpd
bun run fpd --help   # 在仓库内直接运行 CLI

文档

完整文档位于 lm.ikale.io/docs,源文件在 docs/content/docs/:

章节 内容
网页检测 取样方式、API 配置、结果解读、分词器探测、连接方式
命令行 检测、可选的分词器探测、采样与续采、入库与重训
原理 挑战与特征、排名与核验、置信度校准、分词器探测
部署 Cloudflare Pages、GitHub Pages、Vercel、自建 Worker 代理
参考 数据文件与变更记录、代理 API
开发 项目结构、设计规范、打包与发布

致谢

感谢 xqy2006/ModelTrace 提供了算法思路参考和部分原始数据。

许可证

MIT

lm-detector (Ikaleio/lm-detector)

tui
Searching Database…

What is this?LM Fingerpoint Detector figures out which large language model is really answering behind an API by asking it to write about 300 random integers between 1 and 355, then comparing the statistical pattern of those numbers against a reference bank of known models (GPT, Claude, Gemini, Grok, Qwen, DeepSeek, etc.) to find the closest match.
Is this a website or a command-line tool?Both: there's a web app for pasting a model's output or connecting directly to an API, and a Bun-based CLI called fpd that gives you a live terminal UI, multi-round detection, and JSON output.
How do I run a detection?On the web, open lm.ikale.io and either paste a model's answer manually or configure direct API access; each answer needs at least 80 valid integers before a ranking appears. The fpd CLI runs the same checks from a terminal without any separate install.
Which API formats does it need to talk to the model?It speaks three protocols: OpenAI's Responses API, OpenAI's Chat Completions API, and Anthropic's Messages API, defaulting to SSE streaming responses.
Does a match actually prove which model is running?No — the result is just a ranking inside a closed reference set. Models not in the library still get a 'closest' candidate, and neither the rank score nor the confidence value is proof of real identity.
What does the optional tokenizer probing check?When turned on (web toggle or --tokenizer flag), it sends about 12 short requests and reads the token usage field the API returns to infer which tokenizer the upstream model uses, then checks it against the claimed model. It's only a secondary signal, since many different models share the same tokenizer.
How does the reference library get updated with new models?The fpd CLI has sample, enroll, and retrain commands that run sampling, database insertion, and offline retraining in sequence, with failed attempts and old samples kept for traceability.
Can I avoid routing requests through the official site?Yes — the connection mode can be set to direct, routed through the site's proxy, or through your own self-deployed Cloudflare Worker; the project can also be deployed to Cloudflare Pages, GitHub Pages, or Vercel.
Can I just browse the reference data without running a detection?Yes, the web app has a reference library page where you can browse and export the stored model fingerprints read-only.
Creator
Ikaleio
Size
366.2 MB
Stars
389
Updated
CommitOct 14
Age
1mo
Commits · 90 Days