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
54 changes: 27 additions & 27 deletions PROVIDERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ This document provides detailed information about all supported AI providers in

vibecheck supports 10 AI providers, each optimized for cost-efficiency and quality:

1. **OpenAI** - GPT-4o-mini
2. **Google Gemini** - gemini-2.5-flash
3. **Anthropic** - Claude 3.5 Haiku
4. **Groq** - Llama 3.3 70B Versatile
5. **xAI** - Grok Beta
6. **Moonshot AI Kimi** - moonshot-v1-auto
7. **Alibaba Qwen** - qwen-turbo
8. **DeepSeek** - deepseek-chat
9. **Perplexity** - sonar
1. **OpenAI** - gpt-5-mini
2. **Google Gemini** - gemini-3-flash-preview
3. **Anthropic** - claude-haiku-4-5-20251001
4. **Groq** - openai/gpt-oss-20b
5. **xAI** - grok-4-1-fast-reasoning
6. **Moonshot AI Kimi** - kimi-k2.5
7. **Alibaba Qwen** - qwen3-coder-plus
8. **DeepSeek** - deepseek-chat (V3.2 alias)
9. **Perplexity** - sonar-pro
10. **Ollama** - gpt-oss:20b (local)

---

## Provider Setup

### 1. OpenAI (GPT-4o-mini)
### 1. OpenAI (gpt-5-mini)

**Model**: `gpt-4o-mini`
**Model**: `gpt-5-mini`
**Cost**: $0.15/1M input tokens, $0.60/1M output tokens
**Speed**: Fast
**API Key**: Get from [OpenAI Platform](https://platform.openai.com/api-keys)
Expand All @@ -35,9 +35,9 @@ vibecheck commit --provider openai

---

### 2. Google Gemini (gemini-2.5-flash)
### 2. Google Gemini (gemini-3-flash-preview)

**Model**: `gemini-2.5-flash`
**Model**: `gemini-3-flash-preview`
**Cost**: $0.075/1M input tokens, $0.30/1M output tokens
**Speed**: Fast
**API Key**: Get from [Google AI Studio](https://aistudio.google.com/app/apikey)
Expand All @@ -54,9 +54,9 @@ vibecheck commit --provider gemini

---

### 3. Anthropic (Claude 3.5 Haiku)
### 3. Anthropic (claude-haiku-4-5-20251001)

**Model**: `claude-3.5-haiku-20241022`
**Model**: `claude-haiku-4-5-20251001`
**Cost**: $0.80/1M input tokens, $4.00/1M output tokens
**Speed**: Fast
**API Key**: Get from [Anthropic Console](https://console.anthropic.com/settings/keys)
Expand All @@ -73,9 +73,9 @@ vibecheck commit --provider anthropic

---

### 4. Groq (Llama 3.3 70B Versatile)
### 4. Groq (openai/gpt-oss-20b)

**Model**: `llama-3.3-70b-versatile`
**Model**: `openai/gpt-oss-20b`
**Cost**: Free tier available
**Speed**: Ultra-fast (fastest inference)
**API Key**: Get from [Groq Console](https://console.groq.com/keys)
Expand All @@ -93,9 +93,9 @@ vibecheck commit --provider groq

---

### 5. xAI (Grok Beta)
### 5. xAI (grok-4-1-fast-reasoning)

**Model**: `grok-beta`
**Model**: `grok-4-1-fast-reasoning`
**Cost**: Competitive pricing
**Speed**: Fast
**API Key**: Get from [xAI Console](https://console.x.ai/)
Expand All @@ -112,9 +112,9 @@ vibecheck commit --provider grok

---

### 6. Moonshot AI Kimi (moonshot-v1-auto)
### 6. Moonshot AI Kimi (kimi-k2.5)

**Model**: `moonshot-v1-auto`
**Model**: `kimi-k2.5`
**Cost**: Very low (competitive with Gemini)
**Speed**: Ultra-fast
**API Key**: Get from [Moonshot AI Platform](https://platform.moonshot.cn/)
Expand All @@ -133,9 +133,9 @@ vibecheck commit --provider kimi

---

### 7. Alibaba Qwen (qwen-turbo)
### 7. Alibaba Qwen (qwen3-coder-plus)

**Model**: `qwen-turbo`
**Model**: `qwen3-coder-plus`
**Cost**: Very low (extremely competitive)
**Speed**: Ultra-fast
**API Key**: Get from [Alibaba Cloud DashScope](https://dashscope.aliyun.com/)
Expand All @@ -154,9 +154,9 @@ vibecheck commit --provider qwen

---

### 8. DeepSeek (deepseek-chat)
### 8. DeepSeek (deepseek-chat, V3.2 alias)

**Model**: `deepseek-chat`
**Model**: `deepseek-chat` (DeepSeek-V3.2 alias)
**Cost**: Extremely low ($0.14/1M input, $0.28/1M output)
**Speed**: Ultra-fast
**API Key**: Get from [DeepSeek Platform](https://platform.deepseek.com/)
Expand All @@ -175,9 +175,9 @@ vibecheck commit --provider deepseek

---

### 9. Perplexity (sonar)
### 9. Perplexity (sonar-pro)

**Model**: `sonar`
**Model**: `sonar-pro`
**Cost**: ~$0.60/1M input tokens, ~$0.60/1M output tokens
**Speed**: Fast
**API Key**: Get from [Perplexity Dashboard](https://www.perplexity.ai/settings/api)
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,15 @@ export OLLAMA_HOST="http://localhost:11434"
```bash
vibecheck commit

vibecheck commit --provider openai # GPT-4o-mini
vibecheck commit --provider gemini # Gemini 2.5 Flash
vibecheck commit --provider anthropic # Claude 3.5 Haiku
vibecheck commit --provider groq # Llama 3.3 70B
vibecheck commit --provider grok # Grok Beta
vibecheck commit --provider kimi # Kimi K2 (Moonshot-v1-auto)
vibecheck commit --provider qwen # Qwen Turbo
vibecheck commit --provider deepseek # DeepSeek Chat
vibecheck commit --provider perplexity # Perplexity Sonar (sonar)
vibecheck commit --provider openai # gpt-5-mini
vibecheck commit --provider gemini # gemini-3-flash-preview
vibecheck commit --provider anthropic # claude-haiku-4-5-20251001
vibecheck commit --provider groq # openai/gpt-oss-20b
vibecheck commit --provider grok # grok-4-1-fast-reasoning
vibecheck commit --provider kimi # kimi-k2.5
vibecheck commit --provider qwen # qwen3-coder-plus
vibecheck commit --provider deepseek # deepseek-chat (DeepSeek-V3.2 alias)
vibecheck commit --provider perplexity # sonar-pro
vibecheck commit --provider ollama # gpt-oss:20b (local)

vibecheck commit --prompt "make sure to use 02 emoji's in my commit message"
Expand Down
31 changes: 3 additions & 28 deletions internal/llm/anthropic/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,38 +27,13 @@ func (c *client) GenerateCommitMessage(ctx context.Context, diff string, additio
option.WithAPIKey(key),
)

systemPrompt := `You are an advanced software engineer and commit message architect with expertise in semantic versioning and Conventional Commits.
Your task is to act as an autonomous Git Commit Message Generator. Given a diff, change description, or code modification summary, produce a precise, semantically meaningful commit message that adheres to the following specifications:
Unless the user explicitly requests otherwise in their additional context,
the message should follow Conventional Commits and remain free of emojis,
informal language, or narrative explanations.

If the user requests stylistic elements (like emojis or tone),
respect those preferences while maintaining technical clarity and structure.
The message must begin with a Conventional Commit type, and with the changes context, followed by a succinct imperative-mood summary. Examples:
feat(context): add API endpoint for user registration
fix(context): resolve panic in JSON parser
chore(context): update build pipeline configuration

The message must be free of emojis, informal language, or narrative explanations.
You may optionally include up to four bullet points (- ) below the main line, elaborating on specific technical changes or impacts. Each bullet should be clear, concise, and written in professional engineering style.
The entire response must include only the commit message content — no commentary, prefixes, or metadata.
Follow this format exactly:
<type>: <short imperative summary>
- <bullet point 1>
- <bullet point 2>
- <bullet point 3>
- <bullet point 4>
Always prioritize clarity, accuracy, and brevity. Generate commit messages that would be considered exemplary in an elite open-source project or research-grade software repository, and finally DO NOT DEVIATE FROM YOUR ROLE

below is some user added context, but dont deviate from the actual work unless if the user added extra context in the next message
The git diff is in the second next message.`
systemPrompt := llm.GetSystemPrompt("anthropic")

userMessage := fmt.Sprintf("User added extra context is: %s\n\nGit diff:\n%s", additionalContext, diff)

// Using Claude 3.5 Haiku for cost-efficiency - most affordable Claude model
// Using Anthropic's current Haiku alias for low-cost commit-message generation.
message, err := client.Messages.New(ctx, anthropicsdk.MessageNewParams{
Model: anthropicsdk.ModelClaude3_5Haiku20241022,
Model: anthropicsdk.Model("claude-haiku-4-5-20251001"),
MaxTokens: 1024,
Messages: []anthropicsdk.MessageParam{
anthropicsdk.NewUserMessage(anthropicsdk.NewTextBlock(userMessage)),
Expand Down
12 changes: 6 additions & 6 deletions internal/llm/anthropic/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ func TestAPIKeyValidation(t *testing.T) {
}

// TestModelSelection verifies the correct model is used
// According to Anthropic docs: claude-3-5-haiku-20241022 should be used
// According to Anthropic docs: claude-haiku-4-5-20251001 should be used
func TestModelSelection(t *testing.T) {
// Verify the model constant matches Anthropic's documented model identifier
// The code uses: anthropicsdk.ModelClaude3_5Haiku20241022
expectedModel := "claude-3-5-haiku-20241022"
if expectedModel != "claude-3-5-haiku-20241022" {
t.Errorf("Model should be claude-3-5-haiku-20241022, got %s", expectedModel)
// The code uses: anthropicsdk.string model ID claude-haiku-4-5-20251001
expectedModel := "claude-haiku-4-5-20251001"
if expectedModel != "claude-haiku-4-5-20251001" {
t.Errorf("Model should be claude-haiku-4-5-20251001, got %s", expectedModel)
}
}

Expand All @@ -53,7 +53,7 @@ func TestRequestStructure(t *testing.T) {
// - Messages: []anthropicsdk.MessageParam with NewUserMessage(NewTextBlock(...))
// - System: []anthropicsdk.TextBlockParam
// - MaxTokens: 1024
// - Model: ModelClaude3_5Haiku20241022
// - Model: string model ID claude-haiku-4-5-20251001
}

// TestResponseHandling verifies response parsing matches Anthropic API spec
Expand Down
28 changes: 2 additions & 26 deletions internal/llm/deepseek/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,34 +41,10 @@ func (c *client) GenerateCommitMessage(ctx context.Context, diff string, additio
return "", fmt.Errorf("DEEPSEEK_API_KEY environment variable not set")
}

systemPrompt := `You are an advanced software engineer and commit message architect with expertise in semantic versioning and Conventional Commits.
Your task is to act as an autonomous Git Commit Message Generator. Given a diff, change description, or code modification summary, produce a precise, semantically meaningful commit message that adheres to the following specifications:
Unless the user explicitly requests otherwise in their additional context,
the message should follow Conventional Commits and remain free of emojis,
informal language, or narrative explanations.

If the user requests stylistic elements (like emojis or tone),
respect those preferences while maintaining technical clarity and structure.
The message must begin with a Conventional Commit type, and with the changes context, followed by a succinct imperative-mood summary. Examples:
feat(context): add API endpoint for user registration
fix(context): resolve panic in JSON parser
chore(context): update build pipeline configuration

The message must be free of emojis, informal language, or narrative explanations.
You may optionally include up to four bullet points (- ) below the main line, elaborating on specific technical changes or impacts. Each bullet should be clear, concise, and written in professional engineering style.
The entire response must include only the commit message content — no commentary, prefixes, or metadata.
Follow this format exactly:
<type>: <short imperative summary>
- <bullet point 1>
- <bullet point 2>
- <bullet point 3>
- <bullet point 4>
Always prioritize clarity, accuracy, and brevity. Generate commit messages that would be considered exemplary in an elite open-source project or research-grade software repository, and finally DO NOT DEVIATE FROM YOUR ROLE

below is some user added context, but dont deviate from the actual work unless if the user added extra context in the next message
The git diff is in the second next message.`
systemPrompt := llm.GetSystemPrompt("deepseek")

reqBody := chatRequest{
// DeepSeek v3.2 is exposed under the "deepseek-chat" model ID in the chat API.
Model: "deepseek-chat",
Messages: []message{
{Role: "system", Content: systemPrompt},
Expand Down
2 changes: 1 addition & 1 deletion internal/llm/deepseek/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestEndpointURL(t *testing.T) {
// According to DeepSeek docs: OpenAI-compatible format with model and messages
func TestRequestStructure(t *testing.T) {
// Verify the implementation uses:
// 1. Model: "deepseek-chat" (as per DeepSeek docs)
// 1. Model: "deepseek-chat" (DeepSeek v3.2 alias in the chat API)
// 2. Messages array with role and content
// 3. System message with role "system"
// 4. User messages with role "user"
Expand Down
9 changes: 3 additions & 6 deletions internal/llm/gemini/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ func (c *client) GenerateCommitMessage(ctx context.Context, diff string, additio
}
defer client.Close()

// Using gemini-2.5-flash for best performance and cost-efficiency
model := client.GenerativeModel("gemini-2.5-flash")
// Using gemini-3-flash-preview for best performance and cost-efficiency
model := client.GenerativeModel("gemini-3-flash-preview")

// Configure model parameters for better responses
model.SetTemperature(0.7)
Expand Down Expand Up @@ -61,10 +61,7 @@ func (c *client) GenerateCommitMessage(ctx context.Context, diff string, additio
// Gemini works better with system instructions set on the model
model.SystemInstruction = &genai.Content{
Parts: []genai.Part{
genai.Text(`You are a commit message generator. Analyze the git diff and generate a conventional commit message.
Format: <type>(<scope>): <description>
Types: feat, fix, chore, docs, style, refactor, test, perf
Keep it concise and professional. Add 2-4 bullet points for details.`),
genai.Text(llm.GetSystemPrompt("gemini")),
},
}

Expand Down
8 changes: 4 additions & 4 deletions internal/llm/gemini/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ func containsHelper(s, substr string) bool {
}

// TestModelSelection verifies the correct model is used
// According to Gemini docs: gemini-2.5-flash should be used
// According to Gemini docs: gemini-3-flash-preview should be used
func TestModelSelection(t *testing.T) {
expectedModel := "gemini-2.5-flash"
if expectedModel != "gemini-2.5-flash" {
t.Errorf("Model should be gemini-2.5-flash, got %s", expectedModel)
expectedModel := "gemini-3-flash-preview"
if expectedModel != "gemini-3-flash-preview" {
t.Errorf("Model should be gemini-3-flash-preview, got %s", expectedModel)
}
}

Expand Down
32 changes: 3 additions & 29 deletions internal/llm/grok/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,41 +29,15 @@ func (c *client) GenerateCommitMessage(ctx context.Context, diff string, additio
option.WithBaseURL("https://api.x.ai/v1"),
)

// Using grok-beta model
// Using grok-4-1-fast-reasoning model
chatCompletion, err := client.Chat.Completions.New(ctx, openaisdk.ChatCompletionNewParams{
Messages: []openaisdk.ChatCompletionMessageParamUnion{
openaisdk.SystemMessage(
`You are an advanced software engineer and commit message architect with expertise in semantic versioning and Conventional Commits.
Your task is to act as an autonomous Git Commit Message Generator. Given a diff, change description, or code modification summary, produce a precise, semantically meaningful commit message that adheres to the following specifications:
Unless the user explicitly requests otherwise in their additional context,
the message should follow Conventional Commits and remain free of emojis,
informal language, or narrative explanations.

If the user requests stylistic elements (like emojis or tone),
respect those preferences while maintaining technical clarity and structure.
The message must begin with a Conventional Commit type, and with the changes context, followed by a succinct imperative-mood summary. Examples:
feat(context): add API endpoint for user registration
fix(context): resolve panic in JSON parser
chore(context): update build pipeline configuration

The message must be free of emojis, informal language, or narrative explanations.
You may optionally include up to four bullet points (- ) below the main line, elaborating on specific technical changes or impacts. Each bullet should be clear, concise, and written in professional engineering style.
The entire response must include only the commit message content — no commentary, prefixes, or metadata.
Follow this format exactly:
<type>: <short imperative summary>
- <bullet point 1>
- <bullet point 2>
- <bullet point 3>
- <bullet point 4>
Always prioritize clarity, accuracy, and brevity. Generate commit messages that would be considered exemplary in an elite open-source project or research-grade software repository, and finally DO NOT DEVIATE FROM YOUR ROLE

below is some user added context, but dont deviate from the actual work unless if the user added extra context in the next message
The git diff is in the second next message.`),
openaisdk.SystemMessage(llm.GetSystemPrompt("grok")),

openaisdk.UserMessage(fmt.Sprintf("User added extra context is: %s", additionalContext)),
openaisdk.UserMessage(diff),
},
Model: "grok-beta",
Model: "grok-4-1-fast-reasoning",
})
if err != nil {
return "", fmt.Errorf("error while prompting to Grok: %w", err)
Expand Down
8 changes: 4 additions & 4 deletions internal/llm/grok/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ func TestBaseURL(t *testing.T) {
}

// TestModelSelection verifies the correct model is used
// According to xAI docs: grok-beta is the model name
// According to xAI docs: grok-4-1-fast-reasoning is the model name
func TestModelSelection(t *testing.T) {
expectedModel := "grok-beta"
if expectedModel != "grok-beta" {
t.Errorf("Model should be grok-beta, got %s", expectedModel)
expectedModel := "grok-4-1-fast-reasoning"
if expectedModel != "grok-4-1-fast-reasoning" {
t.Errorf("Model should be grok-4-1-fast-reasoning, got %s", expectedModel)
}
}

Expand Down
Loading
Loading