Environment Variables
To call your LLM from a third-party service, you’ll likely need some environment variables to keep your API keys safe.
Setting Up Env Variables
-
Create a
.envfile in the root of your project:.env OPENAI_API_KEY=your-api-key -
Add
.envto your.gitignore, if it’s not already there.gitignore .env -
Install
dotenv:Terminal window pnpm add -D dotenv -
Add an
evalite.config.tsfile:evalite.config.ts import { defineConfig } from "evalite/config";export default defineConfig({setupFiles: ["dotenv/config"],});
Now, your environment variables will be available in your evals.