Required tools:

Set up your application code

Install required tools

pip install -U langchain-cli
curl -sSL <https://install.python-poetry.org> | python3 -

: 'these instructions are for mac, but use an equivalent for linux/pc'
brew install gh

Create a new application

To create a new app called <app-name>, run:

: 'this will be interactive, do not add any packages when prompted'
langchain app new <app-name>

This will initialize a directory with roughly the following structure:

<my-app>/
|-- app/                
|   |-- server.py       # code to run your langserve server
|-- packages/           # used for langchain templates (you can ignore)
|-- pyproject.toml      # manage Python dependencies with poetry
|-- poetry.lock         # gives exact versions of your dependencies
|-- Dockerfile          # build application into a container which
|                       # will then be served by hosted langserve

[Optional] Digging deeper: what’s in my app?

A LangChain app has a few important components that developers should be aware of:

When Hosted LangServe eventually builds your application, we only have access to your repo and the instructions in your Dockerfile that tell us how to build it. For advanced use cases, this may require some customization. For example, if you want to package up pre-created embeddings into your application, you will need to modify your Dockerfile to download those embeddings from a known location.

Add your custom code