← Back to Pull requests

feat(provider): add Cohere model provider #500

Closed
unknown closed this pull request without merging on Oct 19, 2026 11:56 UTC
View on GitHub
unknown unknown commented on Oct 15, 2026 15:54 UTC
Author

What changes are being made and why?

Fixes kestra-io/plugin-ai#487: Add Cohere as a model provider

Adds io.kestra.plugin.ai.provider.Cohere, built on OpenAICompliantProvider the same way DeepSeek is. It uses Cohere's OpenAI-compatible API at https://api.cohere.ai/compatibility/v1, so chat completions and embeddings work through the existing path with no new dependency. baseUrl can be overridden if needed.

Also adds Cohere to the plugin docs provider list and to the AGENTS.md class list.

On the questions in the issue: I went with the OpenAI-compatible endpoint, same as DeepSeek, and left reranking out. Tests follow the DeepSeek ones.

---

How the changes have been QAed?

Added testChatCompletionCohere in ChatCompletionTest, gated on COHERE_API_KEY like the DeepSeek test. Locally compileJava, lintPluginDocs and the provider tests pass. I don't have a Cohere key, so the live test was skipped.

Example flow:

id: chat_completion
namespace: company.ai

inputs:
- id: prompt
type: STRING

tasks:
- id: chat_completion
type: io.kestra.plugin.ai.completion.ChatCompletion
provider:
type: io.kestra.plugin.ai.provider.Cohere
apiKey: "{{ secret('COHERE_API_KEY') }}"
modelName: command-a-03-2025
messages:
- type: USER
content: "{{ inputs.prompt }}"

---

Setup Instructions

  • A Cohere API key from https://dashboard.cohere.com/api-keys, stored as the COHERE_API_KEY secret
  • ---

    Contributor Checklist ✅

  • I have read and followed the plugin contribution guidelines
  • Diff: 210 lines (+157 / -53) across 2 files Reviewer: akshat-lakhera Review duration: 5522m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.41) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.41 · 210 lines diff across 2 files
    0.41
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.320
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #500"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 41.5% (MEDIUM) · Higher = larger blast radius
    41.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 16.4% · Safe to merge
    16.4%