Quickstart
This quickstart will walk you through running your first model with WriftAI
Create an Access Token
WriftAI uses access tokens to authenticate API calls and CLI commands.
- Open the Access Tokens page in your dashboard
- Create a new token and copy it somewhere safe — you’ll need it in the next step.
Set Your Access Token
Export your access token as an environment variable:
export WRIFTAI_ACCESS_TOKEN="YOUR_TOKEN_HERE"Run a Model in the Cloud
WriftAI can execute models in the cloud with no local setup required. Cloud runtimes automatically scale based on demand, making it ideal for production workloads or environments without GPUs.
To run deepseek-ai/deepseek-r1 in the cloud:
First, install the wriftai python library
pip install wriftaiThen make a request
from wriftai import Client
# Instantiate the WriftAI client
wriftai = Client()
# Create a prediction against deepseek-ai/deepseek-r1 and wait for it to complete
prediction = wriftai.predictions.create(
model="deepseek-ai/deepseek-r1",
input={
"prompt": "Summarize quantum computing.",
},
wait=True,
)
print(prediction.output)
# Quantum computing uses quantum bits to solve problems...First, install the wriftai library
npm install wriftaiThen make a request
import { WriftAI } from 'wriftai';
// Instantiate the WriftAI client
const wriftai = new WriftAI();
// Create a prediction against deepseek-ai/deepseek-r1 and wait for it to complete
const prediction = await wriftai.predictions.create(
{
model: 'deepseek-ai/deepseek-r1',
input: {
prompt: 'Summarize quantum computing.',
},
},
true, // wait for completion
);
console.log(prediction.output);
// Quantum computing uses quantum bits to solve problems...First install the package
go get -u github.com/wriftai/wriftai-goThen make a request
import (
"context"
"encoding/json"
"fmt"
"log"
"github.com/wriftai/wriftai-go"
)
func main() {
// Instantiate the WriftAI client
client := wriftai.NewClient()
// Create a prediction against deepseek-ai/deepseek-r1 and wait for it to complete
prediction, err := client.Predictions.Create(
context.TODO(),
wriftai.CreatePredictionParams{
Model: "deepseek-ai/deepseek-r1",
Input: json.RawMessage(`{"prompt":"Summarize quantum computing."}`),
},
true, // wait for completion
nil, // use default wait options
)
if err != nil {
log.Fatal(err)
}
fmt.Print(string(prediction.Output))
// Quantum computing uses quantum bits to solve problems...
}Install the WriftAI CLI, if you haven't, and make a request
# Create a prediction against deepseek-ai/deepseek-r1 and wait for it to complete
wriftai predictions create \
--model deepseek-ai/deepseek-r1 \
--input '{"prompt": "Summarize quantum computing."}' \
--wait# Create a prediction
response=$(
curl "https://api.wrift.ai/v1/predictions" \
-H "Authorization: Bearer $WRIFTAI_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-ai/deepseek-r1",
"input": {
"prompt": "Summarize quantum computing in one simple sentence."
}
}'
)
# Extract prediction ID
prediction_id=$(echo "$response" | jq -r '.id')
# Poll until status is 'succeeded' or 'failed'
status="pending"
while [[ "$status" != "succeeded" && "$status" != "failed" ]]; do
sleep 2
poll_response=$(
curl "https://api.wrift.ai/v1/predictions/$prediction_id" \
-H "Authorization: Bearer $WRIFTAI_ACCESS_TOKEN"
)
status=$(echo "$poll_response" | jq -r '.status')
done
# Print the output
echo "$poll_response" | jq -r '.output'
# Quantum computing uses quantum bits to solve problems...Run a Model Locally
You can run models directly on your machine using the WriftAI CLI.
To run deepseek-ai/deepseek-r1 locally:
wriftai model start deepseek-ai/deepseek-r1This command downloads the model and starts serving it on http://localhost:8000.
Then, set the base URL to point to your local server:
export WRIFTAI_API_BASE_URL=http://localhost:8000Once the server is running, use the same SDKs, CLI commands, and API calls shown above — they'll automatically route requests to your local server.