Skip to content

Commit 08f5bc5

Browse files
committed
move to hub subdir
1 parent 1d84b67 commit 08f5bc5

File tree

14 files changed

+88
-87
lines changed

14 files changed

+88
-87
lines changed

docs/hub/_redirects.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ adapter-transformers: adapters
1919
security-two-fa: security-2fa
2020
repositories-recommendations: storage-limits
2121
xet: storage-backends#xet
22+
xet-spec: xet/index
File renamed without changes.

docs/xet/api.md renamed to docs/hub/xet/api.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This document describes the HTTP API endpoints used by the CAS (Content Addressa
44

55
## Authentication
66

7-
To authenticate, authorize, and obtain the API base URL, follow the instructions in [Authentication](./auth.md).
7+
To authenticate, authorize, and obtain the API base URL, follow the instructions in [Authentication](./auth).
88

99
## Converting Hashes to Strings
1010

@@ -38,7 +38,7 @@ It is: `07060504030201000f0e0d0c0b0a0908171615141312111f1e1d1c1b1a1918`.
3838
- **Method**: `GET`
3939
- **Parameters**:
4040
- `file_id`: File hash in hex format (64 lowercase hexadecimal characters).
41-
See [file hashes](./hashing.md#file-hashes) for computing the file hash and [converting hashes to strings](./api.md#converting-hashes-to-strings).
41+
See [file hashes](./hashing#file-hashes) for computing the file hash and [converting hashes to strings](./api#converting-hashes-to-strings).
4242
- **Headers**:
4343
- `Range`: OPTIONAL. Format: `bytes={start}-{end}` (end is inclusive).
4444
- **Minimum Token Scope**: `read`
@@ -53,7 +53,7 @@ See [file hashes](./hashing.md#file-hashes) for computing the file hash and [con
5353
}
5454
```
5555

56-
- **Error Responses**: See [Error Cases](./api.md#error-cases)
56+
- **Error Responses**: See [Error Cases](./api#error-cases)
5757
- `400 Bad Request`: Malformed `file_id` in the path. Fix the path before retrying.
5858
- `401 Unauthorized`: Refresh the token to continue making requests, or provide a token in the `Authorization` header.
5959
- `404 Not Found`: The file does not exist. Not retryable.
@@ -67,7 +67,7 @@ OPTIONAL: -H Range: "bytes=0-100000"
6767

6868
### Example File Reconstruction Response Body
6969

70-
See [QueryReconstructionResponse](./download-protocol.md#queryreconstructionresponse-structure) for more details in the download protocol specification.
70+
See [QueryReconstructionResponse](./download-protocol#queryreconstructionresponse-structure) for more details in the download protocol specification.
7171

7272
### 2. Query Chunk Deduplication (Global Deduplication)
7373

@@ -77,11 +77,11 @@ See [QueryReconstructionResponse](./download-protocol.md#queryreconstructionresp
7777
- **Parameters**:
7878
- `prefix`: The only acceptable prefix for the Global Deduplication API is `default-merkledb`.
7979
- `hash`: Chunk hash in hex format (64 lowercase hexadecimal characters).
80-
See [Chunk Hashes](./hashing.md#chunk-hashes) to compute the chunk hash and [converting hashes to strings](./api.md#converting-hashes-to-strings).
80+
See [Chunk Hashes](./hashing#chunk-hashes) to compute the chunk hash and [converting hashes to strings](./api#converting-hashes-to-strings).
8181
- **Minimum Token Scope**: `read`
8282
- **Body**: None.
83-
- **Response**: Shard format bytes (`application/octet-stream`), deserialize as a [shard](./shard.md#global-deduplication).
84-
- **Error Responses**: See [Error Cases](./api.md#error-cases)
83+
- **Response**: Shard format bytes (`application/octet-stream`), deserialize as a [shard](./shard#global-deduplication).
84+
- **Error Responses**: See [Error Cases](./api#error-cases)
8585
- `400 Bad Request`: Malformed hash in the path. Fix the path before retrying.
8686
- `401 Unauthorized`: Refresh the token to continue making requests, or provide a token in the `Authorization` header.
8787
- `404 Not Found`: Chunk not already tracked by global deduplication. Not retryable.
@@ -103,10 +103,10 @@ An example shard response body can be found in [Xet reference files](https://hug
103103
- **Parameters**:
104104
- `prefix`: The only acceptable prefix for the Xorb upload API is `default`.
105105
- `hash`: Xorb hash in hex format (64 lowercase hexadecimal characters).
106-
See [Xorb Hashes](./hashing.md#xorb-hashes) to compute the hash, and [converting hashes to strings](./api.md#converting-hashes-to-strings).
106+
See [Xorb Hashes](./hashing#xorb-hashes) to compute the hash, and [converting hashes to strings](./api#converting-hashes-to-strings).
107107
- **Minimum Token Scope**: `write`
108108
- **Body**: Serialized Xorb bytes (`application/octet-stream`).
109-
See [xorb format serialization](./xorb.md).
109+
See [xorb format serialization](./xorb).
110110
- **Response**: JSON (`UploadXorbResponse`)
111111

112112
```json
@@ -117,7 +117,7 @@ See [xorb format serialization](./xorb.md).
117117

118118
- Note: `was_inserted` is `false` if the Xorb already exists; this is not an error.
119119

120-
- **Error Responses**: See [Error Cases](./api.md#error-cases)
120+
- **Error Responses**: See [Error Cases](./api#error-cases)
121121
- `400 Bad Request`: Malformed hash in the path, Xorb hash does not match the body, or body is incorrectly serialized.
122122
- `401 Unauthorized`: Refresh the token to continue making requests, or provide a token in the `Authorization` header.
123123
- `403 Forbidden`: Token provided but does not have a wide enough scope (for example, a `read` token was provided). Clients MUST retry with a `write` scope token.
@@ -139,7 +139,7 @@ Uploads file reconstructions and new xorb listing, serialized into the shard for
139139
- **Method**: `POST`
140140
- **Minimum Token Scope**: `write`
141141
- **Body**: Serialized Shard data as bytes (`application/octet-stream`).
142-
See [Shard format guide](./shard.md#shard-upload).
142+
See [Shard format guide](./shard#shard-upload).
143143
- **Response**: JSON (`UploadShardResponse`)
144144

145145
```json
@@ -154,7 +154,7 @@ See [Shard format guide](./shard.md#shard-upload).
154154

155155
The value of `result` does not carry any meaning, if the upload shard API returns a `200 OK` status code, the upload was successful and the files listed are considered uploaded.
156156

157-
- **Error Responses**: See [Error Cases](./api.md#error-cases)
157+
- **Error Responses**: See [Error Cases](./api#error-cases)
158158
- `400 Bad Request`: Shard is incorrectly serialized or Shard contents failed verification.
159159
- Can mean that a referenced Xorb doesn't exist or the shard is too large
160160
- `401 Unauthorized`: Refresh the token to continue making requests, or provide a token in the `Authorization` header.

docs/xet/auth.md renamed to docs/hub/xet/auth.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ All parameters are required to form the url.
2323
- `token_type`: Either `read` or `write`.
2424
- `revision`: Git revision (branch, tag, or commit hash; default to using `main` if no specific ref is required)
2525

26-
To understand the distinction for between `token_type` values read onwards in this document to [Token Scope](./auth.md#token-scope).
26+
To understand the distinction for between `token_type` values read onwards in this document to [Token Scope](./auth#token-scope).
2727

2828
**Example URLs:**
2929

docs/xet/chunking.md renamed to docs/hub/xet/chunking.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ The [xet-team/xet-spec-reference-files](https://huggingface.co/datasets/xet-team
141141

142142
In the same repository in file [Electric_Vehicle_Population_Data_20250917.csv.chunks](https://huggingface.co/datasets/xet-team/xet-spec-reference-files/blob/main/Electric_Vehicle_Population_Data_20250917.csv.chunks)
143143
the chunks produced out of [Electric_Vehicle_Population_Data_20250917.csv](https://huggingface.co/datasets/xet-team/xet-spec-reference-files/blob/main/Electric_Vehicle_Population_Data_20250917.csv) are listed.
144-
Each line in the file is a 64 hexadecimal hash of the chunk, followed by a space and then the number of bytes in that chunk.
144+
Each line in the file is a 64 hexadecimal character string version of the hash of the chunk, followed by a space and then the number of bytes in that chunk.
145145

146146
Implementors should use the chunk lengths to determine that they are producing the right chunk boundaries for this file with their chunking implementation.
147147

docs/xet/deduplication.md renamed to docs/hub/xet/deduplication.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ A **chunk** is a variable-sized content block derived from files using Content-D
2323
- **Size range**: 8KB to 128KB (minimum and maximum constraints)
2424
- **Identification**: Each chunk is uniquely identified by its cryptographic hash (MerkleHash)
2525

26-
[Detailed chunking description](./chunking.md)
26+
[Detailed chunking description](./chunking)
2727

2828
### Xorbs (Extended Object Blocks)
2929

@@ -143,11 +143,11 @@ They MAY know this chunk hash because they own this data, the match has made the
143143
### Chunk Hash Computation
144144

145145
Each chunk has its content hashed using a cryptographic hash function (Blake3-based MerkleHash) to create a unique identifier for content addressing.
146-
[See section about hashing](./hashing.md#chunk-hashes).
146+
[See section about hashing](./hashing#chunk-hashes).
147147

148148
### Xorb Formation
149149

150-
When new chunks need to be stored, they are aggregated into xorbs based on size and count limits. If adding a new chunk would exceed the maximum xorb size or chunk count, the current xorb is finalized and uploaded. [See section about xorb formation](../xorb.md)
150+
When new chunks need to be stored, they are aggregated into xorbs based on size and count limits. If adding a new chunk would exceed the maximum xorb size or chunk count, the current xorb is finalized and uploaded. [See section about xorb formation](../xorb)
151151

152152
### File Reconstruction Information
153153

@@ -164,7 +164,7 @@ This information allows the system to reconstruct files by:
164164
2. Extracting the specific chunk ranges from each xorb
165165
3. Concatenating chunks in the correct order
166166

167-
[See section about file reconstruction](./file-reconstruction.md).
167+
[See section about file reconstruction](./file-reconstruction).
168168

169169
## Fragmentation Prevention
170170

docs/xet/download-protocol.md renamed to docs/hub/xet/download-protocol.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ File download in the Xet protocol is a two-stage process:
1313

1414
### Single File Reconstruction
1515

16-
To download a file given a file hash, first call the reconstruction API to get the file reconstruction. Follow the steps in [api.md](./api.md#1-get-file-reconstruction).
16+
To download a file given a file hash, first call the reconstruction API to get the file reconstruction. Follow the steps in [api](./api#1-get-file-reconstruction).
1717

18-
Note that you will need at least a `read` scope auth token, [auth reference](./auth.md).
18+
Note that you will need at least a `read` scope auth token, [auth reference](./auth).
1919

2020
> For large files it is RECOMMENDED to request the reconstruction in batches i.e. the first 10GB, download all the data, then the next 10GB and so on. Clients can use the `Range` header to specify a range of file data.
2121
@@ -116,7 +116,7 @@ Scroll
116116

117117
```python
118118
file_id = "0123...abcdef"
119-
api_endpoint, token = get_token() # follow auth.md instructions
119+
api_endpoint, token = get_token() # follow auth instructions
120120
url = api_endpoint + "/reconstructions/" + file_id
121121
reconstruction = get(url, headers={"Authorization": "Bearer: " + token})
122122

@@ -172,7 +172,7 @@ The downloaded data is in xorb format and MUST be deserialized:
172172
3. **Extract byte indices**: Track byte boundaries between chunks for range extraction
173173
4. **Validate length**: Decompressed length MUST match `unpacked_length` from the term
174174

175-
**Note**: The specific deserialization process depends on the [Xorb format](../xorb.md).
175+
**Note**: The specific deserialization process depends on the [Xorb format](../xorb).
176176

177177
```python
178178
for term in terms:
@@ -340,23 +340,23 @@ Note that in this example the chunk at index 3 is used twice! This is the benefi
340340
```mermaid
341341
sequenceDiagram
342342
autonumber
343-
actor Client as "Client"
344-
participant CAS as "CAS API"
345-
participant Transfer as "Transfer Service (Xet storage)"
343+
actor client as Client
344+
participant S as CAS API
345+
participant Transfer as Transfer Service (Xet storage)
346346
347-
Client->>CAS: GET /reconstructions/{file_id}<br/>Authorization: Bearer <token><br/>Range: bytes=start-end (optional)
348-
CAS-->>Client: 200 OK<br/>QueryReconstructionResponse {offset_into_first_range, terms[], fetch_info{}}
347+
client->>S: GET /reconstructions/{file_id}<br/>Authorization: Bearer <token><br/>Range: bytes=start-end (optional)
348+
S-->>client: 200 OK<br/>QueryReconstructionResponse {offset_into_first_range, terms[], fetch_info{}}
349349
350350
loop For each term in terms (ordered)
351-
Client->>Client: Find fetch_info by xorb hash, entry whose range contains term.range
352-
Client->>Transfer: GET {url}<br/>Range: bytes=url_range.start-url_range.end
353-
Transfer-->>Client: 206 Partial Content<br/>xorb byte range
354-
Client->>Client: Deserialize xorb → chunks for fetch_info.range
355-
Client->>Client: Trim to term.range, apply offset for first term
356-
Client->>Client: Append chunks to output
351+
client->>client: Find fetch_info by xorb hash, entry whose range contains term.range
352+
client->>Transfer: GET {url}<br/>Range: bytes=url_range.start-url_range.end
353+
Transfer-->>client: 206 Partial Content<br/>xorb byte range
354+
client->>client: Deserialize xorb → chunks for fetch_info.range
355+
client->>client: Trim to term.range, apply offset for first term
356+
client->>client: Append chunks to output
357357
end
358358
359359
alt Range requested
360-
Client->>Client: Truncate output to requested length
360+
client->>client: Truncate output to requested length
361361
end
362362
```
File renamed without changes.

docs/xet/file-reconstruction.md renamed to docs/hub/xet/file-reconstruction.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ This document describes how a file can be represented and reconstructed from a c
1212

1313
## Core Idea
1414

15-
After following the [chunking procedure](./chunking.md) a file can be represented as an ordering of chunks.
16-
Those chunks are then packed into [xorbs](./xorb.md) and given the set of xorbs we convert the file representation to "reconstruction" made up of "terms".
15+
After following the [chunking procedure](./chunking) a file can be represented as an ordering of chunks.
16+
Those chunks are then packed into [xorbs](./xorb) and given the set of xorbs we convert the file representation to "reconstruction" made up of "terms".
1717
When forming xorbs the ordering and grouping of chunks prioritizes contiguous runs of chunks that appear in a file such that when referencing a xorb we maximize the term range length.
1818

1919
Any file’s raw bytes can be described as the concatenation of data produced by a sequence of terms.
@@ -105,7 +105,7 @@ A file’s reconstruction can be serialized into a shard as part of its file inf
105105
Conceptually, this section encodes the complete set of terms that describe the file.
106106
When stored this way, the representation is canonical and sufficient to reconstruct the full file solely from its referenced xorb ranges.
107107

108-
Reference: [shard format file info](./shard.md#2-file-info-section)
108+
Reference: [shard format file info](./shard#2-file-info-section)
109109

110110
### Deserialization from the reconstruction API (JSON)
111111

@@ -114,7 +114,7 @@ This response is represented by a structure named “QueryReconstructionResponse
114114
The `terms` list contains, for each term, the xorb identifier and the contiguous chunk index range to retrieve.
115115
Other fields may provide auxiliary details (such as offsets or fetch hints) that optimize retrieval without altering the meaning of the `terms` sequence.
116116

117-
Reference: [api.md](./api.md), [download protocol](./download-protocol.md)
117+
Reference: [api](./api), [download protocol](./download-protocol)
118118

119119
## Fragmentation and Why Longer Ranges Matter
120120

docs/xet/hashing.md renamed to docs/hub/xet/hashing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Reference files are provided in Hugging Face Dataset repository [xet-team/xet-sp
137137
In this repository there are a number of different samples implementors can use to verify hash computations.
138138

139139
> Note that all hashes are represented as strings.
140-
To get the raw value of these hashes you must invert the endianness of each byte octet in the hash string, reversing the procedure described in [api.md](./api.md#converting-hashes-to-strings).
140+
To get the raw value of these hashes you must invert the endianness of each byte octet in the hash string, reversing the procedure described in [api](./api#converting-hashes-to-strings).
141141

142142
### Chunk Hashes Sample
143143

0 commit comments

Comments
 (0)