Skip to content
GitHubDiscord

Settings

Environment and runtime configuration for Giskard Checks. Two models are involved: the generator (the LLM used by LLM-backed checks, including as a judge) and the embedding model (used by checks such as SemanticSimilarity). Both default to OpenAI, and both send the text they are given to the provider you configure.

Module: giskard.checks.settings


Pydantic BaseSettings model. Every field can be set with an environment variable prefixed GISKARD_CHECKS_, or in a .env file at the project root. Unknown variables are ignored.

default_model str Default: "openai/gpt-4o-mini"

LLM used by checks constructed without an explicit generator. Environment variable: GISKARD_CHECKS_DEFAULT_MODEL.

default_embedding_model str Default: "text-embedding-3-small"

Embedding model used by checks constructed without an explicit model. Environment variable: GISKARD_CHECKS_DEFAULT_EMBEDDING_MODEL.

disable_rich_pretty bool Default: False

When False (the default), importing giskard.checks installs rich.pretty for nicer REPL output. Environment variable: GISKARD_CHECKS_DISABLE_RICH_PRETTY.

max_reported_failures int | None Default: None

How many failed or errored scenarios the printed suite report includes. None means all of them. The SuiteResult object still holds every scenario; this only truncates the Rich output. Values that are not a non-negative integer become None. Environment variable: GISKARD_CHECKS_MAX_REPORTED_FAILURES.

.env
GISKARD_CHECKS_DEFAULT_MODEL=openai/gpt-5-mini
GISKARD_CHECKS_DEFAULT_EMBEDDING_MODEL=text-embedding-3-large
GISKARD_CHECKS_MAX_REPORTED_FAILURES=20
GISKARD_CHECKS_DISABLE_RICH_PRETTY=true
get_settings() GiskardChecksSettings

Return a new GiskardChecksSettings loaded from the environment. Each call rebuilds the object, so changes to environment variables are picked up without restarting the process.

from giskard.checks.settings import get_settings
settings = get_settings()
print(settings.default_model) # "openai/gpt-4o-mini"

LLM-backed checks such as LLMJudge, Groundedness, and Toxicity use this generator when you do not pass one yourself. A runtime override from set_default_generator wins over GISKARD_CHECKS_DEFAULT_MODEL.

set_default_generator() None

Set the process-wide default LLM generator.

generator BaseGenerator Required
Generator used by LLM checks that do not receive one explicitly.
get_default_generator() BaseGenerator

Return the runtime override if one was set, otherwise a Generator built from GISKARD_CHECKS_DEFAULT_MODEL (falling back to openai/gpt-4o-mini).

from giskard.agents.generators import Generator
from giskard.checks import get_default_generator, set_default_generator
set_default_generator(Generator(model="openai/gpt-5-mini"))
get_default_generator() # the generator set above

To set this once per pytest session, see CI/CD Integration.

get_default_embedding_model() EmbeddingModel

Return an EmbeddingModel built from GISKARD_CHECKS_DEFAULT_EMBEDDING_MODEL (falling back to text-embedding-3-small).


from giskard.checks import get_default_generator, set_default_generator
from giskard.checks.settings import (
GiskardChecksSettings,
get_default_embedding_model,
get_settings,
)