feat(components): add Avian as a new Chat Model provider#5859
feat(components): add Avian as a new Chat Model provider#5859avianion wants to merge 2 commits intoFlowiseAI:mainfrom
Conversation
Add Avian (https://avian.io) as a new LLM provider node for Flowise. Avian provides an OpenAI-compatible inference API with competitive pricing on models including DeepSeek V3.2, Kimi K2.5, GLM-5, and MiniMax M2.5. Changes: - Add ChatAvian node with credential support, model selection, streaming, and standard chat parameters - Add AvianApi credential for API key management - Add Avian models to models.json with pricing info - Add Avian SVG icon
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request integrates Avian as a new chat model provider, expanding the available LLM options within Flowise. It enables users to leverage Avian's OpenAI-compatible API for chat completions, streaming, and function calling, providing access to a range of frontier models with detailed pricing information. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces support for the Avian Chat Model provider. The changes are well-structured and follow the existing patterns for adding new OpenAI-compatible providers, including the credential, node implementation, model definitions, and UI icon. I've identified a couple of areas for improvement regarding the handling of optional numeric parameters, which could lead to unexpected behavior if a user provides 0 as a value or clears a field. I've provided suggestions to make these checks more robust and also noted the use of a deprecated property from the @langchain/openai library.
| const obj: ChatOpenAIFields = { | ||
| temperature: parseFloat(temperature), | ||
| modelName, | ||
| openAIApiKey: avianApiKey, | ||
| apiKey: avianApiKey, | ||
| streaming: streaming ?? true | ||
| } |
There was a problem hiding this comment.
The temperature property is being unconditionally parsed and assigned. If the temperature input is not provided or is an empty string, parseFloat will result in NaN, which could cause issues when passed to the ChatOpenAI constructor. This should be handled conditionally, similar to other optional numeric parameters.
Additionally, the openAIApiKey property is deprecated in @langchain/openai. You should only use apiKey.
| const obj: ChatOpenAIFields = { | |
| temperature: parseFloat(temperature), | |
| modelName, | |
| openAIApiKey: avianApiKey, | |
| apiKey: avianApiKey, | |
| streaming: streaming ?? true | |
| } | |
| const obj: ChatOpenAIFields = { | |
| modelName, | |
| apiKey: avianApiKey, | |
| streaming: streaming ?? true | |
| } | |
| if (temperature !== undefined && temperature !== null && temperature !== '') { | |
| obj.temperature = parseFloat(temperature) | |
| } |
| if (topP) obj.topP = parseFloat(topP) | ||
| if (frequencyPenalty) obj.frequencyPenalty = parseFloat(frequencyPenalty) | ||
| if (presencePenalty) obj.presencePenalty = parseFloat(presencePenalty) |
There was a problem hiding this comment.
The conditional check if (topP) (and similarly for frequencyPenalty and presencePenalty) is problematic because 0 is a valid value for these parameters, but it evaluates to false in a conditional. This means if a user sets these values to 0, they will be ignored. You should use a more robust check to verify that the value is actually provided.
| if (topP) obj.topP = parseFloat(topP) | |
| if (frequencyPenalty) obj.frequencyPenalty = parseFloat(frequencyPenalty) | |
| if (presencePenalty) obj.presencePenalty = parseFloat(presencePenalty) | |
| if (topP !== undefined && topP !== null && topP !== '') obj.topP = parseFloat(topP) | |
| if (frequencyPenalty !== undefined && frequencyPenalty !== null && frequencyPenalty !== '') obj.frequencyPenalty = parseFloat(frequencyPenalty) | |
| if (presencePenalty !== undefined && presencePenalty !== null && presencePenalty !== '') obj.presencePenalty = parseFloat(presencePenalty) |
- Remove deprecated openAIApiKey, use apiKey only - Guard temperature parseFloat against undefined/null/empty input - Use proper null checks for topP, frequencyPenalty, presencePenalty to allow valid value 0
|
Thanks for the review — fixed all three issues in the latest push. |
|
Hey @HenryHengZJ, would love your review on this when you get a chance. Happy to address any feedback! |
Summary
Adds Avian as a new Chat Model provider for Flowise. Avian provides an OpenAI-compatible LLM inference API with competitive pricing on frontier models.
Changes
ChatAvian— chat model node with full support for streaming, function calling, temperature, top-p, frequency/presence penalties, stop sequences, max tokens, and cachingAvianApi— API key credential (AVIAN_API_KEY)models.json:deepseek/deepseek-v3.2moonshotai/kimi-k2.5z-ai/glm-5minimax/minimax-m2.5Provider Details
https://api.avian.io/v1@langchain/openaiChatOpenAIclass with custom base URL, following the same pattern as ChatCerebras, ChatDeepseek, and other OpenAI-compatible providersFiles Changed
packages/components/credentials/AvianApi.credential.ts— API key credentialpackages/components/nodes/chatmodels/ChatAvian/ChatAvian.ts— Chat model nodepackages/components/nodes/chatmodels/ChatAvian/avian.svg— Node iconpackages/components/models.json— Model definitions with pricingTest plan
deepseek/deepseek-v3.2(streaming and non-streaming)cc @HenryHengZJ