Skip to content

Commit

Permalink
feat: allowing frontend to use a separate server for backend
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyashankar committed Dec 22, 2024
1 parent 3dba91b commit e3ef30d
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions docs/playground/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ Building complex LLM pipelines for your data often requires experimentation and
- ✨ Refine operations based on sample outputs
- 🔄 Build complex pipelines step-by-step

## Public Playground

You can access our hosted playground at [docetl.org/playground](https://docetl.org/playground). You'll need to provide your own LLM API keys to use the service. The chatbot and prompt engineering assistants are powered by OpenAI models, so you'll need to provide an OpenAI API key.

!!! note "Data Storage Notice"

As this is a research project, we cache results and store data on our servers to improve the system. While we will never sell or release your data, if you have privacy concerns, we recommend running the playground locally using the installation instructions below.

## Installation

There are two ways to run the playground:
Expand All @@ -24,7 +32,9 @@ The easiest way to get started is using Docker:

Create `.env` in the root directory (for the FastAPI backend):
```bash
OPENAI_API_KEY=your_api_key_here # Or your LLM provider's API key
# Required: API key for your preferred LLM provider (OpenAI, Anthropic, etc)
# The key format will depend on your chosen provider (sk-..., anthro-...)
OPENAI_API_KEY=your_api_key_here
BACKEND_ALLOW_ORIGINS=
BACKEND_HOST=localhost
BACKEND_PORT=8000
Expand All @@ -35,9 +45,11 @@ FRONTEND_PORT=3000

Create `.env.local` in the `website` directory (for the frontend) **note that this must be in the `website` directory**:
```bash
OPENAI_API_KEY=sk-xxx # For the AI assistant in the interface
OPENAI_API_BASE=https://api.openai.com/v1 # For the AI assistant in the interface
MODEL_NAME=gpt-4o-mini # For the AI assistant in the interface
# Optional: These are only needed if you want to use the AI assistant chatbot
# and prompt engineering tools. Must be OpenAI API keys specifically.
OPENAI_API_KEY=sk-xxx
OPENAI_API_BASE=https://api.openai.com/v1
MODEL_NAME=gpt-4o-mini

NEXT_PUBLIC_BACKEND_HOST=localhost
NEXT_PUBLIC_BACKEND_PORT=8000
Expand Down Expand Up @@ -72,7 +84,7 @@ cd docetl

2. Set up environment variables in `.env` in the root directory:
```bash
OPENAI_API_KEY=your_api_key_here
LLM_API_KEY=your_api_key_here
BACKEND_ALLOW_ORIGINS=
BACKEND_HOST=localhost
BACKEND_PORT=8000
Expand Down

0 comments on commit e3ef30d

Please sign in to comment.