PyRank
  • Insights
  • PyPI
  • GitHub
  • Search
  • Compare
  • Advisories
  • Ecosystem
  • About

Long Context Python Packages

Python packages with the GitHub topic long-context. Sorted by relevance, with stars and monthly downloads.
lucidrains
megabyte-pytorch

Implementation of MEGABYTE, Predicting Million-byte Sequences with Multiscale Transformers, in Pytorch

6K 655 55
lucidrains
ring-attention-pytorch

Implementation of 💍 Ring Attention, from Liu et al. at Berkeley AI, in Pytorch

4K 547 36
lucidrains
recurrent-memory-transformer-pytorch

Implementation of Recurrent Memory Transformer, Neurips 2022 paper, in Pytorch

3K 423 19
lucidrains
infini-transformer-pytorch

Implementation of Infini-Transformer in Pytorch

2K 112 4
mo-tunn
tokenpack-rag

TokenPack packs long documents, codebases, PDFs, and folders into compact, evidence-dense LLM context using local embeddings, evidence scoring, and budget-aware selection.

887 7 0
forhaoliu
ringattention

Large Context Attention

737 770 53
lucidrains
perceiver-ar-pytorch

Perceiver AR

607 95 4
yuplin2333
mcp-long-context-reader

An MCP server for overcoming context window limitations when processing extensive documents.

526 5 1
denial-web
hard-needle

Semantically hard multi-needle long-context data generator. Stop testing LLMs with random-password needles.

491 0 0
FluffyAIcode
kakeyalattice

Discrete Kakeya cover for LLM KV cache: D4/E8 nested-lattice quantisation realising a Kakeya-style tube-cover over the direction sphere. 2.4x-2.8x compression at <1% perplexity loss on Qwen3, Llama-3, DeepSeek, GLM-4, Gemma. Drop-in transformers.DynamicCache. pip install kakeyalattice.

458 8 2
Neuranox
titans-memory

PyTorch implementation of Titans: Learning to Memorize at Test Time (Behrouz, Zhong & Mirrokni, 2024)

277 1 2
compactbench
compactbench

Open benchmark for LLM context compaction methods — measures what survives when you replace conversation history with a compacted artifact. Multi-cycle drift, hidden ranked set.

206 2 0
jagmarques
nexusquant-kv

Training-free KV cache compression via E8 lattice quantization and attention-aware token eviction

182 13 0
bytedance
shadowkv

shadow kv cache

78 297 23
dschulmeist
replm

Recursive Language Models — process arbitrarily long prompts by offloading context into a REPL and enabling symbolic recursion via sub-LLM calls

72 1 0
melvinebenezer
liah

Insert a Lie in a Haystack and evaluate the model's ability to detect it.

72 2 0
    • Data from PyPI, GitHub, ClickHouse, and BigQuery