A custom Dify plugin integrating Google Gemini as an approved LLM provider, enabling organizations to use Gemini's capabilities within their Dify AI application workflows.

Client Overview
A technology enterprise had standardised its internal AI application development workflow on the Dify platform, using Dify to build, deploy, and manage a portfolio of internal AI assistants, document processing tools, and customer-facing chatbots. The organisation had made a strategic decision to transition certain workloads from their existing LLM provider to Google Gemini, driven by Gemini's strong performance on multimodal tasks and the organisation's existing contractual relationship with Google Cloud that offered favourable Gemini API pricing as part of their enterprise agreement. The immediate problem was that Dify did not natively support Google Gemini as a configured LLM provider at the time of the project. The organisation's AI engineering team had evaluated the Dify plugin architecture as the appropriate integration pathway but lacked the internal capacity and specific expertise in Dify's plugin development framework to implement a production-quality provider integration on their own timeline. Attempting to work around the limitation by maintaining separate Gemini API calls outside the Dify workflow created pipeline fragmentation and removed the observability, prompt management, and deployment benefits that Dify's workflow builder provided. The organisation required a plugin that not only connected Dify to the Gemini API but did so with full support for Gemini's model parameter range — including temperature, top-P, top-K, maximum output tokens, and safety settings — and that behaved consistently with how other approved LLM providers appeared within the Dify interface. The engineering team needed to be able to configure Gemini-backed nodes in Dify workflow builder with the same experience they used for other providers, without workarounds or limitations.
Our Approach
Zentric Solutions developed a custom Dify LLM provider plugin that registered Google Gemini as a fully supported model provider within the Dify platform. The plugin was built according to Dify's provider plugin specification, implementing the required provider interface classes, model parameter schemas, and credential handling protocols that Dify's plugin system expected from an approved provider integration. OAuth2-based credential management was implemented to handle Google Cloud API authentication securely, with credentials stored and managed through Dify's native credential vault rather than requiring engineers to manage API keys externally. The plugin registered multiple Gemini model variants — including Gemini Pro and Gemini Ultra — as selectable model options within the Dify interface, with each model's supported parameter ranges and capabilities accurately reflected in the parameter configuration UI. Full parameter support was implemented for temperature, top-P, top-K, maximum output tokens, stop sequences, and Gemini-specific safety filter thresholds, allowing engineers to configure model behaviour precisely within Dify's workflow builder without any loss of control compared to direct API access. Streaming response support was implemented to enable real-time token streaming for chat and completion nodes in Dify workflows, maintaining the same responsive user experience that engineers expected from other provider integrations. The plugin was packaged according to Dify's distribution specification and documented for the organisation's internal engineering team with configuration instructions and parameter guidance. Following deployment, the organisation's AI engineering team was able to configure Gemini-backed nodes across their existing Dify workflows immediately, and several new AI assistants were built using Gemini models within the first two weeks of deployment.
Tech Stack
Project Tags
Everything you need to know about this project and our approach.
Zentric Solutions delivers cutting-edge digital products that streamline operations, enhance engagement, and drive lasting growth.