百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

siftrank

> 编程语言
开源

使用 LLM 来对任何内容进行排名

188 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

使用 LLM 来对任何内容进行排名

Use LLMs for document ranking.

Description

Got a bunch of data? Want to throw it at an LLM to find the most "interesting" stuff? If you simply YOLO your data into a ChatGPT session, you'll run into problems:

  • Nondeterminism: Doesn't always respond with the same result
  • Limited context: Can't pass in all the data at once, need to break it up
  • Output contraints: Sometimes doesn't return all the data you asked it to review
  • Scoring subjectivity: Struggles to assign a consistent numeric score to an individual item

siftrank is an implementation of the SiftRank document ranking algorithm that uses LLMs to efficiently find the items in any dataset that are most relevant to a given prompt:

  • Stochastic: Randomly samples the dataset into small batches.
  • Inflective: Looks for a natural inflection point in the scores that distinguishes particularly relevant items from the rest.
  • Fixed: Caps the maximum number of LLM calls so the computational complexity remains linear in the worst case.
  • Trial: Repeatedly compares batched items until the relevance scores stabilize.

Use LLMs to rank anything. No fine-tuning. No domain-specific models. Just an off-the-shelf model and your ranking prompt. Typically runs in seconds and costs pennies.

Getting started

Install

go install github.com/noperator/siftrank/cmd/siftrank@latest

Configure

Either set an OPENAI_API_KEY environment variable, or create a named configuration profile in ~/.config/siftrank/config.yaml or ./config.yaml containing the API key. The default profile auto-loads when -P is not specified, and CLI flags always take precedence over profile values. Use *_cmd to retrieve secrets from a password manager or other command rather than storing them in plaintext. See config-example.yaml for all available options.

yaml
default: nano
profiles:
  nano:
    api_key_cmd: op read op://myvault/openai-api-key/credential
    model: gpt-5-nano-2025-08-07
    effort: minimal

Usage

…

Compares 100 sentences in 7 seconds.

…

Advanced usage

JSON support

If the input file is a JSON document, it will be read as an array of objects and each object will be used for ranking.

For instance, two objects would be loaded and ranked from this document:

json
[
  {
    "path": "/foo",
    "code": "bar"
  },
  {
    "path": "/baz",
    "code": "nope"
  }
]

Templates

It is possible to include each element from the input file in a template using the Go template syntax via the --template "template string" (or --template @file.tpl) argument.

For text input files, each line can be referenced in the template with the Data variable:

Anything you want with {{ .Data }}

For JSON input files, each object in the array can be referenced directly. For instance, elements of the previous JSON example can be referenced in the template code like so:

# {{ .path }}

{{ .code }}

Note in the following example that the resulting value key contains the actual value being presented for ranking (as described by the template), while the object key contains the entire original object from the input file for easy reference.

…

Back matter

Acknowledgements

I released the prototype of this tool, Raink, while at Bishop Fox. See the original presentation, blog post and CLI tool.

See also

  • O(N) the Money: Scaling Vulnerability Research with LLMs
  • Using LLMs to solve security problems
  • Hard problems that reduce to document ranking
  • Commentary: Critical Thinking - Bug Bounty Podcast
  • Discussion: Hacker News
  • Large Language Models are Effective Text Rankers with Pairwise Ranking Prompting

To-do

  • add python bindings?
  • allow specifying an input directory (where each file is distinct object)
  • clarify when prompt included in token estimate
  • factor LLM calls out into a separate package
  • run openai batch mode
  • report cost + token usage
  • add more examples, use cases
  • account for reasoning tokens separately

Completed

  • add visualization
  • support reasoning effort
  • add blog link
  • add parameter for refinement ratio
  • add boolean refinement ratio flag
  • alert if the incoming context window is super large
  • automatically calculate optimal batch size?
  • explore "tournament" sort vs complete exposure each time
  • make sure that each randomized run is evenly split into groups so each one gets included/exposed
  • parallelize openai calls for each run
  • remove token limit threshold? potentially confusing/unnecessary
  • save time by using shorter hash ids
  • separate package and cli tool
  • some batches near the end of a run (9?) are small for some reason
  • support non-OpenAI models

License

This project is licensed under the MIT License.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Go

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言