Skip to content

Commit a6783e0

Browse files
committed
feat(lightning-ai): dollar credit quotas and date parsing
Recover the Lightning AI provider from dangling git objects (lost during linear rebase) and archive other retired fork-only providers before they are garbage-collected. Live provider: - lightning_ai_provider.py: OpenAI-compatible API with dollar-based monthly credit quota tracking via /v1/memberships - lightning_ai_quota_tracker.py: Balance fetching, caching, and cent-scale conversion for UsageManager integration Archived to _retired/ (historical reference only): - Cursor provider + quota tracker (sidecar architecture) - Gemini A2A provider + client/session/sidecar/translator - Bedrock provider stub - Gemini file logger (superseded by transaction_logger)
1 parent f7d7413 commit a6783e0

3 files changed

Lines changed: 48 additions & 0 deletions

File tree

.env.example

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,27 @@
498498
#KILO_SESSION_TOKEN=""
499499
#KILO_QUOTA_REFRESH_INTERVAL=600
500500

501+
# --- Lightning AI ---
502+
# Lightning AI uses an OpenAI-compatible API with dollar-based monthly credits.
503+
# API keys are UUIDs obtained from https://lightning.ai (Settings → API Keys).
504+
#
505+
# Key format: bare UUID (e.g. "a1b2c3d4-e5f6-7890-abcd-ef1234567890")
506+
# Optional billing routing suffix: "UUID/ORG_NAME/TEAMSPACE_NAME"
507+
# - Bare keys charge against org-level credits (credits must be allocated at org level)
508+
# - Keys with suffix route billing to that org/teamspace
509+
#
510+
# The proxy fetches credit balance from the /v1/memberships API using the
511+
# same API key — no separate session token is needed.
512+
#LIGHTNING_AI_API_KEY_1="your-lightning-ai-uuid"
513+
#LIGHTNING_AI_API_BASE="https://lightning.ai/api/v1"
514+
#
515+
# Monthly credit grant in whole dollars (used for quota bar display).
516+
# Plans: free=$15 (default), pro=$20, teams=$50
517+
#LIGHTNING_AI_MONTHLY_GRANT=15
518+
#
519+
# How often to refresh the credit balance in seconds (default: 300)
520+
#LIGHTNING_AI_QUOTA_REFRESH_INTERVAL=300
521+
501522
# ------------------------------------------------------------------------------
502523
# | [ADVANCED] Debugging / Logging |
503524
# ------------------------------------------------------------------------------

.fork/features/lightning-ai.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,23 @@ Notes:
3434
compatibility. The TUI detects the `credits($)` group suffix and formats as dollars.
3535
- Retired providers are archived with retirement headers and documented in _retired/README.md.
3636
- All archived code was recovered before `git gc` could prune the dangling objects.
37+
38+
## 2026-06-23 — Add Lightning AI documentation to .env.example and README.md
39+
40+
Target: `feat(lightning-ai): dollar credit quotas and date parsing`
41+
Files:
42+
- `.env.example` (added Lightning AI section with env var reference)
43+
- `README.md` (added provider to Additional Providers table and quick-start env block)
44+
45+
Verification:
46+
- llm-proxy-dev stack confirmed Lightning AI active with 48 models discovered
47+
- Health endpoint shows `lightning_ai` in active providers list
48+
- Provider routes requests to `https://lightning.ai/api/v1/chat/completions` and `/responses`
49+
50+
Notes:
51+
- Resolves GitHub issue #70 (documentation gap for Lightning AI provider)
52+
- Documents: `LIGHTNING_AI_API_KEY_1` (UUID format), `LIGHTNING_AI_API_BASE`,
53+
`LIGHTNING_AI_MONTHLY_GRANT` (plan tiers: free=$15, pro=$20, teams=$50),
54+
`LIGHTNING_AI_QUOTA_REFRESH_INTERVAL` (default 300s)
55+
- Documents billing routing suffix (`UUID/ORG_NAME/TEAMSPACE_NAME`)
56+
- Notes that quota uses the API key directly (no separate session token like KiloCode)

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ A personal fork of [Mirrowel/LLM-API-Key-Proxy](https://github.com/Mirrowel/LLM-
2828
| **Command Code** | Bypasses standard subscription tier limits on chat completions by routing to the CLI endpoint (`/alpha/generate`). Supports dollar credits tracking mapped to cents baseline, 5-minute background refresh, and reasoning/thinking stream translation for `deepseek-v4-pro` and `mimo-v2.5-pro` |
2929
| **Umans** | OpenAI-compatible aggregation provider with static model definitions via `UMANS_MODELS`, request-based quota tracking (code_pro: 200 req/5h, max: unlimited), upstream-authoritative context windows, and cost tracking via sub-provider alias resolution |
3030
| **xAI Grok** | OAuth2 PKCE + Device Code flow for SuperGrok/X Premium+ accounts. Dual-endpoint model discovery from `api.x.ai` and `cli-chat-proxy.grok.com`, automatic token refresh, and CLI proxy context window metadata injection |
31+
| **Lightning AI** | OpenAI-compatible API with dollar-based monthly credit quota tracking via `/v1/memberships`. Dynamic model discovery, balance tracked in cents for integer quota precision. Plans: free ($15/mo), pro ($20/mo), teams ($50/mo) |
3132

3233
### Smart "Latest" Model Aliases
3334

@@ -639,6 +640,12 @@ COMMAND_API_KEY_1=user_... # Long-lived API key from CLI authentication
639640
KILO_SESSION_TOKEN=... # Auto-refreshes on use, ~30-day TTL
640641
KILO_QUOTA_REFRESH_INTERVAL=600 # optional, default 600s
641642

643+
# Lightning AI (dollar credit quota — balance fetched via API key, no separate token)
644+
# Key format: bare UUID or UUID/ORG_NAME/TEAMSPACE_NAME for billing routing
645+
LIGHTNING_AI_API_KEY_1=a1b2c3d4-e5f6-7890-abcd-ef1234567890
646+
LIGHTNING_AI_MONTHLY_GRANT=15 # optional, whole dollars: free=15, pro=20, teams=50
647+
LIGHTNING_AI_QUOTA_REFRESH_INTERVAL=300 # optional, default 300s
648+
642649
# Umans (OpenAI-compatible aggregation provider)
643650
UMANS_API_KEY_1=your-umans-api-key
644651
UMANS_API_BASE=https://api.code.umans.ai # optional, this is the default

0 commit comments

Comments
 (0)