Setup Guide¶
This page walks you through setting up your environment for the workshop.
Option A: GitHub Codespaces (Recommended)¶
The fastest way to get started — no local setup required. Everything is pre-configured.
- Go to the repository on GitHub
- Click Code → Codespaces → Create codespace on main
- Wait for the environment to build (~2 minutes)
- Dependencies are installed automatically — just configure your
.envfile (see Step 4 below) - Run the connection test:
Option B: Local Setup¶
Prerequisites¶
- Python 3.11+ installed
- A terminal (bash, zsh, PowerShell)
- An API key for at least one LLM provider (see below)
1. Clone the Repository¶
2. Create a Virtual Environment¶
3. Install Dependencies¶
This installs:
openai— The OpenAI Python SDK (works with all 3 providers)python-dotenv— Loads environment variables from.envpydantic— Data validation and structured output schemasmkdocs-material— Documentation site (for reading these docs locally)
4. Configure Your Provider¶
Copy the example environment file:
Then edit .env with your provider credentials:
How to get a token:
- Go to github.com/settings/tokens
- Generate a new token (classic) with no special scopes needed
- GitHub Models provides free-tier access to GPT-4o, GPT-4o-mini, and other models
How to get a key:
- Go to platform.openai.com/api-keys
- Create a new API key
- Add billing/credits to your account
LLM_PROVIDER=azure
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
AZURE_OPENAI_API_KEY=your-key-here
AZURE_OPENAI_DEPLOYMENT=your-deployment-name
AZURE_OPENAI_API_VERSION=2024-12-01-preview
MODEL_NAME=gpt-4o-mini
How to set up:
- Create an Azure OpenAI resource in the Azure Portal
- Deploy a model (e.g.,
gpt-4o-mini) in Azure AI Foundry - Copy the endpoint, key, and deployment name
5. Test Your Connection¶
You should see output like:
[INFO] Testing connection to LLM provider...
[INFO] Provider: github
[INFO] Model: gpt-4o-mini
[INFO] Response: Hello! How can I help you today?
[INFO] Connection successful!
If you see errors, check:
- Is your
.envfile in the project root? - Are your API credentials correct?
- Is the model name valid for your provider?
6. (Optional) Serve the Documentation Locally¶
Then open http://127.0.0.1:8000 in your browser.
Environment Variables Reference¶
| Variable | Required For | Description |
|---|---|---|
LLM_PROVIDER |
All | openai, azure, or github |
OPENAI_API_KEY |
OpenAI | Your OpenAI API key |
GITHUB_TOKEN |
GitHub Models | Your GitHub personal access token |
AZURE_OPENAI_ENDPOINT |
Azure | Your Azure OpenAI endpoint URL |
AZURE_OPENAI_API_KEY |
Azure | Your Azure OpenAI key |
AZURE_OPENAI_DEPLOYMENT |
Azure | Your deployed model name |
AZURE_OPENAI_API_VERSION |
Azure | API version (e.g., 2024-12-01-preview) |
MODEL_NAME |
Optional | Override the default model name |
LOG_LEVEL |
Optional | DEBUG, INFO (default), WARNING |
Next Steps¶
Once your connection test passes, proceed to Chat Completions API to start learning.