Load Local Env File
Why
Tiny Narrator now documents credentials in .env.example, but the app only reads process environment variables. A local developer can create .env exactly as the docs imply and still get fallback behavior because app.py never loads the file.
This should be fixed before more live-model work lands, because MiniCPM, Modal Klein, llama.cpp, public URLs, and timeouts all depend on environment configuration.
What Changes
- Load
.envautomatically during app startup before environment-backed settings are read. - Add
python-dotenvto project dependencies. - Keep explicit process environment values authoritative.
- Update setup docs to say
.envis read automatically. - Extend verification so missing dependency or misplaced loading is caught.
Capabilities
local-env-loading: load.envfor local development without requiring shell-specific export commands.env-precedence: preserve process environment precedence over.envvalues.configuration-verification: verify dependency and docs coverage for local environment loading.
Non-Goals
- Do not commit real secrets.
- Do not change names or meanings of existing environment variables.
- Do not require
.envto exist for verification or production startup. - Do not expose any secret values through runtime APIs.
Impact
app.pywill import and callload_dotenv()before reading configuration constants.requirements.txtwill includepython-dotenv..env.example, README, and runtime setup text may be updated to clarify the workflow.scripts/verify.pywill assert that local env loading is wired in.