Client::from_env() reads a small set of environment variables to pick a provider, a key, and a default model. There are also a handful of runtime variables that affect behavior at a lower level. None are required if you build clients explicitly via Client::builder().
Provider selection
Per-provider credentials and defaults
Substitute<PROVIDER> with OPENAI, ANTHROPIC, GOOGLE, OLLAMA, AZURE, or OPENROUTER.
Provider defaults vary; check the provider builder’s source for the exact value if you don’t override.
Azure-specific
Langfuse (cognis-trace, feature langfuse)
LangfuseExporter::from_env() and LangfuseConfig::from_env() read these. Not prefixed with COGNIS_ to match Langfuse’s conventions.
Examples
Runtime variables
Cognis honors the standardtracing env vars for log filtering:
tracing-subscriber’s filter directives.
What about .env files?
Cognis does not read .env files. Plain .env on disk is a security footgun (they ship to backups, logs, and screen-sharing surfaces). Recommended setup on macOS / Linux: direnv + envchain so the same shell-loaded vars are picked up automatically. See Installation → Set credentials.
For CI: set the same variables in your runner’s secret store.
See also
Installation
The full credentials setup.
Models and providers
Builder shapes when env vars aren’t enough.