To create a LangStream cluster locally, it's recommended to use minikube - setting 4 CPUs is highly recommended.
mini-langstream
comes in help for installing and managing your local cluster.
mini-langstream requires the following commands to be already installed:
- Docker
- Minikube
- Helm
- Kubectl
- LangStream CLI
{% hint style="info" %} If you install mini-langstream using Brew, all the dependencies are automatically installed. {% endhint %}
MacOS:
brew install LangStream/langstream/mini-langstream
Unix:
curl -Ls "https://raw.githubusercontent.com/LangStream/langstream/main/mini-langstream/get-mini-langstream.sh" | bash
mini-langstream will do all the setup for you, in particular:
- start
minikube
in a dedicated context - deploy LangStream components using
helm
- run a stateful Kafka broker as docker container
- run a stateful s3-compatible storage (MinIO) as docker container
- forward the control plane and API Gateways ports locally
- create a dedicated LangStream CLI profile to interact with the cluster
- wrap all the common k8s tools to inspect the cluster (
mini-langstream kubectl
,mini-langstream helm
,mini-langstream k9s
)
- Start or ensure the cluster is running:
mini-langstream start
- Try to use the CLI:
mini-langstream cli apps list
- Deploy an application:
export OPENAI_API_KEY=<your-openai-api-key>
mini-langstream cli apps deploy my-app -app https://github.com/LangStream/langstream/tree/main/examples/applications/openai-completions -s https://github.com/LangStream/langstream/blob/main/examples/secrets/secrets.yaml
To delete all the storage and stop the cluster:
mini-langstream delete
Here are a few ways to get started building LangStream applications:
- Build a sample application to quickly create an OpenAI query with LangStream.
- Set up your development environment and learn how to build the needed manifests
- Install the VSCode extension and use the provided starter applications & agent snippets