Toggle Menu
Prev Up Next

# `langchain_core.globals`.set_llm_cache

langchain_core.globals.set_llm_cache(value: Optional[BaseCache]) → None

  Set a new LLM cache, overwriting the previous value, if any.

  Parameters

    value (Optional[BaseCache]) –

  Return type

    None

# Examples using set_llm_cache

- <!– ruff: noqa: F821 –>

- Astra DB

- Cassandra

- From LangChain, import standard modules for prompting.

- Momento

- MongoDB Atlas

- Redis

- To make the caching really obvious, lets use a slower model.