pytail is a small PyPI caching proxy. It exposes a Python Simple Repository
API endpoint, fetches packages from upstream on demand, and keeps downloaded
files in a local cache.
It is useful when you want faster repeated installs, a simple shared package cache, or a local endpoint for PyPI and PyTorch wheel indexes.
- PyPI-compatible
/simple/endpoint forpipanduv - lazy caching of project pages and package files
- optional cache size limit with least-recently-used cleanup
- PyTorch wheel index proxy under
/pytorch-wheels/ - HTML and JSON Simple API responses
Install from PyPI:
pip install pytailOr install from source:
cargo install --path .After installation:
pytail \
--bind 127.0.0.1:3141 \
--cache-dir .cache/pytailFrom a source checkout:
cargo run -- \
--bind 127.0.0.1:3141 \
--cache-dir .cache/pytailThen use it as the package index:
uv pip install --index-url http://127.0.0.1:3141/simple/ requests
pip install --index-url http://127.0.0.1:3141/simple/ requestsOpen the local index in a browser:
http://127.0.0.1:3141/simple/
PyTorch wheel indexes are available under /pytorch-wheels/.
For example, this upstream command:
pip install torch --index-url https://download.pytorch.org/whl/cu126can use the local cache instead:
pip install torch --index-url http://127.0.0.1:3141/pytorch-wheels/cu126If a package needs both PyTorch wheels and normal PyPI packages:
pip install torch \
--index-url http://127.0.0.1:3141/pytorch-wheels/cu126 \
--extra-index-url http://127.0.0.1:3141/simple/Flat wheel mirrors, such as the Aliyun PyTorch mirror, can be converted into the same project-based Simple API. Start PyTail with the mirror root and enable flat-index mode:
pytail \
--torch-url https://mirrors.aliyun.com/pytorch-wheels/ \
--torch-flat-indexClients continue to use the normal local project index. For example:
pip install torch \
--index-url http://127.0.0.1:3141/pytorch-wheels/cu128Common options:
--bind: listen address, default127.0.0.1:3141--cache-dir: cache directory, default.cache/pytail--cache-max-size: max file cache size, default0for unlimited; examples:512MiB,2G,10GB--upstream-base-url: PyPI-compatible upstream, defaulthttps://pypi.org--torch-url: PyTorch wheel upstream, defaulthttps://download.pytorch.org/whl/--torch-flat-index: treat each PyTorch channel URL as a flat--find-linkspage and expose it as a project-based Simple API--project-cache-ttl-secs: project page refresh interval, default900--request-timeout-secs: upstream request timeout, default15--stats-interval-secs: stats log and trend sampling interval, default3600; set to0to disable--verbose: enable operational debug logs; useRUST_LOG=pytail=tracefor per-request and cache-hit details
Build the Rust binary:
cargo build --releaseBuild a Python wheel with maturin:
maturin build --releaseThe wheel installs the pytail command.