Deploying Lettuce

Deploying Lettuce

Lettuce provides a server for HTTP endpoints. If you have successfully run the quickstart then you have the correct setup for running a Lettuce server.

💡

Making Lettuce easier to deploy is the next milestone for development, so watch this space!

The code for the server runs from api.py

uv run lettuce-api

After running this command, you should see messages like these in your terminal:

INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
INFO:     Started reloader process [73042] using StatReload
INFO:     Started server process [73353]
INFO:     Waiting for application startup.
INFO:     Application startup complete.

This means that the server is running, and is able to accept HTTP requests.

Lettuce requires authentication, with the API key configured through the environment. The easiest way to test the API is through a service like postman or a client like bruno. You will need to set up authentication by adding an API key with the key Authorization, and the value set in the environment as AUTH_API_KEY.

Endpoints

The following endpoints will take HTTP GET requests:

  • /search/text-search/<source term>: Runs full-text search for the source term
  • /search/vector-search/<source term>: Runs semantic search for the source term
  • /search/ai-search/<source term>: Runs retrieval-augmented generation search for the source term

Request options

Pipeline options can be configured by appending them to the URL. For more information, consult the search routes documentation