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

4K 655 55
lucidrains
recurrent-memory-transformer-pytorch

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

4K 424 19
lucidrains
ring-attention-pytorch

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

4K 546 36
lucidrains
infini-transformer-pytorch

Implementation of Infini-Transformer in Pytorch

3K 112 4
jagmarques
nexusquant-kv

Training-free KV cache compression via E8 lattice quantization; fits longer context in the same VRAM

3K 20 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.

1K 9 2
lucidrains
perceiver-ar-pytorch

Implementation of Perceiver AR, Deepmind's new long-context attention network based on Perceiver architecture, in Pytorch

720 95 4
mo-tunn
tokenpack-rag

Query-aware semantic chunk selection under LLM context-window budgets.

440 10 0
Neuranox
titans-memory

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

248 1 2
yuplin2333
mcp-long-context-reader

A tool to help agents read and query long documents.

230 5 1
forhaoliu
ringattention

RingAttention for Transformers with Arbitrarily Large Context.

219 773 53
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.

183 2 0
Yaoniguan-Money
memory-garden

记忆花园 Memory Garden: local-first, auditable memory layer for AI agents, also usable as a memory skill

182 1 0
dschulmeist
replm

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

159 1 0
VectifyAI
pageindex-condb

KV-cache native context database with reasoning-based tree retrieval

155 39 5
denial-web
hard-needle

Semantically hard multi-needle long-context data generator

142 0 0
melvinebenezer
liah

needle in a haystack for LLMs

98 2 0
bytedance
shadowkv

[ICML 2025 Spotlight] ShadowKV: KV Cache in Shadows for High-Throughput Long-Context LLM Inference

78 307 25
    • Data from PyPI, GitHub, ClickHouse, and BigQuery