Finalize a weights upload
Completes a release’s weights bundle. Send the manifest of every file in the bundle. The
server checks that each file was uploaded or can be copied from an earlier release,
copies any deduplicated files in the background, and writes the manifest last. The bundle
is complete once the manifest is written; copying counts the files still being copied.
The server computes total_size from the entries and ignores the client’s value. The
body may be at most 4 MiB and list at most 10000 files. A finalize replaces the release’s
previous bundle.
A manifest whose entries all carry an hf:// source names Hugging Face files and
uploads nothing; it cannot be mixed with uploaded entries.
Callable by an account_admin or developer of the owning account when model serving is
enabled for the account.
curl --request POST \
--url https://api.reactor.inc/models/{id}/releases/{release}/weights/finalize \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"manifest": {
"version": 1,
"model_name": "your-model",
"release": "v1.2.3-gabcdef0",
"files": [
{
"path": "model.safetensors",
"size": 4294967296,
"sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
},
{
"path": "tokenizer/vocab.json",
"size": 1048576,
"sha256": "2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae"
}
]
}
}
'import requests
url = "https://api.reactor.inc/models/{id}/releases/{release}/weights/finalize"
payload = { "manifest": {
"version": 1,
"model_name": "your-model",
"release": "v1.2.3-gabcdef0",
"files": [
{
"path": "model.safetensors",
"size": 4294967296,
"sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
},
{
"path": "tokenizer/vocab.json",
"size": 1048576,
"sha256": "2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae"
}
]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
manifest: {
version: 1,
model_name: 'your-model',
release: 'v1.2.3-gabcdef0',
files: [
{
path: 'model.safetensors',
size: 4294967296,
sha256: '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'
},
{
path: 'tokenizer/vocab.json',
size: 1048576,
sha256: '2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae'
}
]
}
})
};
fetch('https://api.reactor.inc/models/{id}/releases/{release}/weights/finalize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.reactor.inc/models/{id}/releases/{release}/weights/finalize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'manifest' => [
'version' => 1,
'model_name' => 'your-model',
'release' => 'v1.2.3-gabcdef0',
'files' => [
[
'path' => 'model.safetensors',
'size' => 4294967296,
'sha256' => '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'
],
[
'path' => 'tokenizer/vocab.json',
'size' => 1048576,
'sha256' => '2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.reactor.inc/models/{id}/releases/{release}/weights/finalize"
payload := strings.NewReader("{\n \"manifest\": {\n \"version\": 1,\n \"model_name\": \"your-model\",\n \"release\": \"v1.2.3-gabcdef0\",\n \"files\": [\n {\n \"path\": \"model.safetensors\",\n \"size\": 4294967296,\n \"sha256\": \"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08\"\n },\n {\n \"path\": \"tokenizer/vocab.json\",\n \"size\": 1048576,\n \"sha256\": \"2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.reactor.inc/models/{id}/releases/{release}/weights/finalize")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"manifest\": {\n \"version\": 1,\n \"model_name\": \"your-model\",\n \"release\": \"v1.2.3-gabcdef0\",\n \"files\": [\n {\n \"path\": \"model.safetensors\",\n \"size\": 4294967296,\n \"sha256\": \"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08\"\n },\n {\n \"path\": \"tokenizer/vocab.json\",\n \"size\": 1048576,\n \"sha256\": \"2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reactor.inc/models/{id}/releases/{release}/weights/finalize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"manifest\": {\n \"version\": 1,\n \"model_name\": \"your-model\",\n \"release\": \"v1.2.3-gabcdef0\",\n \"files\": [\n {\n \"path\": \"model.safetensors\",\n \"size\": 4294967296,\n \"sha256\": \"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08\"\n },\n {\n \"path\": \"tokenizer/vocab.json\",\n \"size\": 1048576,\n \"sha256\": \"2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"path": "partners/8c8b7e12-a4c1-4627-b0a0-5d2e9f3a7b61/weights/your-model/7b3f1bc2-a4e5-4d78-b9c1-0e6c2f9a1d34/v1.2.3-gabcdef0/manifest.json",
"files": 2,
"copying": 1
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}Authorizations
A Reactor API key (rk_...), sent as Authorization: Bearer rk_.... Keep it on a server.
Path Parameters
The model's ID (not its project ID). Find it with GET /models?name=your-org/your-model.
The release tag, such as v1.2.3-gabcdef0.
"v1.2.3-gabcdef0"
Body
curl --request POST \
--url https://api.reactor.inc/models/{id}/releases/{release}/weights/finalize \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"manifest": {
"version": 1,
"model_name": "your-model",
"release": "v1.2.3-gabcdef0",
"files": [
{
"path": "model.safetensors",
"size": 4294967296,
"sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
},
{
"path": "tokenizer/vocab.json",
"size": 1048576,
"sha256": "2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae"
}
]
}
}
'import requests
url = "https://api.reactor.inc/models/{id}/releases/{release}/weights/finalize"
payload = { "manifest": {
"version": 1,
"model_name": "your-model",
"release": "v1.2.3-gabcdef0",
"files": [
{
"path": "model.safetensors",
"size": 4294967296,
"sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
},
{
"path": "tokenizer/vocab.json",
"size": 1048576,
"sha256": "2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae"
}
]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
manifest: {
version: 1,
model_name: 'your-model',
release: 'v1.2.3-gabcdef0',
files: [
{
path: 'model.safetensors',
size: 4294967296,
sha256: '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'
},
{
path: 'tokenizer/vocab.json',
size: 1048576,
sha256: '2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae'
}
]
}
})
};
fetch('https://api.reactor.inc/models/{id}/releases/{release}/weights/finalize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.reactor.inc/models/{id}/releases/{release}/weights/finalize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'manifest' => [
'version' => 1,
'model_name' => 'your-model',
'release' => 'v1.2.3-gabcdef0',
'files' => [
[
'path' => 'model.safetensors',
'size' => 4294967296,
'sha256' => '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'
],
[
'path' => 'tokenizer/vocab.json',
'size' => 1048576,
'sha256' => '2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.reactor.inc/models/{id}/releases/{release}/weights/finalize"
payload := strings.NewReader("{\n \"manifest\": {\n \"version\": 1,\n \"model_name\": \"your-model\",\n \"release\": \"v1.2.3-gabcdef0\",\n \"files\": [\n {\n \"path\": \"model.safetensors\",\n \"size\": 4294967296,\n \"sha256\": \"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08\"\n },\n {\n \"path\": \"tokenizer/vocab.json\",\n \"size\": 1048576,\n \"sha256\": \"2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.reactor.inc/models/{id}/releases/{release}/weights/finalize")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"manifest\": {\n \"version\": 1,\n \"model_name\": \"your-model\",\n \"release\": \"v1.2.3-gabcdef0\",\n \"files\": [\n {\n \"path\": \"model.safetensors\",\n \"size\": 4294967296,\n \"sha256\": \"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08\"\n },\n {\n \"path\": \"tokenizer/vocab.json\",\n \"size\": 1048576,\n \"sha256\": \"2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reactor.inc/models/{id}/releases/{release}/weights/finalize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"manifest\": {\n \"version\": 1,\n \"model_name\": \"your-model\",\n \"release\": \"v1.2.3-gabcdef0\",\n \"files\": [\n {\n \"path\": \"model.safetensors\",\n \"size\": 4294967296,\n \"sha256\": \"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08\"\n },\n {\n \"path\": \"tokenizer/vocab.json\",\n \"size\": 1048576,\n \"sha256\": \"2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"path": "partners/8c8b7e12-a4c1-4627-b0a0-5d2e9f3a7b61/weights/your-model/7b3f1bc2-a4e5-4d78-b9c1-0e6c2f9a1d34/v1.2.3-gabcdef0/manifest.json",
"files": 2,
"copying": 1
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"message": "<string>",
"resource": "<string>",
"reason": "<string>"
}