🚀 Quickstart

Installation

Installing and running dstack is very easy:

pip install dstack==0.6.5
dstack go

If you run it for the first time, it may take a while. Once it's done, you'll see the following output:

$ dstack go
To access the application, open this URL in the browser: http://localhost:8080/auth/verify?user=dstack&code=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&next=/
The default profile in "~/.dstack/config.yaml" is already configured. You are welcome to push your data using Python or R packages.
What's next?
------------
- Checkout our documentation: https://docs.dstack.ai
- Ask questions and share feedback: https://discord.gg/8xfhEYa
- Star us on GitHub: https://github.com/dstackai/dstack

To access dstack, click the URL provided in the output. Note, if you try to access dstack without using this URL, it will require you to sign up using a username and a password.

If you open the URL, you'll see the following interface:

You're logged as the dstack user. The current page is Applications. It shows you all published applications to which you have access. The sidebar on the left lets you open other pages: ML Models, Settings, Documentation, and Chat.

Now let's build a simple application to see how dstack works in action.

Minimal Application

Here's an elementary example of using dstack for building an application that takes stock exchange data and renders it for the company selected by the user.

In a real dstack application, you'd use a real data source, via a connection to a database or a data warehouse. In this simple example, we'll use plotly 's bundled dataset as the source of the data for our application. Here's how it looks like:

The first column is the date, and the others are the prices for the stock associated with the column.

Let's now see how you can use dstack to build an application that uses this data:

import dstack as ds
import plotly.express as px
app = ds.app() # create an instance of the application
# an utility function that loads the data
def get_data():
return px.data.stocks()
# a drop-down control that shows stock symbols
stock = app.select(items=get_data().columns[1:].tolist())
# a handler that updates the plot based on the selected stock
def output_handler(self, stock):
# a plotly line chart where the X axis is date and Y is the stock's price
self.data = px.line(get_data(), x='date', y=stock.value())
# a plotly chart output
app.output(handler=output_handler, depends=[stock])
# deploy the application with the name "stocks" and print its URL
url = app.deploy("stocks")
print(url)

If you run this code and click the URL printed to the output, you'll see the application:

As you see, the user is prompted to choose a stock symbol to view how its price change from date to date.

Note, deploying adstack application can be done from both Python scripts and Jupyter notebooks.

Now that you've seen how easy it's to build and deploy a simple application, proceed to the Concepts page to learn in more detail about what dstack applications consist of, and how to use all their features.

To see more advanced examples, please check out the Tutorials page.

Feedback

Do you have any feedback either minor or critical? Please, file an issue in our GitHub repo or write to us on our Discord Channel.

Have you tried dstack? Please share your feedback with us using this form!