Skip to content

Add generic LLM API integration for chat review#6

Open
kerbearasaurus wants to merge 1 commit intomainfrom
kerbearasaurus/evidencemd-llm
Open

Add generic LLM API integration for chat review#6
kerbearasaurus wants to merge 1 commit intomainfrom
kerbearasaurus/evidencemd-llm

Conversation

@kerbearasaurus
Copy link
Member

Summary

  • Adds optional LLM API configuration (base URL, API key, header, model) to settings
  • Users can configure any OpenAI-compatible chat completions API (EvidenceMD, OpenAI, Anthropic, etc.)
  • After PhenoML agent responds, users can click "Get LLM Review" to send response to configured LLM
  • LLM response appears as a labeled chat message, allowing comparison with agent output

Implementation

  • New src/lib/llm.ts: Generic sendChatCompletion() function supporting any chat API
  • Settings form updated with LLM config fields (base URL, API key, key header, model)
  • Chat pipeline adds sendToLlm() function and ADD_ASSISTANT_MESSAGE action
  • Chat messages enhanced with optional source field to label LLM responses
  • Button only shows when LLM is configured and after agent response completes

Test plan

  • Open settings and verify LLM API fields appear (optional)
  • Save LLM config with test credentials
  • Run normal PhenoML pipeline to completion
  • Verify "Get LLM Review" button appears on agent response
  • Click button and verify LLM response appears with "LLM Review" badge
  • Verify button does NOT appear when LLM API not configured

🤖 Generated with Claude Code

Adds optional LLM API configuration (base URL, API key, key header, model) to enable on-demand reviews of PhenoML agent responses. Users can now configure any OpenAI-compatible chat completions API (EvidenceMD, OpenAI, Anthropic, etc.) and click "Get LLM Review" on agent responses to send them to the configured LLM for additional analysis.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@kerbearasaurus
Copy link
Member Author

Just making this temp PR for the hackathon

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.

1 participant