Show HN: Xet Server – Host your own models anywhere A developer released Xet Server, a Go server that is wire-compatible with Hugging Face's Xet storage protocol, letting users point the real `hf` CLI (`huggingface_hub` plus `hf_xet`) at their own infrastructure for `hf upload` and `hf download` with byte-identical round-trips. The project includes `xet-proxyd`, a caching pull-through proxy for huggingface.co that keeps any repo or file it has served once available after the Hub becomes unreachable, and its cache directory can be handed to a plain `xetd` as a disconnected replacement. The implementation was verified end-to-end against a live `hf_xet` client with real GGUF model files up to 27.6 GB, using a from-scratch BLAKE3 Merkle hashing port, real xorb/shard binary formats, and an LZ4 decoder and ByteGrouping4 codec. A Go server that is wire-compatible with Hugging Face's real Xet storage protocol https://huggingface.co/docs/hub/en/xet/index - the content-defined-chunking, dedup-first storage layer that replaces Git LFS for large model files on the Hub. Point the real hf CLI huggingface hub + hf xet at this server and it works: hf upload , hf download , byte-identical round-trips, real BLAKE3 hashing, real xorb/shard binary formats, real LZ4/byte-grouping compression. This started as a simplified, non-wire-compatible chunking/dedup demo kept in internal/chunk , internal/manifest , internal/api , cmd/xet for quick manual testing and grew into a from-scratch, spec-driven reimplementation of the actual protocol - verified end-to-end against a live hf xet client, with several real wire-format quirks discovered only by capturing and replaying genuine client traffic. See docs/PROTOCOL.md https://github.com/guilt/xet-server/blob/main/docs/PROTOCOL.md for that story. Also included: xet-proxyd , a caching pull-through proxy for the real huggingface.co - not just a performance cache, but an offline-resilience layer. Point it at the real Hub, use it like a normal HF ENDPOINT , and every repo/file it has successfully served once stays servable via hf download / hf upload even after huggingface.co becomes unreachable - including handing its cache directory to a plain xetd as a permanent, disconnected replacement. See Caching pull-through proxy caching-pull-through-proxy-xet-proxyd below. - Wire-compatible CAS HTTP API internal/casserver : xorb upload/fetch, shard upload, file reconstruction with Range-based paging, matching xet-core's own openapi/cas.openapi.yaml - verified byte-identical against a real hf xet client, for both compressible and incompressible content. - Hub API shim internal/hubserver : enough of huggingface.co's Hub REST API repo create, preupload, xet-{read,write}-token , commit, resolve/HEAD that the real hf upload / hf download shell commands work against this server via HF ENDPOINT - including real, independent revisions/branches per repo, not just an implicit main . - xet-proxyd : a caching pull-through proxy for the real huggingface.co cmd/xet-proxyd , internal/proxycas , internal/proxyhub , internal/hfclient - an offline-resilience layer, not just a performance cache: any repo metadata or xorb bytes it has successfully relayed once stay servable even after the real huggingface.co becomes unreachable, and its cache directory is a real xetd data directory a plain xetd can take over directly, no proxy process required. See Caching pull-through proxy caching-pull-through-proxy-xet-proxyd . - Real BLAKE3-keyed Merkle hashing internal/merklehash : a byte-for-byte port of xet-core's DataHash , verified against xet-core's own published reference vectors - not an approximation. - Real xorb and shard binary formats internal/xorbformat , internal/shardformat , each verified against real bytes captured from a live hf xet upload, including the footer-less upload behavior real clients actually use see docs/PROTOCOL.md https://github.com/guilt/xet-server/blob/main/docs/PROTOCOL.md . - From-scratch LZ4 decoder and ByteGrouping4 codec internal/lz4 , internal/bg4 : written directly from the public LZ4 spec / verified against a third-party reference implementation, so chunk hashes can be independently re-verified regardless of compression scheme. - Pluggable, streaming storage internal/storage : a Store interface with filesystem fsstore and S3-compatible s3store backends, built on io.Reader / io.ReadCloser rather than byte - neither backend ever buffers a full object in memory, so a multi-GB upload/download costs a fixed amount of memory. The S3 backend uses a from-scratch AWS SigV4 signer internal/sigv4 , no AWS SDK dependency. Verified end-to-end with real GGUF model files up to 27.6 GB. - Zero required external dependencies to build the demo path ; the protocol path adds exactly one pure-Go module github.com/zeebo/blake3 , pinned in go.sum . - Optional storage auto-pruning and request rate limiting internal/eviction , internal/ratelimit : bounded, observable defense-in-depth for a server left running against untrusted traffic - neither adds a dependency, and both are off unless explicitly enabled. xetd rate-limits uploads only the expensive local operation there ; xet-proxyd rate-limits every route on both ports, since even a read can trigger a real outbound call to the real huggingface.co. - Optional dedup-hit content verification internal/storage 's VerifyingStore : byte-compares an incoming upload against the stored blob on a dedup hit instead of trusting the content hash alone, bailing at the first mismatch - a hash-collision/corruption safety net, off by default since it roughly doubles I/O on a dedup hit. - A real global chunk-dedup index and V2 multi-range reconstruction internal/casserver : GET /v1/chunks/{prefix}/{hash} returns the actual shard bytes referencing a queried chunk the real wire contract, confirmed against xet-core's own client source , and GET /v2/reconstructions/{file id} returns the multi-range-optimized response shape instead of always falling back to V1. - Restart-surviving metadata persistence : casserver / hubserver and, identically, xet-proxyd 's embedded copies of each periodically and on graceful shutdown checkpoint their in-memory reconstruction/repo indices to disk as an atomic JSON snapshot - see -snapshot-interval below. - Real-client regression fixtures : several packages carry testdata/ captured directly from a live hf xet session, replayed in unit tests - the strongest guard against silently regressing wire compatibility. See docs/ARCHITECTURE.md https://github.com/guilt/xet-server/blob/main/docs/ARCHITECTURE.md for the full system diagram upload/download sequence diagrams, package responsibility table, and the key design decisions . Short version: - cmd/xetd runs the CAS server, and - with -hub-addr - the Hub API shim as a second HTTP listener, matching how huggingface.co's real Hub and CAS are actually separate services. - cmd/xet-proxyd runs a caching pull-through proxy in front of the real huggingface.co, on the same two-port shape as xetd - a drop-in alternative for the same ports, backed by the real Hub instead of being the only copy of the data. See Caching pull-through proxy caching-pull-through-proxy-xet-proxyd . - cmd/xet is a small CLI for the Xet Data API only not the wire-compatible protocol - use the real hf CLI for that . With -hub-addr set, xetd is also a Git LFS server: set a repo's lfs.url to http://