{
  "id": "readme",
  "title": "",
  "url": "https://redis.io/docs/latest/develop/use-cases/semantic-cache/java-lettuce/readme/",
  "summary": "",
  "tags": [],
  "last_updated": "2026-06-01T09:32:08+01:00",
  "page_type": "content",
  "content_hash": "167c493132753926c44a8b9c4db07d30471eb656c46c52a66baf491c8f99ded8",
  "sections": [
    {
      "id": "content",
      "title": "Content",
      "role": "content",
      "text": "# Redis semantic-cache demo (Java + Lettuce)\n\nSee `_index.md` for the full walkthrough. Quick start:\n\n[code example]\n\nThen open <http://localhost:8090>.\n\nNotable flags (full list with `--help`):\n\n| Flag                      | Default            |\n|---------------------------|--------------------|\n| `--port`                  | `8090`             |\n| `--redis-host`            | `localhost`        |\n| `--redis-port`            | `6379`             |\n| `--index-name`            | `semcache:idx`     |\n| `--key-prefix`            | `cache:`           |\n| `--ttl-seconds`           | `3600`             |\n| `--threshold`             | `0.5`              |\n| `--llm-latency-ms`        | `1500.0`           |\n| `--no-reset`              | (re-seeds by default) |"
    }
  ],
  "examples": [
    {
      "id": "content-ex0",
      "language": "bash",
      "code": "# 1. Make sure Redis with the Search module is running on localhost:6379.\n# 2. Build the fat jar (first build pulls Lettuce, DJL, and the PyTorch\n#    native libraries; takes a minute or two):\nmvn -q package\n\n# 3. Run. The first run downloads the sentence-transformers/all-MiniLM-L6-v2\n#    PyTorch weights into the local DJL cache (~90 MB).\njava -jar target/semantic-cache-lettuce.jar\n\n# Or with Maven directly:\nmvn -q exec:java",
      "section_id": "content"
    }
  ]
}
