feat: migrate from Anthropic to Groq (free LLM) - #1
Open
IrfanBasha-03 wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR migrates the project’s LLM integration from Anthropic Claude to Groq (via the OpenAI-compatible API), and adjusts workflow lifecycle/reconnect behavior in the CLI.
Changes:
- Replace Anthropic SDK usage with OpenAI client configured for Groq in activities.
- Update CLI workflow reconnect/start logic to only reconnect to running workflows and otherwise start fresh.
- Update tool schemas, env vars, docs, and dependencies to reflect the Groq integration.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| workflows/conversation_workflow.py | Updates tool schemas/descriptions (namespace requirements, defaults). |
| worker.py | Switch preflight key checks from Anthropic to Groq. |
| requirements.txt | Replace anthropic dependency with openai. |
| cli.py | Change workflow reconnection logic and workflow start conflict behavior. |
| activities/llm_activities.py | Switch diagnosis activity from Anthropic Messages API to Groq via OpenAI client. |
| activities/chat_activities.py | Add converters and implement Groq/OpenAI-compatible chat + tool calling while preserving existing response shape. |
| README.md | Update badges, quick start, and architecture text to Groq. |
| .gitignore | Ignore additional local artifacts. |
| .env.example | Rename API key env var to GROQ_API_KEY. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| "name": "list_pods", | ||
| "description": "List all pods in a namespace with status, readiness, and restart count.", | ||
| "description": "List all pods in a namespace with status, readiness, and restart count. If no namespace is provided, uses 'default'.", |
Comment on lines
+28
to
+30
| "namespace": {"type": "string", "description": "Kubernetes namespace (e.g. 'default')"}, | ||
| }, | ||
| "required": ["namespace"], |
| { | ||
| "name": "get_pod_logs", | ||
| "description": "Get recent log output from a pod.", | ||
| "description": "Get recent log output from a pod. Returns the last 50 lines by default.", |
Comment on lines
+52
to
+55
| "namespace": {"type": "string", "description": "Kubernetes namespace (e.g. 'default')"}, | ||
| "tail_lines": {"type": "integer", "description": "Number of recent lines to return"}, | ||
| }, | ||
| "required": ["pod_name"], | ||
| "required": ["pod_name", "namespace"], |
Comment on lines
+50
to
+56
| handle = await client.start_workflow( | ||
| ConversationWorkflow.run, | ||
| ConversationInput(namespace=namespace, session_id=WORKFLOW_ID), | ||
| id=WORKFLOW_ID, | ||
| task_queue="kubehealer", | ||
| id_conflict_policy=WorkflowIDConflictPolicy.TERMINATE_EXISTING, | ||
| ) |
Comment on lines
162
to
+165
| @activity.defn | ||
| async def call_claude(request: ClaudeRequest) -> ClaudeResponse: | ||
| """Call the Anthropic Messages API. Returns serializable response.""" | ||
| activity.logger.info(f"Calling Claude ({len(request.messages)} messages, {len(request.tools)} tools)") | ||
| """Call the Groq API (OpenAI-compatible). Returns serializable response.""" | ||
| activity.logger.info(f"Calling Groq ({len(request.messages)} messages, {len(request.tools)} tools)") |
Comment on lines
+80
to
+82
| | ├─ activity: call_groq | ||
| | ├─ activity: list_pods (tool call) | ||
| | ├─ activity: call_claude (with tool result) | ||
| | ├─ activity: call_groq (with tool result) |
| | | | ||
| |-- update(send_message, "heal it") ---->| | ||
| | ├─ activity: call_claude → tool: start_healing | ||
| | ├─ activity: call_groq → tool: start_healing |
| | ├─ activity: get_pod_details (x3) | ||
| | ├─ activity: diagnose_pod (x3) | ||
| | ├─ activity: call_claude → "Found 3 issues..." | ||
| | ├─ activity: call_groq → "Found 3 issues..." |
Comment on lines
+37
to
+42
| def _get_groq_client() -> OpenAI: | ||
| """Create an OpenAI client pointed at Groq's API.""" | ||
| return OpenAI( | ||
| api_key=os.environ.get("GROQ_API_KEY"), | ||
| base_url="https://api.groq.com/openai/v1", | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.