←
Asterisk Labs

cozip

Cloud-Optimized ZIP

cozip02 / 8

cozip is one layer of the Asterisk stack for AI

training datasets files codecs bytes PyTorch, JAX, TensorFlow your model, fed tensors through DLPack on a CPU or a GPU TACO AI-ready datasets, one sample per example cozip a ZIP you open like a table Rumi tensors read by window, band and time GeoZL Earth observation codecs, on OpenZL Karu batched byte-range reads from files, HTTP, S3, GCS, Azure, Hugging Face and Source Cooperative holds
cozip03 / 8

An ordinary ZIP lists its files at the end

000000.tif1,000 B000001.tif1,000 B000002.tif1,000 B000003.tif1,000 B…999999.tif1,000 B Central Directory 000000.tif1,000 B 000001.tif1,000 B 000002.tif1,000 B … one record per file end98 B byte 0 where the directory starts read all of it to find one file then the file 1 end, 98 B then 2 Central Directory, 56 MB then 3 000002.tif, 1,000 B

A reader starts at the end of the archive. The last 98 bytes say where the directory starts.

Then it reads the whole directory, one record per file with its name, size and offset. For a million files that is 56 MB.

Only then does it know where the file is. Three reads in a row before the first byte of data.

Measured on a million files of 1,000 bytes. That many entries need the ZIP64 end records, 98 bytes in all.

cozip04 / 8

cozip reads the manifest, not the directory

index41 B 000000.tif1,000 B000001.tif1,000 B000002.tif1,000 B000003.tif1,000 B…999999.tif1,000 B manifest nameoffsetsplit 000000.tif132train 000001.tif1,172train 000002.tif2,212train … one row per file CentralDirectory56 MB end98 B byte 0 first 64 KiB where the manifest is a table you can filter offset 2,212, size 1,000 never parsed 1 index, first 64 KiB then 2 manifest, 11.7 MB then 3 000002.tif, 1,000 B

The reader asks for the first 64 KiB. At byte 51 the index says where the manifest is.

Then it reads the manifest, one row per file with its offset, size and your columns. Here that is 11.7 MB with six metadata columns, a fifth of the directory.

The row gives the exact bytes, so the next read is the file. The Central Directory is never parsed.

The same million files. The manifest holds name, offset, size and six metadata columns in 11.7 MB of Parquet.

cozip05 / 8

The manifest is a table

requiredyours, any metadata
nameoffsetsizesplitdatecloud_coverlandcover
000000.tif1321,000train2024-01-0122.6water
000001.tif1,1721,000train2024-01-0219.9urban
000002.tif2,2121,000train2024-01-0336.3forest
000003.tif3,2521,000train2024-01-0417.9bare
000004.tif4,2921,000train2024-01-0534.6bare
000005.tif5,3321,000train2024-01-0694.8forest
000006.tif6,3721,000train2024-01-0757.3crop
000007.tif7,4121,000train2024-01-0834.0bare
000008.tif8,4521,000val2024-01-0927.2bare
... 999,991 more rows
Central Directory56.0 MB
manifest, 9 columns11.7 MB
manifest, 3 columns0.5 MB

Every manifest has name, offset and size. Any other column is yours: here a split, a date, cloud cover and a land cover class.

Query it like any table. cloud_cover < 25 keeps three of these rows, and on all million rows DuckDB filters split, cloud cover, date and area in 35 ms.

With all six columns the manifest is a fifth of the directory: 11.7 MB against 56 MB. With only name, offset and size it is 0.5 MB.

The reference archive: a million files of 1,000 bytes. Its manifest also has lon and lat. Timings on a laptop, from local disk.

cozip06 / 8

It is still a ZIP

$ unzip -l tiles.zip
Archive:  tiles.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
       41  11-22-2026 23:30   __cozip__
     1000  11-22-2026 23:30   000000.tif
     1000  11-22-2026 23:30   000001.tif
     1000  11-22-2026 23:30   000002.tif
           999,996 more lines
     1000  11-22-2026 23:30   999999.tif
 11742751  11-22-2026 23:30   __metadata__
---------                     -------
1011742792                     1000002 files

Any ZIP tool lists it. cozip adds an index and a manifest.

__cozip__
the index, always the first entry
__metadata__
the manifest, 11.7 MB of Parquet here
__cozip_padding__
only in an archive under 32,819 bytes, so not in this one; readers ignore it

Direct ranges work because files keep their bytes.

Stored, never compressed
a file is its original bytes, at an offset with a size
No encryption, no data descriptors
nothing to decode between the offsets
One segment, no comment
the end record is always the last 22 bytes
Unique ASCII names
with / as the separator and no folder entries
ZIP64 when needed
above 4 GiB, or from 65,535 entries
cozip07 / 8

Five languages, one format

C libcozip writes, checks and reads C calls it directly Pythoncffi RR.Call Juliaccall hyparquet decodes Parquet JSJavaScriptown reader
cozip_write_flat("tiles.zip", entries, n, capacity, "manifest.parquet", &err);
cozip_read_flat_metadata("s3://bucket/tiles.zip", &parquet, &size, &message);
Asterisk Labs

Thank you