feat: Add support for Anthropic SDK (Claude) and multi-provider switching#38
Open
SmartisanNaive wants to merge 1 commit into666ghj:mainfrom
Open
feat: Add support for Anthropic SDK (Claude) and multi-provider switching#38SmartisanNaive wants to merge 1 commit into666ghj:mainfrom
SmartisanNaive wants to merge 1 commit into666ghj:mainfrom
Conversation
Owner
|
I appreciate it, but considering that supporting an additional API format would bring unnecessary workload to the subsequent update plans, I will keep this PR to provide ideas for everyone, but it will not be merged before the release of version 1.0. |
Author
|
Thanks for reading , this is a great project.Your project has brought a lot of inspiration to our researchers working on multi-agent applications, thanks again(●'◡'●)
…---Original---
From: ***@***.***>
Date: Sun, Jan 25, 2026 00:20 AM
To: ***@***.***>;
Cc: ***@***.******@***.***>;
Subject: Re: [666ghj/MiroFish] feat: Add support for Anthropic SDK (Claude)and multi-provider switching (PR #38)
666ghj left a comment (666ghj/MiroFish#38)
I appreciate it, but considering that supporting an additional API format would bring unnecessary workload to the subsequent update plans, I will keep this PR to provide ideas for everyone, but it will not be merged before the release of version 1.0.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
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.
This PR introduces native support for the Anthropic (Claude) SDK to MiroFish!
While the project already supports various models via the OpenAI-compatible interface, integrating the official Anthropic SDK allows us to better leverage the capabilities of models like Claude 4 Sonnet. It also ensures compatibility with providers that follow the Anthropic protocol (e.g., Zhipu AI's GLM-4.7 endpoint).
🛠️ Key Changes
Refactored LLMClient (
backend/app/utils/llm_client.py):LLM_PROVIDERmechanism, allowing seamless switching betweenopenai(default) andanthropic.json_objectmode, I implemented a fallback strategy within the client using System Prompt injection and Markdown parsing. This ensures a consistentchat_jsonexperience for the upper layers.Configuration Enhancements (
backend/app/config.py&.env.example):ANTHROPIC_API_KEY,ANTHROPIC_BASE_URL, etc..env.exampleto clearly distinguish between provider configurations.Documentation:
backend/LLM_README.mdwith detailed instructions on how to configure and switch providers.🧪 How to Test
Update dependencies:
Update
.envto switch to Anthropic:Start the backend service and trigger a prediction task to verify that the logs output correctly.
Verified locally using Zhipu GLM-4.7 (Anthropic protocol) - communication works as expected.
Ready for review! Thanks 🚀