This repository contains code from the blog post about using Batch API to reduce your LLM costs by 50%.
In order to run this project, you need to create an API key in OpenAI:
- Run
cp .env.sample .env
- Create an account or log in with you existing one
- Where do I find my API key?
- Create a new API key
- Copy the key and paste it in the
.env
file
This project is meant to be run with Docker
and Devcontainers.
The settings are located inside .devcontainer/devcontainer.json
.
To set up a devcontainer with your IDE, follow these instructions:
Once the devcontainer is created, run a terminal inside it and execute:
uv sync
Follow these steps:
- Install Python v3.12
- Install uv
- Run
uv sync
Run uv run create_batch.py