langchain/templates/cassandra-synonym-caching
David Duong d39b4b61b6
Batch apply poetry lock --no-update for all templates (#12531)
Ran the following bash script for all templates

```bash
#!/bin/bash

set -e
current_dir="$(pwd)"
for directory in */; do
    if [ -d "$directory" ]; then
        (cd "$directory" && poetry lock --no-update)
    fi
done

cd "$current_dir"
```

Co-authored-by: Bagatur <baskaryan@gmail.com>
2023-10-30 15:18:53 -07:00
..
cassandra_synonym_caching notebook fmt (#12498) 2023-10-29 15:50:09 -07:00
.env.template Templates (#12294) 2023-10-25 18:47:42 -07:00
poetry.lock Batch apply poetry lock --no-update for all templates (#12531) 2023-10-30 15:18:53 -07:00
pyproject.toml various templates improvements (#12500) 2023-10-28 22:13:22 -07:00
README.md Templates (#12294) 2023-10-25 18:47:42 -07:00

LLM-cache LangServe chain template

A simple chain template showcasing usage of LLM Caching backed by Astra DB / Apache Cassandra®.

Setup:

You need:

  • an Astra Vector Database (free tier is fine!). You need a Database Administrator token, in particular the string starting with AstraCS:...;
  • likewise, get your Database ID ready, you will have to enter it below;
  • an OpenAI API Key. (More info here, note that out-of-the-box this demo supports OpenAI unless you tinker with the code.)

Note: you can alternatively use a regular Cassandra cluster: to do so, make sure you provide the USE_CASSANDRA_CLUSTER entry as shown in .env.template and the subsequent environment variables to specify how to connect to it.

You need to provide the connection parameters and secrets through environment variables. Please refer to .env.template for what variables are required.

Reference

Stand-alone LangServe template repo: here.