Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,24 +201,24 @@ Configure your preferred AI provider:

```bash
# Using CLI arguments
lumen -p openai -k "your-api-key" -m "gpt-5-mini" draft
lumen -p openai -k "your-api-key" -m "gpt-4o-mini" draft

# Using environment variables
export LUMEN_AI_PROVIDER="openai"
export LUMEN_API_KEY="your-api-key"
export LUMEN_AI_MODEL="gpt-5-mini"
export LUMEN_AI_MODEL="gpt-4o-mini"
```

### Supported Providers

| Provider | API Key Required | Models |
|----------|-----------------|---------|
| [OpenAI](https://platform.openai.com/docs/models) `openai` (Default) | Yes | `gpt-5.2`, `gpt-5`, `gpt-5-mini`, `gpt-5-nano`, `gpt-4.1`, `gpt-4.1-mini`, `o4-mini` (default: `gpt-5-mini`) |
| [Claude](https://www.anthropic.com/pricing) `claude` | Yes | `claude-sonnet-4-5-20250930`, `claude-opus-4-5-20251115`, `claude-haiku-4-5-20251015` (default: `claude-sonnet-4-5-20250930`) |
| [Gemini](https://ai.google.dev/) `gemini` | Yes (free tier) | `gemini-3-pro`, `gemini-3-flash`, `gemini-2.5-pro`, `gemini-2.5-flash`, `gemini-2.5-flash-lite` (default: `gemini-3-flash`) |
| [Groq](https://console.groq.com/docs/models) `groq` | Yes (free) | `llama-3.3-70b-versatile`, `llama-3.1-8b-instant`, `meta-llama/llama-4-maverick-17b-128e-instruct`, `openai/gpt-oss-120b` (default: `llama-3.3-70b-versatile`) |
| [DeepSeek](https://www.deepseek.com/) `deepseek` | Yes | `deepseek-chat` (V3.2), `deepseek-reasoner` (default: `deepseek-chat`) |
| [xAI](https://x.ai/) `xai` | Yes | `grok-4`, `grok-4-mini`, `grok-4-mini-fast` (default: `grok-4-mini-fast`) |
| [OpenAI](https://platform.openai.com/docs/models) `openai` (Default) | Yes | `gpt-4o`, `gpt-4o-mini`, `gpt-4-turbo`, `gpt-3.5-turbo` (default: `gpt-4o-mini`) |
| [Claude](https://www.anthropic.com/pricing) `claude` | Yes | `claude-sonnet-4-5-20250929`, `claude-opus-4-5-20251101`, `claude-haiku-4-5-20251001` (default: `claude-sonnet-4-5-20250929`) |
| [Gemini](https://ai.google.dev/) `gemini` | Yes (free tier) | `gemini-1.5-pro`, `gemini-1.5-flash`, `gemini-1.0-pro` (default: `gemini-1.5-flash`) |
| [Groq](https://console.groq.com/docs/models) `groq` | Yes (free) | `llama-3.3-70b-versatile`, `llama-3.1-8b-instant`, `mixtral-8x7b-32768` (default: `llama-3.3-70b-versatile`) |
| [DeepSeek](https://www.deepseek.com/) `deepseek` | Yes | `deepseek-chat`, `deepseek-reasoner` (default: `deepseek-chat`) |
| [xAI](https://x.ai/) `xai` | Yes | `grok-beta`, `grok-2` (default: `grok-beta`) |
| [Ollama](https://github.com/ollama/ollama) `ollama` | No (local) | [see list](https://ollama.com/library) (default: `llama3.2`) |
| [OpenRouter](https://openrouter.ai/) `openrouter` | Yes | [see list](https://openrouter.ai/models) (default: `anthropic/claude-sonnet-4.5`) |
| [Vercel AI Gateway](https://vercel.com/docs/ai-gateway) `vercel` | Yes | [see list](https://vercel.com/docs/ai-gateway/supported-models) (default: `anthropic/claude-sonnet-4.5`) |
Expand All @@ -244,7 +244,7 @@ Lumen will load configurations in the following order of priority:
```json
{
"provider": "openai",
"model": "gpt-5-mini",
"model": "gpt-4o-mini",
"api_key": "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"draft": {
"commit_types": {
Expand Down Expand Up @@ -275,7 +275,7 @@ Example: Using different providers for different projects:
```bash
# Set global defaults in .zshrc/.bashrc
export LUMEN_AI_PROVIDER="openai"
export LUMEN_AI_MODEL="gpt-5-mini"
export LUMEN_AI_MODEL="gpt-4o-mini"
export LUMEN_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxx"

# Override per project using config file
Expand Down
11 changes: 6 additions & 5 deletions src/provider/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,17 @@ impl LumenProvider {
// Native genai providers
_ => {
let (default_model, name, env_key) = match provider_type {
ProviderType::Openai => ("gpt-5-mini", "OpenAI", "OPENAI_API_KEY"),
ProviderType::Openai => ("gpt-4o-mini", "OpenAI", "OPENAI_API_KEY"),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

OpenAI gpt-4o-mini model current API

💡 Result:

Here’s the current OpenAI API summary for the GPT-4o‑mini model (official docs/news):

  • Model summary: fast, cost‑efficient small multimodal model (text + vision), optimized for focused tasks and fine‑tuning; 128k token context window; up to 16k output tokens per request. [1][2]
  • Where to call: supported on Responses (v1/responses), Chat Completions (v1/chat/completions), Realtime, Assistants, Batch, and Fine-tuning endpoints. [1][4]
  • Pricing (text tokens): input $0.15 / 1M tokens, output $0.60 / 1M tokens (per OpenAI announcement). [2][5]
  • Features: streaming, function calling, structured outputs, fine‑tuning supported; snapshots available to pin versions. [1][5]
  • Variants: also available as a TTS-specialized model (gpt-4o-mini-tts) with its own snapshots and rate limits. [4]
  • Notes/updates: OpenAI has since released GPT‑4.1 series (incl. GPT‑4.1 mini) which supersedes GPT‑4o‑mini in some product flows; check model picker/docs if you need the latest recommended small model. [3][2]

Sources:
[1] OpenAI Platform — GPT-4o mini docs.
[2] OpenAI blog announcement — “GPT‑4o mini” (July 18, 2024).
[3] OpenAI release notes / Help Center (model updates; GPT‑4.1 mini replacement notice).
[4] OpenAI Platform — GPT‑4o mini TTS docs.
[5] OpenAI Platform — GPT-4o model pricing & features.

Would you like example API calls (Requests/JSON) for v1/responses or v1/chat/completions using gpt-4o-mini?


🌐 Web query:

Anthropic Claude claude-sonnet-4-5-20250929 model API

💡 Result:

Summary — what it is

  • "claude-sonnet-4-5-20250929" is Anthropic’s Claude Sonnet 4.5 model release (versioned 2025‑09‑29), available via the Anthropic/Claude API and through partners (Amazon Bedrock, Google Vertex AI). [1][2][3][4]

Quick usage example (Anthropic / Claude API)

  • Model identifier: "claude-sonnet-4-5-20250929".
  • Minimal cURL POST to /v1/messages:
    curl https://api.anthropic.com/v1/messages
    -H "Content-Type: application/json"
    -H "x-api-key: $ANTHROPIC_API_KEY"
    -H "anthropic-version: 2023-06-01"
    -d '{
    "model":"claude-sonnet-4-5-20250929",
    "max_tokens":1024,
    "messages":[{"role":"user","content":"Hello, Claude"}]
    }'
    The /v1/messages docs show this request/response format. [5]

Partner endpoints / alternate names

  • Amazon Bedrock example ID: anthropic.claude-sonnet-4-5-20250929-v1:0.
  • Google Vertex AI example ID: claude-sonnet-4-5@20250929. [3][4]

Notes

  • Check Anthropic/Claude docs for exact API headers, rate limits, and any model-specific migration notes (Sonnet 4.5 migration guide / release notes). [1][3]

Sources
[1] Anthropic model docs (Get a Model).
[2] Anthropic product page (Claude Sonnet 4.5).
[3] Claude docs — "What's new" / availability (lists claude-sonnet-4-5-20250929).
[4] Google Cloud Vertex AI — Claude Sonnet 4.5 partner model page.
[5] Claude API / Messages endpoint example.


🌐 Web query:

Google Gemini gemini-1.5-flash model API

💡 Result:

Summary — gemini-1.5-flash (Google Gemini)

  • Model ID: gemini-1.5-flash. It’s a multimodal text-generation model (text outputs; accepts text, code, images, audio, video, PDFs). [1]
  • Token / context limits: up to 1,048,576 input tokens; default max output ~8,192 tokens. [1]
  • Lifecycle / status: documented as a legacy/deprecated model (Google recommends using Gemini 2.0 Flash or newer) and specific model versions (e.g., gemini-1.5-flash-002) have deprecation/discontinuation dates. Check the model page for exact dates for any version you plan to use. [1]
  • Where to call it:
    • Vertex AI / Google Cloud (Model Garden / Generative AI on Vertex AI). Use Vertex AI REST/SDKs or gcloud for deployment and inference. [1][3]
    • Google announced Gemini access via the OpenAI-compatible Library / REST surface — you can call model="gemini-1.5-flash" through that API (example snippet in the Google developers post). Confirm which endpoint and credentials you must use for your project. [2]
  • Features: multimodal inputs, grounding with Google Search (for supported models/features), tuning (fine-tuning) options were available for 1.5 Flash versions when supported. [1][3]

If you want a short example (OpenAI-compatible) or Vertex AI code snippet for calling gemini-1.5-flash, tell me which environment you’ll use (Vertex AI Python SDK, REST/gcloud, or OpenAI-compatible client) and I’ll paste the minimal working example with the correct endpoint and parameters plus notes about authentication and region.

Sources: Google Cloud model page and release notes; Google Developers post about OpenAI Library access. [1][3][2]


🌐 Web query:

xAI Grok grok-beta model API

💡 Result:

Short summary — xAI "grok-beta" model API

  • Endpoint/base URL: HTTPS REST API at https://api.x.ai/v1. Use your xAI API key from console.x.ai. [1][3]
  • Model name to request: "grok-beta" (early preview model). [1][2]
  • Key capabilities: text-only grok-beta supports system prompts and function-calling; xAI announced a multimodal/vision variant (grok-vision-beta) coming. Context window ~128,000 tokens (announced for grok-beta). [1][2]
  • Compatibility: REST interface designed to be compatible with OpenAI-style SDKs (you can often switch base_url + key). Example: change OpenAI Python SDK base_url to https://api.x.ai/v1. [1]
  • Status/pricing: grok-beta was a public‑beta/early model (xAI later released newer grok-2 family and other models); pricing slabs and newer recommended models (grok-2 series, grok-4, etc.) are listed on xAI’s API/docs pages. Check docs.x.ai or console.x.ai for current availability, deprecation, and exact pricing. [2][3]

If you want, I can:

  • show a minimal curl or Python example calling "grok-beta", or
  • look up the current status/pricing for grok-beta right now. Which would you like?

Consider using more current model versions for Gemini and xAI.

The model names are valid and callable, but note:

  • Google Gemini: gemini-1.5-flash is documented as legacy/deprecated; Google recommends using Gemini 2.0 Flash or newer.
  • xAI: grok-beta is a public-beta early model; xAI has since released newer versions (grok-2 and later). Check docs.x.ai for current recommended models and pricing.
  • OpenAI gpt-4o-mini and Anthropic claude-sonnet-4-5-20250929 are current and supported.

Also applies to: 115-115, 122-123

🤖 Prompt for AI Agents
In src/provider/mod.rs around lines 113, 115 and 122-123, the hardcoded model
identifiers for Google Gemini and xAI are set to legacy/beta names; update those
entries to use the current recommended model versions (e.g., Gemini 2.0 Flash or
the latest Gemini release and xAI grok-2 or the current stable grok model) by
replacing the deprecated model strings with the up-to-date names from the
providers' docs, and ensure any related provider display name or env key remains
correct; verify compilation and update tests or comments to reference the
provider docs/versions used.

ProviderType::Claude => (
"claude-sonnet-4-5-20250930",
"claude-sonnet-4-5-20250929",
"Claude",
"ANTHROPIC_API_KEY",
),
ProviderType::Groq => ("llama-3.3-70b-versatile", "Groq", "GROQ_API_KEY"),
ProviderType::Ollama => ("llama3.2", "Ollama", ""),
ProviderType::Deepseek => ("deepseek-chat", "DeepSeek", "DEEPSEEK_API_KEY"),
ProviderType::Gemini => ("gemini-3-flash", "Gemini", "GEMINI_API_KEY"),
ProviderType::Xai => ("grok-4-mini-fast", "xAI", "XAI_API_KEY"),
ProviderType::Gemini => ("gemini-1.5-flash", "Gemini", "GEMINI_API_KEY"),
ProviderType::Xai => ("grok-beta", "xAI", "XAI_API_KEY"),
ProviderType::Openrouter | ProviderType::Vercel => {
unreachable!()
}
Expand All @@ -129,8 +129,9 @@ impl LumenProvider {
let model = model.unwrap_or_else(|| default_model.to_string());

// If api_key provided via CLI/config, set it in env so genai picks it up
// But only if the env var isn't already set (allow per-provider env vars to take precedence)
if let Some(key) = api_key {
if !env_key.is_empty() {
if !env_key.is_empty() && std::env::var(env_key).is_err() {
std::env::set_var(env_key, key);
}
}
Expand Down