Phidata makes it easy to build applications using open source tools. The general workflow is:
- Import the tool you need:
- Add it to a runtime:
- Run the tools:
phi start resources.py(or
phi ws up)
To build an ML App using Jupyter for model development and FastApi for model serving, we'll import the
FastApiServer classes and add them to a
DockerConfig to run locally.
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:
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])
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.