CIRED / CIRED/cired.digital

Set OpenAI budget alert: embeddings are the app's single billing point of failure

Open Beginner friendly
#266 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Context
On 2026-06-22 Cirdi was down: every query returned HTTP 500. Root cause was an OpenAI `429 insufficient_quota` — the OpenAI account ran out of credit. R2R embeds every query with `openai/text-embedding-3-small` (the retrieval step), so an exhausted OpenAI quota 500s every request **even though generation runs on Mistral**. Health endpoint stayed `ok` throughout, which masked the cause.

This is a single point of failure with no early warning, and it will recur.

## Actions
- [ ] On the OpenAI project behind `OPENAI_API_KEY`, set a monthly budget limit and a usage/balance alert email (well below the hard cap).
- [ ] Document in `deploy/` that embeddings depend on OpenAI billing, distinct from the Mistral generation account.
- [ ] Note: Anthropic offers no embeddings API, so Claude credit cannot cover this step.

## Notes
- Switching embedding providers is **not** a quick mitigation: the ~1199 stored vectors are tied to `text-embedding-3-small` and would need full re-embedding.
- Overlaps with #234 (availability watch / SMS): a balance/usage alert is the upstream signal that #234's availability probe would otherwise only catch after users hit errors.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the deployment documentation in deploy/ and identifying the OpenAI project behind OPENAI_API_KEY. Configure a monthly budget limit and a lower usage or balance alert, then document that query embeddings use OpenAI billing separately from Mistral generation. Done means the alert is configured and the dependency is recorded in deploy/.

Written by the indexing model from the issue text.

Assessment

Domain
cloud, documentation
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.