Basics

Phidata makes it easy to build applications using open source tools. The general workflow is:

  1. Import the tool you need: FastApi, Django, Jupyter, Streamlit
  2. Add it to a runtime: DockerConfig, AWSConfig or K8sConfig
  3. Run the tools: phi start resources.py (or phi ws up)

Example

To build an ML App using Jupyter for model development and FastApi for model serving, we'll import the Jupyter and FastApiServer classes and add them to a DockerConfig to run locally.

dev_resources.py

from phidata.app.jupyter import Jupyter
from phidata.app.fastapi import FastApiServer
from phidata.docker.config import DockerConfig

# -*- Jupyter running on port 8888
dev_jupyter = Jupyter()

# -*- FastApiServer running on port 9090
dev_fastapi = FastApiServer()

dev_docker_config = DockerConfig(apps=[dev_jupyter, dev_fastapi])
  • Run the tools using phi start dev_resources.py
  • Stop them using phi stop dev_resources.py

Your application will eventually need a database, adding it is as simple as:

dev_resources.py

from phidata.app.postgres import PostgresDb

# -*- PostgresDb running on port 5432
dev_db = PostgresDb(db_user="phi", db_password="phi", db_schema="phi")

dev_docker_config = DockerConfig(apps=[dev_jupyter, dev_fastapi, dev_db])

Templates

Instead of wiring tools one by one, phidata provides pre-built templates for common applications. Templates are tested in production by large teams, are fully customizable and come with:

  • Development Environment for running the application locally.
  • Production Environment for running the application on AWS.
  • Best practices like Testing, Formatting, Linting, CI/CD, Security and Secret management.

Templates are available for LLM Apps, Web Apps (Django), RestAPIs (FastApi) and Data Platforms.

Guides

LLM App

Build an LLM App using FastApi, Jupyter and Streamlit

Read more

Django App

Build a Web App using Django and Postgres

Read more

API App

Build a RestAPI using FastApi and Postgres

Read more

Data Platform

Build a Data Platform using Airflow, Superset and Jupyter

Read more