Skip to main content

Environment variables

Weave provides a set of environment variables to configure and optimize its behavior. You can set these variables in your shell or within scripts to control specific functionality.

# Example of setting environment variables in the shell
export WEAVE_PARALLELISM=10 # Controls the number of parallel workers
export WEAVE_PRINT_CALL_LINK=false # Disables call link output
# Example of setting environment variables in Python
import os

os.environ["WEAVE_PARALLELISM"] = "10"
os.environ["WEAVE_PRINT_CALL_LINK"] = "false"

Available Environment Variables

VariableTypeDefaultDescription
WEAVE_DISABLEDboolfalseWhen set to true, disables all Weave tracing. Weave ops will behave like regular functions.
WEAVE_PRINT_CALL_LINKbooltrueControls whether to print a link to the Weave UI when calling a Weave op.
WEAVE_CAPTURE_CODEbooltrueControls whether to save code for ops so they can be reloaded for later use.
WEAVE_DEBUG_HTTPboolfalseWhen set to true, turns on HTTP request and response logging for debugging.
WEAVE_PARALLELISMint20In evaluations, controls the number of examples to evaluate in parallel. Set to 1 to run examples sequentially.
WEAVE_TRACE_LANGCHAINbooltrueControls global tracing for LangChain. Set to false to explicitly disable LangChain tracing.
WEAVE_USE_SERVER_CACHEboolfalseEnables server response caching. When enabled, responses from the server are cached to disk to improve performance for repeated queries.
WEAVE_SERVER_CACHE_SIZE_LIMITint1000000000Sets the maximum size limit for the server cache in bytes. When the cache reaches this size, older entries are automatically removed to make space for new ones. Important: the underlying implementation uses SQLite which has a Write Ahead Log (WAL) that will grow to 4MB regardless of this setting. This WAL will be removed when the program exits.
WEAVE_SERVER_CACHE_DIRstrNoneSpecifies the directory where cache files should be stored. If not set, a temporary directory is used.
note

All boolean environment variables accept the following values (case-insensitive):

  • true, 1, yes, on for True
  • false, 0, no, off for False