Deploy Create Llm
curl --request POST \
--url https://api.deepinfra.com/deploy/llm \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model_name": "<string>",
"num_gpus": 1,
"hf": {
"repo": "<string>",
"revision": "<string>",
"token": "<string>"
},
"base_model": "<string>",
"container_image": "<string>",
"settings": {
"min_instances": 1,
"max_instances": 1
},
"extra_args": [
"<string>"
],
"standard_args": {
"max_context_size": 5000000,
"max_concurrent_requests": 512,
"max_images_per_prompt": 512,
"gpu_memory_fraction": 0.735,
"max_prefill_tokens": 65792,
"enable_prefix_caching": true
},
"preset_id": "<string>"
}
'import requests
url = "https://api.deepinfra.com/deploy/llm"
payload = {
"model_name": "<string>",
"num_gpus": 1,
"hf": {
"repo": "<string>",
"revision": "<string>",
"token": "<string>"
},
"base_model": "<string>",
"container_image": "<string>",
"settings": {
"min_instances": 1,
"max_instances": 1
},
"extra_args": ["<string>"],
"standard_args": {
"max_context_size": 5000000,
"max_concurrent_requests": 512,
"max_images_per_prompt": 512,
"gpu_memory_fraction": 0.735,
"max_prefill_tokens": 65792,
"enable_prefix_caching": True
},
"preset_id": "<string>"
}
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({
model_name: '<string>',
num_gpus: 1,
hf: {repo: '<string>', revision: '<string>', token: '<string>'},
base_model: '<string>',
container_image: '<string>',
settings: {min_instances: 1, max_instances: 1},
extra_args: ['<string>'],
standard_args: {
max_context_size: 5000000,
max_concurrent_requests: 512,
max_images_per_prompt: 512,
gpu_memory_fraction: 0.735,
max_prefill_tokens: 65792,
enable_prefix_caching: true
},
preset_id: '<string>'
})
};
fetch('https://api.deepinfra.com/deploy/llm', 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.deepinfra.com/deploy/llm",
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([
'model_name' => '<string>',
'num_gpus' => 1,
'hf' => [
'repo' => '<string>',
'revision' => '<string>',
'token' => '<string>'
],
'base_model' => '<string>',
'container_image' => '<string>',
'settings' => [
'min_instances' => 1,
'max_instances' => 1
],
'extra_args' => [
'<string>'
],
'standard_args' => [
'max_context_size' => 5000000,
'max_concurrent_requests' => 512,
'max_images_per_prompt' => 512,
'gpu_memory_fraction' => 0.735,
'max_prefill_tokens' => 65792,
'enable_prefix_caching' => true
],
'preset_id' => '<string>'
]),
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.deepinfra.com/deploy/llm"
payload := strings.NewReader("{\n \"model_name\": \"<string>\",\n \"num_gpus\": 1,\n \"hf\": {\n \"repo\": \"<string>\",\n \"revision\": \"<string>\",\n \"token\": \"<string>\"\n },\n \"base_model\": \"<string>\",\n \"container_image\": \"<string>\",\n \"settings\": {\n \"min_instances\": 1,\n \"max_instances\": 1\n },\n \"extra_args\": [\n \"<string>\"\n ],\n \"standard_args\": {\n \"max_context_size\": 5000000,\n \"max_concurrent_requests\": 512,\n \"max_images_per_prompt\": 512,\n \"gpu_memory_fraction\": 0.735,\n \"max_prefill_tokens\": 65792,\n \"enable_prefix_caching\": true\n },\n \"preset_id\": \"<string>\"\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.deepinfra.com/deploy/llm")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model_name\": \"<string>\",\n \"num_gpus\": 1,\n \"hf\": {\n \"repo\": \"<string>\",\n \"revision\": \"<string>\",\n \"token\": \"<string>\"\n },\n \"base_model\": \"<string>\",\n \"container_image\": \"<string>\",\n \"settings\": {\n \"min_instances\": 1,\n \"max_instances\": 1\n },\n \"extra_args\": [\n \"<string>\"\n ],\n \"standard_args\": {\n \"max_context_size\": 5000000,\n \"max_concurrent_requests\": 512,\n \"max_images_per_prompt\": 512,\n \"gpu_memory_fraction\": 0.735,\n \"max_prefill_tokens\": 65792,\n \"enable_prefix_caching\": true\n },\n \"preset_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deepinfra.com/deploy/llm")
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 \"model_name\": \"<string>\",\n \"num_gpus\": 1,\n \"hf\": {\n \"repo\": \"<string>\",\n \"revision\": \"<string>\",\n \"token\": \"<string>\"\n },\n \"base_model\": \"<string>\",\n \"container_image\": \"<string>\",\n \"settings\": {\n \"min_instances\": 1,\n \"max_instances\": 1\n },\n \"extra_args\": [\n \"<string>\"\n ],\n \"standard_args\": {\n \"max_context_size\": 5000000,\n \"max_concurrent_requests\": 512,\n \"max_images_per_prompt\": 512,\n \"gpu_memory_fraction\": 0.735,\n \"max_prefill_tokens\": 65792,\n \"enable_prefix_caching\": true\n },\n \"preset_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"deploy_id": "fkj843kjh8",
"model_name": "google/vit-base-patch16-224",
"version": "d8b79b422843bd59d628bf25b01aded94a9ec1a9b917e69fe460df9ff39ec42b",
"task": "image-classification",
"status": "deployed",
"fail_reason": "Initialization failed",
"created_at": "2021-08-27T17:19:21+00:00",
"updated_at": "2021-08-27T17:19:21+00:00",
"type": "legacy",
"instances": {
"running": 123,
"pending": 123,
"warming": 0
},
"config": {
"gpu": "L4-24GB",
"num_gpus": 123,
"max_batch_size": 123,
"weights": {
"repo": "<string>",
"revision": "<string>",
"token": "<string>"
}
},
"settings": {
"min_instances": 1,
"max_instances": 1
},
"standard_args": {
"max_context_size": 5000000,
"max_concurrent_requests": 512,
"max_images_per_prompt": 512,
"gpu_memory_fraction": 0.735,
"max_prefill_tokens": 65792,
"kv_cache_dtype": "auto",
"enable_prefix_caching": true,
"quantization": "fp8"
},
"extra_args": [
"<string>"
],
"update_error": "<string>",
"rollout": {
"up_to_date": 123,
"outdated": 123,
"booting": 123
}
}{
"error": "Model not found"
}{
"error": "Model not found"
}{
"error": "Model not found"
}{
"error": "Model not found"
}Dedicated Models
Deploy Create Llm
POST
/
deploy
/
llm
Deploy Create Llm
curl --request POST \
--url https://api.deepinfra.com/deploy/llm \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model_name": "<string>",
"num_gpus": 1,
"hf": {
"repo": "<string>",
"revision": "<string>",
"token": "<string>"
},
"base_model": "<string>",
"container_image": "<string>",
"settings": {
"min_instances": 1,
"max_instances": 1
},
"extra_args": [
"<string>"
],
"standard_args": {
"max_context_size": 5000000,
"max_concurrent_requests": 512,
"max_images_per_prompt": 512,
"gpu_memory_fraction": 0.735,
"max_prefill_tokens": 65792,
"enable_prefix_caching": true
},
"preset_id": "<string>"
}
'import requests
url = "https://api.deepinfra.com/deploy/llm"
payload = {
"model_name": "<string>",
"num_gpus": 1,
"hf": {
"repo": "<string>",
"revision": "<string>",
"token": "<string>"
},
"base_model": "<string>",
"container_image": "<string>",
"settings": {
"min_instances": 1,
"max_instances": 1
},
"extra_args": ["<string>"],
"standard_args": {
"max_context_size": 5000000,
"max_concurrent_requests": 512,
"max_images_per_prompt": 512,
"gpu_memory_fraction": 0.735,
"max_prefill_tokens": 65792,
"enable_prefix_caching": True
},
"preset_id": "<string>"
}
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({
model_name: '<string>',
num_gpus: 1,
hf: {repo: '<string>', revision: '<string>', token: '<string>'},
base_model: '<string>',
container_image: '<string>',
settings: {min_instances: 1, max_instances: 1},
extra_args: ['<string>'],
standard_args: {
max_context_size: 5000000,
max_concurrent_requests: 512,
max_images_per_prompt: 512,
gpu_memory_fraction: 0.735,
max_prefill_tokens: 65792,
enable_prefix_caching: true
},
preset_id: '<string>'
})
};
fetch('https://api.deepinfra.com/deploy/llm', 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.deepinfra.com/deploy/llm",
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([
'model_name' => '<string>',
'num_gpus' => 1,
'hf' => [
'repo' => '<string>',
'revision' => '<string>',
'token' => '<string>'
],
'base_model' => '<string>',
'container_image' => '<string>',
'settings' => [
'min_instances' => 1,
'max_instances' => 1
],
'extra_args' => [
'<string>'
],
'standard_args' => [
'max_context_size' => 5000000,
'max_concurrent_requests' => 512,
'max_images_per_prompt' => 512,
'gpu_memory_fraction' => 0.735,
'max_prefill_tokens' => 65792,
'enable_prefix_caching' => true
],
'preset_id' => '<string>'
]),
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.deepinfra.com/deploy/llm"
payload := strings.NewReader("{\n \"model_name\": \"<string>\",\n \"num_gpus\": 1,\n \"hf\": {\n \"repo\": \"<string>\",\n \"revision\": \"<string>\",\n \"token\": \"<string>\"\n },\n \"base_model\": \"<string>\",\n \"container_image\": \"<string>\",\n \"settings\": {\n \"min_instances\": 1,\n \"max_instances\": 1\n },\n \"extra_args\": [\n \"<string>\"\n ],\n \"standard_args\": {\n \"max_context_size\": 5000000,\n \"max_concurrent_requests\": 512,\n \"max_images_per_prompt\": 512,\n \"gpu_memory_fraction\": 0.735,\n \"max_prefill_tokens\": 65792,\n \"enable_prefix_caching\": true\n },\n \"preset_id\": \"<string>\"\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.deepinfra.com/deploy/llm")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model_name\": \"<string>\",\n \"num_gpus\": 1,\n \"hf\": {\n \"repo\": \"<string>\",\n \"revision\": \"<string>\",\n \"token\": \"<string>\"\n },\n \"base_model\": \"<string>\",\n \"container_image\": \"<string>\",\n \"settings\": {\n \"min_instances\": 1,\n \"max_instances\": 1\n },\n \"extra_args\": [\n \"<string>\"\n ],\n \"standard_args\": {\n \"max_context_size\": 5000000,\n \"max_concurrent_requests\": 512,\n \"max_images_per_prompt\": 512,\n \"gpu_memory_fraction\": 0.735,\n \"max_prefill_tokens\": 65792,\n \"enable_prefix_caching\": true\n },\n \"preset_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deepinfra.com/deploy/llm")
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 \"model_name\": \"<string>\",\n \"num_gpus\": 1,\n \"hf\": {\n \"repo\": \"<string>\",\n \"revision\": \"<string>\",\n \"token\": \"<string>\"\n },\n \"base_model\": \"<string>\",\n \"container_image\": \"<string>\",\n \"settings\": {\n \"min_instances\": 1,\n \"max_instances\": 1\n },\n \"extra_args\": [\n \"<string>\"\n ],\n \"standard_args\": {\n \"max_context_size\": 5000000,\n \"max_concurrent_requests\": 512,\n \"max_images_per_prompt\": 512,\n \"gpu_memory_fraction\": 0.735,\n \"max_prefill_tokens\": 65792,\n \"enable_prefix_caching\": true\n },\n \"preset_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"deploy_id": "fkj843kjh8",
"model_name": "google/vit-base-patch16-224",
"version": "d8b79b422843bd59d628bf25b01aded94a9ec1a9b917e69fe460df9ff39ec42b",
"task": "image-classification",
"status": "deployed",
"fail_reason": "Initialization failed",
"created_at": "2021-08-27T17:19:21+00:00",
"updated_at": "2021-08-27T17:19:21+00:00",
"type": "legacy",
"instances": {
"running": 123,
"pending": 123,
"warming": 0
},
"config": {
"gpu": "L4-24GB",
"num_gpus": 123,
"max_batch_size": 123,
"weights": {
"repo": "<string>",
"revision": "<string>",
"token": "<string>"
}
},
"settings": {
"min_instances": 1,
"max_instances": 1
},
"standard_args": {
"max_context_size": 5000000,
"max_concurrent_requests": 512,
"max_images_per_prompt": 512,
"gpu_memory_fraction": 0.735,
"max_prefill_tokens": 65792,
"kv_cache_dtype": "auto",
"enable_prefix_caching": true,
"quantization": "fp8"
},
"extra_args": [
"<string>"
],
"update_error": "<string>",
"rollout": {
"up_to_date": 123,
"outdated": 123,
"booting": 123
}
}{
"error": "Model not found"
}{
"error": "Model not found"
}{
"error": "Model not found"
}{
"error": "Model not found"
}When called with an API key, the key needs the
models scope (about scopes).Authorizations
Body
application/json
Response
Successful Response