Built with developer experience in mind, Tensorkube simplifies the process of deploying serverless GPU applications. In this guide, we will walk you through the process of setting up Tensorkube and deploying a FastAPI app on it. This tutorial is split into 3 parts:Documentation Index
Fetch the complete documentation index at: https://tensorfuse.io/docs/llms.txt
Use this file to discover all available pages before exploring further.
- Setting up your Tensorkube Cluster
- Time Required: 25-30 minutes
- Prerequisites:
- You must have appropriate AWS permissions to create resources on your AWS account. Please refer to the list of permissions.
- Setting up your CLI
- Time Required: 5-10 minutes
- Prerequisites:
- You must have Python and pip installed on your machine
- We support Python versions from
3.7to3.11. Make sure that your virtual environment is set up with one of these versions.
- Deploying your first Tensorkube App
- Time Required: 10-15 minutes
- Note: To deploy with GPUs, you must have GPU quotas (G and Vt or P instances) on your AWS account
Cluster Setup
We have automated the process of setting up a cluster so that you can create it with minimal effort. Please visit https://app.tensorfuse.io/ and keep this tutorial open in another tab if you need to refer to it.Step 1: Login
Login/Signup with your Gmail or workspace account.Step 2: Select your cloud provider
Currently, we only support AWS as a cloud provider.I consent, Let's Deploy button.
Step 3: Grant Permissions to Tensorfuse
Login to your AWS account using thelogin button provided. Please note that you will be redirected to the AWS console. After you are done with the login and can see your AWS console, click on the Continue button.
AWS account ID. You can find that in the top right corner of your AWS console.
Grant Permissions button.
Create Stack button.
Create Stack button.
After this, we will automatically create some granular roles with minimal access to create and manage resources on your behalf.
After both the TensorkubeAccessStack and TensorkubeGranularPermissionsStack permission stacks are created successfully, you will be able to create your cluster.
Step 4: Create Cluster
Select the region where you want to create your cluster. Enter an alert email address where you want to receive notifications about your cluster.Please note that you will receive an email from AWS about the subscription. Accept it if you want to receive notifications.
Create Cluster button.
This will take around 25-30 minutes to complete.
You can go for a walk or brew a coffee and come back later. We will take care of everything for you.
Setting up your CLI
Prerequisites
Before you begin, ensure you have the following:- Python and pip installed on your machine
- We support Python versions from
3.7to3.11. Make sure that your virtual environment is set up with one of these versions. - AWS CLI installed on your machine. You can refer to this guide to install it.
If you’re an IAM user:
If you’re an Identity Center User:
Installation
First, install the tensorkube Python package:Sync your local environment with the cloud environment
After this, run the following command to sync your local environment with the cloud environment:Deploying your first Tensorkube app
Each Tensorkube deployment requires two things - your code and your environment (as a Dockerfile).Code files
Let’s create a simple FastAPI app and deploy it on Tensorkube. Before deploying your app, ensure you have a/readiness endpoint configured in your FastAPI app.
Tensorkube uses this endpoint to check the health of your deployments. Given below is a simple FastAPI app that you can deploy:
main.py
Environment files
Add your Python dependencies to requirements.txt:requirements.txt
Dockerfile
Deploying the app
This is the easiest part. Navigate to your project root and run the following command:Deploying with GPUs
If you want to deploy your app with GPUs, you can specify the number of GPUs you want to use in your deployment: You will need to have a GPU quota on your AWS account to deploy with GPUs.
--gpu-type argument supports all the GPU types that are available on AWS. You can find the list of supported GPU types here.

