Skip to content

Conversation

@hung101
Copy link

@hung101 hung101 commented Nov 19, 2025

Add a dedicated ChatOllama Cloud chat model component to integrate with Ollama Cloud API (https://ollama.com) with complete tool calling functionality.

Features:

  • Dropdown selection for available Ollama Cloud models:
    • gpt-oss:120b, gpt-oss:20b
    • deepseek-v3.1:671b
    • qwen3-coder:480b, qwen3-vl:235b
    • minimax-m2, glm-4.6
  • Configurable base URL (defaults to https://ollama.com)
  • Full tool calling support with bidirectional argument conversion

Files added:

  • packages/components/nodes/chatmodels/ChatOllamaCloud/ChatOllamaCloud.ts
  • packages/components/nodes/chatmodels/ChatOllamaCloud/Ollama.svg
  • packages/components/credentials/OllamaCloudApi.credential.ts

Add a dedicated ChatOllama Cloud chat model component to integrate
with Ollama Cloud API (https://ollama.com) with complete tool calling
functionality.

Features:
- Dropdown selection for available Ollama Cloud models:
  * gpt-oss:120b, gpt-oss:20b
  * deepseek-v3.1:671b
  * qwen3-coder:480b, qwen3-vl:235b
  * minimax-m2, glm-4.6
- Configurable base URL (defaults to https://ollama.com)
- Full tool calling support with bidirectional argument conversion

Files added:
- packages/components/nodes/chatmodels/ChatOllamaCloud/ChatOllamaCloud.ts
- packages/components/nodes/chatmodels/ChatOllamaCloud/Ollama.svg
- packages/components/credentials/OllamaCloudApi.credential.ts
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @hung101, 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 introduces a new ChatOllama Cloud component, enabling seamless integration with the Ollama Cloud API. The component is designed to be compatible with existing chat model interfaces, providing comprehensive tool calling capabilities and flexible configuration options for various Ollama Cloud models. It handles the necessary request and response transformations to ensure smooth communication between the system and the Ollama Cloud service.

Highlights

  • New ChatOllama Cloud Component: A dedicated component has been added to integrate with the Ollama Cloud API, enabling users to leverage Ollama's models within the system.
  • Full Tool Calling Support: The component includes comprehensive tool calling functionality, handling bidirectional argument conversion between LangChain's format and Ollama's expected format, ensuring seamless interaction with external tools.
  • Configurable Models and Parameters: Users can select from a dropdown of available Ollama Cloud models (e.g., gpt-oss, deepseek-v3.1, qwen3-coder) and configure standard chat model parameters like temperature, max tokens, and base URL.
  • New Credential Type: A new 'Ollama Cloud API' credential has been introduced to securely manage API keys required for authenticating with the Ollama Cloud service.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

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

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 a dedicated ChatOllamaCloud component, which is a great addition. The implementation cleverly wraps the existing ChatOpenAI component to create a compatibility layer for the Ollama Cloud API. My review focuses on improving the robustness and maintainability of this new component. I've identified a critical issue with how the temperature parameter is handled which could lead to runtime errors, and I've provided a fix. I also have a couple of suggestions to improve code efficiency and remove some redundant code, which will make the component easier to maintain in the future.

Comment on lines +164 to +167
const obj: any = {
temperature: parseFloat(temperature),
model: modelName
}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The temperature parameter is parsed unconditionally. If this optional field is cleared in the UI, nodeData.inputs?.temperature could be undefined or an empty string. parseFloat on these values results in NaN, which will be sent to the API and likely cause requests to fail. To ensure robustness, you should parse temperature conditionally, similar to how other optional numeric parameters like maxTokens are handled.

Suggested change
const obj: any = {
temperature: parseFloat(temperature),
model: modelName
}
const obj: any = {
model: modelName
}
if (temperature) {
obj.temperature = parseFloat(temperature)
}

// Manual conversion for LangChain tools with Zod schema
if (tool.name && tool.schema) {
try {
const { zodToJsonSchema } = require('zod-to-json-schema')
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The require('zod-to-json-schema') call is inside a map function. While require is cached by Node.js, calling it repeatedly within a loop is inefficient and can be harder to read. It's better practice to move this require statement outside the boundTools.map(...) loop to ensure it's resolved only once.

const model = new ChatOpenAI(obj)

// Force streaming to false for Ollama compatibility
model.streaming = false
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This line is redundant. The ChatOpenAI constructor defaults streaming to false if it's not provided in the options. Since the obj passed to the constructor doesn't include a streaming property, the model instance is already created with streaming: false. You can remove this line for code clarity. Additionally, the streaming variable declared on line 256 is unused and can also be removed.

Copy link
Author

@hung101 hung101 left a comment

Choose a reason for hiding this comment

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

Add fallback handling

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