gkamradt/needle-in-a-haystack
Doing simple retrieval from LLM models at various context lengths to measure accuracy observed · 2026-08-28
Health v2 · maintenance only
72/100
- Activity 86
- Release rhythm 54
- Longevity 73
Flags: no_license
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 1027
- days_rel: 95
- days_push: 86
- n_releases_24m: 1
Adoption not part of the score
2375 stars · 246 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
A benchmarking tool (niah / needlehaystack) that pressure-tests LLM long-context retrieval by sweeping context length x needle depth cells against configured models and scoring each response. It supports single-fact lookup, multi-fact recall, and UUID-chain multi-step reasoning tasks, writing one JSONL result row per cell.
Use cases
- test how well an LLM retrieves a fact from a long context
- measure retrieval accuracy at different context lengths and depths
- compare long-context performance across OpenAI, Anthropic, and Cohere models
- run a needle-in-a-haystack evaluation sweep
- probe whether models miss information buried in the middle of long prompts
- evaluate multi-step reasoning over long context with UUID chains
When to choose
- you need a reproducible, configurable sweep of context-length vs depth accuracy for LLMs
- you want to benchmark raw long-context retrieval across multiple providers
- you want scored JSONL results you can analyze, including reconstructing the exact context each cell saw
When to avoid
- you need a general LLM evaluation harness for coding, math, or reasoning benchmarks beyond context retrieval
- you want to test a RAG pipeline's retriever rather than a model's raw context handling
- you need a production inference client - this is an evaluation tool, not a serving layer
Facets
cli-tool · maturity active
benchmarking llm-inference testing large-language-models artificial-intelligence testing machine-learning python cli llm-evaluation long-context context-window needle-in-a-haystack lost-in-the-middle jsonl-results yaml-config model-comparison openai anthropic cohere uuid-chain-reasoning
1 source
- readme: https://github.com/gkamradt/needle-in-a-haystack · fetched 2026-08-28 · 2b039ddce7a7
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| gkamradt/needle-in-a-haystack | main | 72 |
For agents
markdown · JSON · MCP: product_card(name="gkamradt/needle-in-a-haystack")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem