Skip to content

feat: migrate from Anthropic to Groq (free LLM) - #1

Open
IrfanBasha-03 wants to merge 1 commit into
TrainWithShubham:mainfrom
IrfanBasha-03:groq-migration
Open

feat: migrate from Anthropic to Groq (free LLM)#1
IrfanBasha-03 wants to merge 1 commit into
TrainWithShubham:mainfrom
IrfanBasha-03:groq-migration

Conversation

@IrfanBasha-03

Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings May 29, 2026 07:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 thread cli.py
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 thread README.md
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)
Comment thread README.md
| |
|-- update(send_message, "heal it") ---->|
| ├─ activity: call_claude → tool: start_healing
| ├─ activity: call_groq → tool: start_healing
Comment thread README.md
| ├─ 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",
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants