Skip to content

feat: add EmpirioLabs integration with ChatEmpirioLabs node#6509

Open
Adam-Dalloul wants to merge 1 commit into
FlowiseAI:mainfrom
Adam-Dalloul:feat/chat-empiriolabs
Open

feat: add EmpirioLabs integration with ChatEmpirioLabs node#6509
Adam-Dalloul wants to merge 1 commit into
FlowiseAI:mainfrom
Adam-Dalloul:feat/chat-empiriolabs

Conversation

@Adam-Dalloul

Copy link
Copy Markdown

What

Adds a dedicated ChatEmpirioLabs Chat Model node and an EmpirioLabs API credential. EmpirioLabs is an OpenAI compatible inference platform that exposes frontier chat models (Qwen3.7, DeepSeek V4, GLM-5.1, Kimi K2.7 Code, MiniMax M3, and more) through a single API.

Changes

  • packages/components/nodes/chatmodels/ChatEmpirioLabs/ChatEmpirioLabs.ts (new): wraps ChatOpenAI with configuration.baseURL = https://api.empiriolabs.ai/v1. Includes an asyncOptions Model Name loader (listModels) that lists chat-capable models live from GET /v1/models, with a static fallback when the catalog is unreachable. Streaming is on by default; Temperature, Max Tokens, Top P, Frequency/Presence Penalty, Timeout, Base Path, and Base Options are exposed (same surface as the existing Cerebras / OpenRouter nodes).
  • packages/components/credentials/EmpirioLabsApi.credential.ts (new): single password field for the EmpirioLabs API key.
  • packages/components/nodes/chatmodels/ChatEmpirioLabs/empiriolabs.svg (new): node icon.
  • packages/server/src/utils/index.ts: register chatEmpirioLabs in the stream-valid Chat Models list so streaming works.

Notes

Verification

  • tsc --noEmit on packages/components: no errors from the new files (the only errors present are pre-existing missing-module errors in src/storage/* and src/utils.ts unrelated to this change).
  • eslint and prettier --check pass on both new files.

Related docs

Companion documentation PR: FlowiseAI/FlowiseDocs#220

Adds a dedicated Chat Model node for EmpirioLabs, an OpenAI-compatible
inference API. The node wraps ChatOpenAI with the EmpirioLabs base URL
(https://api.empiriolabs.ai/v1), a password credential, and an
asyncOptions Model Name loader that lists chat-capable models live from
GET /v1/models (with a static fallback when the catalog is unreachable).
Streaming is enabled by registering chatEmpirioLabs in the stream-valid
chat model list.

Co-Authored-By: Claude <noreply@anthropic.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for EmpirioLabs chat models by adding the EmpirioLabsApi credential, the ChatEmpirioLabs chat model node, and its corresponding SVG icon, as well as enabling streaming support for the new node. Feedback on the implementation highlights two issues in ChatEmpirioLabs.ts: first, the listModels method should dynamically use the user-configured basepath instead of a hardcoded default URL; second, the optional temperature parameter should be parsed and assigned conditionally to prevent passing NaN to the underlying ChatOpenAI instance.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +138 to +140
async listModels(_: INodeData, __?: ICommonObject): Promise<INodeOptionsValue[]> {
try {
const response = await axios.get(`${DEFAULT_BASE_URL}/models`)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The listModels method currently queries the hardcoded DEFAULT_BASE_URL to fetch the model list. If a user configures a custom basepath (e.g., for a local proxy, a self-hosted gateway, or an alternative endpoint), the model loader will still attempt to fetch models from the default URL. This can result in fetching the wrong models or failing to fetch models entirely in restricted or air-gapped environments. We should retrieve and use the user-configured basepath from nodeData.inputs if available.

Suggested change
async listModels(_: INodeData, __?: ICommonObject): Promise<INodeOptionsValue[]> {
try {
const response = await axios.get(`${DEFAULT_BASE_URL}/models`)
async listModels(nodeData: INodeData, __?: ICommonObject): Promise<INodeOptionsValue[]> {
try {
const basePath = (nodeData.inputs?.basepath as string) || DEFAULT_BASE_URL
const response = await axios.get(`${basePath}/models`)

Comment on lines +194 to +200
const obj: ChatOpenAIFields = {
temperature: parseFloat(temperature),
model: modelName,
apiKey: empirioLabsApiKey,
openAIApiKey: empirioLabsApiKey,
streaming: streaming ?? true
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

If temperature is not provided (since it is optional), parseFloat(temperature) will evaluate to NaN. Passing NaN as temperature to ChatOpenAI can cause API requests to fail or behave unexpectedly. It is safer to conditionally add temperature to the configuration object only if it is defined and not an empty string, using a loose equality check (!= null) to handle both null and undefined.

Suggested change
const obj: ChatOpenAIFields = {
temperature: parseFloat(temperature),
model: modelName,
apiKey: empirioLabsApiKey,
openAIApiKey: empirioLabsApiKey,
streaming: streaming ?? true
}
const obj: ChatOpenAIFields = {
model: modelName,
apiKey: empirioLabsApiKey,
openAIApiKey: empirioLabsApiKey,
streaming: streaming ?? true
}
if (temperature != null && temperature !== '') {
obj.temperature = parseFloat(temperature)
}
References
  1. In JavaScript/TypeScript, use loose equality (== null) as a standard idiom for a 'nullish' check that covers both null and undefined.

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