Skip to content

Commit 4807b62

Browse files
correct response url for groq
1 parent b8835c4 commit 4807b62

5 files changed

Lines changed: 34 additions & 16 deletions

File tree

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,16 @@ Go to your repository:
3333
- **Settings****Secrets and variables****Actions**
3434
- Add a provider-specific secret, e.g. `GROQ_API_KEY`
3535

36-
### 3. Optional base URL for Groq
36+
### 3. Optional base URL for Groq OpenAI-compatible API
3737

38-
If you are using Groq OpenAI-compatible models, set `llm_provider_url` to the Groq OpenAI endpoint:
38+
If you are using Groq's OpenAI-compatible models, set `llm_provider_url` to:
3939

4040
```yaml
4141
llm_provider_url: https://api.groq.com/openai/v1
4242
```
4343
44+
This will route requests to `https://api.groq.com/openai/v1/chat/completions` for chat-based model inference.
45+
4446
### 4. Use the Action
4547

4648
Create `.github/workflows/ai-review.yml`:
@@ -103,7 +105,7 @@ with:
103105
debug: "false" # Verbose logging
104106
```
105107

106-
Use stable provider-specific model IDs. For Gemini, use `v1beta` model codes. For Groq, use free-tier model IDs such as `groq-1.5-mini` or `groq-1.5-small`.
108+
Use stable provider-specific model IDs. For Gemini, use `v1beta` model codes. For Groq, use models like `llama-3.1-8b-instant`, `openai/gpt-oss-20b`, or `llama-3.3-70b-versatile` (check [Groq console](https://console.groq.com/keys) for available models).
107109

108110
### Groq Example
109111

@@ -315,7 +317,7 @@ The free tier has limits:
315317
If you hit quota errors:
316318

317319
1. **Upgrade to paid plan** — Recommended for production
318-
2. **Use lighter models**`gemini-2.5-flash-lite` or `groq-1.5-mini` use fewer tokens
320+
2. **Use lighter models**`gemini-2.5-flash-lite` or Groq's smaller models like `llama-3.1-8b-instant` use fewer tokens
319321
3. **Reduce reviewer count** — Use 2 instead of 3 reviewers
320322
4. **Schedule reviews** — Spread runs across off-peak hours
321323

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ inputs:
1515
description: "API key for the chosen LLM provider. Use a provider-specific API key such as GROQ_API_KEY for groq."
1616
required: false
1717
llm_provider_url:
18-
description: "Optional base URL for the chosen LLM provider. For Groq, use https://api.groq.com/openai/v1 if needed."
18+
description: "Optional base URL for the chosen LLM provider. For Groq, use https://api.groq.com/openai/v1 (uses /chat/completions endpoint)."
1919
required: false
2020
reviewer_models:
2121
description: "Comma-separated list of 3 review models. Use provider-specific model IDs such as llama-3.1-8b-instant or openai/gpt-oss-20b."

dist/index.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -947,8 +947,12 @@ const FALLBACK_MODELS = {
947947
],
948948
},
949949
groq: {
950-
reviewer: ["groq-1.5-mini", "groq-1.5-small"],
951-
judge: ["groq-1.5-small", "groq-1.5-mini"],
950+
reviewer: [
951+
"llama-3.1-8b-instant",
952+
"openai/gpt-oss-20b",
953+
"llama-3.3-70b-versatile",
954+
],
955+
judge: ["openai/gpt-oss-120b", "llama-3.3-70b-versatile"],
952956
},
953957
};
954958
class LLMClient {
@@ -1247,16 +1251,20 @@ RESPOND ONLY WITH THE JSON OBJECT. NO OTHER TEXT.`;
12471251
const useOpenAICompat = trimmedBase.includes("/openai/v1");
12481252
const openAIBase = trimmedBase.replace(/\/models$/, "");
12491253
const url = useOpenAICompat
1250-
? `${openAIBase}/completions`
1254+
? `${openAIBase}/chat/completions`
12511255
: `${trimmedBase}/${model}/generate`;
12521256
const body = useOpenAICompat
12531257
? {
12541258
model,
1255-
prompt,
1259+
messages: [
1260+
{
1261+
role: "user",
1262+
content: prompt,
1263+
},
1264+
],
12561265
temperature: 0.7,
12571266
top_p: 0.95,
12581267
max_tokens: 2048,
1259-
top_k: 40,
12601268
}
12611269
: {
12621270
input: prompt,

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/llm/llm-client.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,12 @@ const FALLBACK_MODELS: Record<
126126
],
127127
},
128128
groq: {
129-
reviewer: ["groq-1.5-mini", "groq-1.5-small"],
130-
judge: ["groq-1.5-small", "groq-1.5-mini"],
129+
reviewer: [
130+
"llama-3.1-8b-instant",
131+
"openai/gpt-oss-20b",
132+
"llama-3.3-70b-versatile",
133+
],
134+
judge: ["openai/gpt-oss-120b", "llama-3.3-70b-versatile"],
131135
},
132136
};
133137

@@ -531,17 +535,21 @@ RESPOND ONLY WITH THE JSON OBJECT. NO OTHER TEXT.`;
531535
const useOpenAICompat = trimmedBase.includes("/openai/v1");
532536
const openAIBase = trimmedBase.replace(/\/models$/, "");
533537
const url = useOpenAICompat
534-
? `${openAIBase}/completions`
538+
? `${openAIBase}/chat/completions`
535539
: `${trimmedBase}/${model}/generate`;
536540

537541
const body = useOpenAICompat
538542
? {
539543
model,
540-
prompt,
544+
messages: [
545+
{
546+
role: "user",
547+
content: prompt,
548+
},
549+
],
541550
temperature: 0.7,
542551
top_p: 0.95,
543552
max_tokens: 2048,
544-
top_k: 40,
545553
}
546554
: {
547555
input: prompt,

0 commit comments

Comments
 (0)