POST
/
models
import Together from "together-ai";

const client = new Together({
apiKey: process.env.TOGETHER_API_KEY,
});

const response = await client.models.upload({
model_name: "My-Fine-Tuned-Model",
model_source: "https://ml-models.s3.us-west-2.amazonaws.com/models/my-fine-tuned-model.tar.gz",
})

console.log(response);
{
  "data": {
    "job_id": "job-a15dad11-8d8e-4007-97c5-a211304de284",
    "model_name": "necolinehubner/Qwen2.5-72B-Instruct",
    "model_id": "model-c0e32dfc-637e-47b2-bf4e-e9b2e58c9da7",
    "model_source": "huggingface"
  },
  "message": "Processing model weights. Job created."
}

Authorizations

Authorization
string
header
default:default
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model_name
string
required

The name to give to your uploaded model

Example:

"Qwen2.5-72B-Instruct"

model_source
string
required

The source location of the model (Hugging Face repo or S3 path)

Example:

"unsloth/Qwen2.5-72B-Instruct"

model_type
enum<string>
default:model

Whether the model is a full model or an adapter

Available options:
model,
adapter
Example:

"model"

hf_token
string

Hugging Face token (if uploading from Hugging Face)

Example:

"hf_examplehuggingfacetoken"

description
string

A description of your model

Example:

"Finetuned Qwen2.5-72B-Instruct by Unsloth"

base_model
string

The base model to use for an adapter if setting it to run against a serverless pool. Only used for model_type adapter.

Example:

"Qwen/Qwen2.5-72B-Instruct"

lora_model
string

The lora pool to use for an adapter if setting it to run against, say, a dedicated pool. Only used for model_type adapter.

Example:

"my_username/Qwen2.5-72B-Instruct-lora"

Response

200 - application/json

Model / adapter upload job created successfully

data
object
required
message
string
required
Example:

"Processing model weights. Job created."