//native
type Deepinfra = {
token: string;
};
/**
* Deploy Create Llm
*
*/
export async function main(
auth: Deepinfra,
body: {
model_name: string;
gpu: "A100-80GB" | "H100-80GB" | "H200-141GB";
num_gpus?: number;
max_batch_size?: number;
hf?: { repo: string; revision?: string; token?: string };
settings?: { min_instances?: number; max_instances?: number };
},
) {
const url = new URL(`https://api.deepinfra.com/deploy/llm`);
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer " + auth.token,
},
body: JSON.stringify(body),
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 235 days ago