Defining your first application
This guide assumes that you have Python installed in your environment.
1
Install the Tensorlake SDK to build and deploy applications.
2
Get an API key for your application
Fetch a key from the Tensorlake Dashboard and export it as an environment variable:
3
Check that the API key is working
4
Create a new application
Applications are defined by Python functions. The entrypoint function has to be decorated with the
@application
decorator.hello_world.py
5
Deploy Application
Calling Applications
Once you have deployed your application, it’s automatically available as an HTTP endpoint. You don’t need to deploy cloud resources or manage servers. The HTTP entrypoint for your application always starts withhttps://api.tensorlake.ai/applications/{application_name}
. Making a request to your application will return a Request ID. You can use it to track the progress of each request, and get the output when your application is done processing the request.
1
Send a request to the application
2
Wait for the application to complete the request
You can then use the request ID to wait for the application to complete. The
progress
endpoint will return a stream of events as the application progresses. If you’re using the Python SDK, you can skip this step all together.3
Get the output for your request
Once the application has completed your request, you can get the final output of the request by requesting the output of the If the function hasn’t produced any output, you will get an empty response with HTTP status code of 204. The SDK returns a
greet
function.None
value in this case.
Generally, you would want to check if the request is complete before getting the output.You can also request the output of any intermediary function via the HTTP endpoint in your application. This is useful if you want to inspect the intermediary outputs and inputs of your application.
Testing Applications
Tensorlake Applications can run locally on your laptop. You can run them like regular python scripts using therun_application
function. Since we don’t specify the remote
parameter, the application will run locally by default.
hello_world.py
Programming Guide
Learn more about customizing functions and compute resources for applications.
Dependency management
Learn how to add dependencies for your applications.
Secrets
Learn how to manage secrets that your applications access.
Parallel Processing
Learn how to use map-reduce and parallel processing to process requests faster.