Trequila is an open-source, bring-your-own-key (BYOK) AI-powered trip-planning API. It generates itineraries, destination images, nearby places, and "vibes" (weather/safety/crowd analysis) and streams the results back via Server-Sent Events.
Users can supply their own LLM API keys via the Trequila frontend. It supports Google Gemini, Anthropic Claude, and OpenAI-compatible endpoints.
Trequila uses a single-binary architecture with background workers that communicate via NATS JetStream.
- Go 1.24+
- PostgreSQL
- NATS Server with JetStream enabled
- Redis
Required variables:
DATABASE_URL: PostgreSQL connection string.REDIS_URL: Redis connection string.NATS_URL: NATS connection string.JWT_SECRET: Used for signing JWTs. Must be at least 32 bytes long.ENCRYPTION_KEY: A 32-byte base64 encoded string used for encrypting user API keys at rest.
Optional variables:
OSM_NOMINATIM_URL: Nominatim geocoding API URL.OSM_OVERPASS_URL: Overpass API URL for POIs.WIKIPEDIA_API_URL: Wikipedia REST API URL for hero images.OPENVERSE_API_URL: Openverse API URL for galleries.HTTP_USER_AGENT: User-Agent string for HTTP requests to open data APIs.
- Generate an
ENCRYPTION_KEY:head -c 32 /dev/urandom | base64 - Set up your database schema with
psql "$DATABASE_URL" -f init.sql. - Build the binary:
go build -o monolith ./cmd/monolith - Run:
./monolith
Trequila runs all HTTP handlers and background workers in one binary. They communicate asynchronously via an external NATS JetStream stream.
- Planner Worker: Calls the user's configured LLM for itinerary generation.
- Places Worker: Keyless enrichment using OSM Nominatim and Overpass.
- Images Worker: Keyless enrichment using Wikipedia REST and Openverse.
- Vibes Worker: Calls the LLM to analyze the places and weather data.
Apache 2.0