UAT: Groq, Cohere, and Together AI LangChain packages missing from project dependencies #5960

Open
opened 2026-04-09 12:20:11 +00:00 by HAL9000 · 1 comment
Owner

Bug Report

Summary

The ProviderRegistry in src/cleveragents/providers/registry.py supports Groq, Cohere, and Together AI providers (via ProviderType.GROQ, ProviderType.COHERE, ProviderType.TOGETHER) and attempts to import their LangChain packages at runtime (langchain_groq, langchain_cohere, langchain_together). However, none of these packages are declared as dependencies in pyproject.toml, and they are absent from uv.lock.

What Was Tested

  • Inspected pyproject.toml [project.dependencies] section
  • Inspected uv.lock for installed packages
  • Cross-referenced with src/cleveragents/providers/registry.py _create_provider_llm() method
  • Verified type stubs exist in typings/ directory (confirming intent to support these providers)

Expected Behavior (from spec)

The Provider Registry supports Groq, Cohere, and Together AI as first-class providers. When a user configures GROQ_API_KEY, COHERE_API_KEY, or TOGETHER_API_KEY, the system should be able to instantiate the corresponding LangChain chat model without error.

Actual Behavior

When ProviderRegistry._create_provider_llm() is called for ProviderType.GROQ, ProviderType.COHERE, or ProviderType.TOGETHER, it executes:

# For Groq:
from langchain_groq import ChatGroq  # ImportError — package not installed

# For Together:
from langchain_together import ChatTogether  # ImportError — package not installed

# For Cohere:
from langchain_cohere import ChatCohere  # ImportError — package not installed

This raises ImportError / ModuleNotFoundError at runtime because the packages are not in the dependency graph.

Evidence

pyproject.toml dependencies (relevant excerpt):

dependencies = [
    "langchain>=0.2.14",
    "langchain-anthropic>=0.2.0",
    "langchain-community>=0.2.14",
    "langchain-openai>=0.2.0",
    "langchain-google-genai>=0.2.0",
    # langchain-groq — MISSING
    # langchain-cohere — MISSING
    # langchain-together — MISSING
]

uv.lock — no entries for:

  • langchain-groq
  • langchain-cohere
  • langchain-together

registry.py lines 529–547:

if provider_type == ProviderType.GROQ:
    from langchain_groq import ChatGroq  # Will fail at runtime
    return ChatGroq(model=model_id or "llama-3.1-70b-versatile", **kwargs)

if provider_type == ProviderType.TOGETHER:
    from langchain_together import ChatTogether  # Will fail at runtime
    return ChatTogether(model=model_id or "meta-llama/Llama-3.1-70B-Instruct-Turbo", **kwargs)

if provider_type == ProviderType.COHERE:
    from langchain_cohere import ChatCohere  # Will fail at runtime
    return ChatCohere(model=model_id or "command-r-plus", **kwargs)

Type stubs exist in typings/langchain_groq/__init__.pyi, typings/langchain_together/__init__.pyi, typings/langchain_cohere/__init__.pyi — confirming these providers were intentionally designed but the runtime packages were never added.

Steps to Reproduce

  1. Set GROQ_API_KEY=any-value
  2. Run agents actor run groq/llama-3.1-70b-versatile "hello"
  3. Observe ModuleNotFoundError: No module named 'langchain_groq'

Impact

  • Groq: Fast inference provider (Llama 3.1 70B) — completely non-functional
  • Cohere: Command R+ provider — completely non-functional
  • Together AI: Open-source model hosting — completely non-functional
  • All three providers appear in agents diagnostics output as supported but fail when actually used

Fix

Add the missing packages to pyproject.toml:

"langchain-groq>=0.2.0",
"langchain-cohere>=0.2.0",
"langchain-together>=0.2.0",

Then run uv lock and uv sync to update the lockfile.

Code Locations

  • src/cleveragents/providers/registry.py — lines 529–547 (_create_provider_llm)
  • pyproject.toml[project.dependencies] section
  • typings/langchain_groq/__init__.pyi — type stub (exists)
  • typings/langchain_together/__init__.pyi — type stub (exists)
  • typings/langchain_cohere/__init__.pyi — type stub (exists)

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: uat-tester

## Bug Report ### Summary The `ProviderRegistry` in `src/cleveragents/providers/registry.py` supports Groq, Cohere, and Together AI providers (via `ProviderType.GROQ`, `ProviderType.COHERE`, `ProviderType.TOGETHER`) and attempts to import their LangChain packages at runtime (`langchain_groq`, `langchain_cohere`, `langchain_together`). However, **none of these packages are declared as dependencies in `pyproject.toml`**, and they are **absent from `uv.lock`**. ### What Was Tested - Inspected `pyproject.toml` `[project.dependencies]` section - Inspected `uv.lock` for installed packages - Cross-referenced with `src/cleveragents/providers/registry.py` `_create_provider_llm()` method - Verified type stubs exist in `typings/` directory (confirming intent to support these providers) ### Expected Behavior (from spec) The Provider Registry supports Groq, Cohere, and Together AI as first-class providers. When a user configures `GROQ_API_KEY`, `COHERE_API_KEY`, or `TOGETHER_API_KEY`, the system should be able to instantiate the corresponding LangChain chat model without error. ### Actual Behavior When `ProviderRegistry._create_provider_llm()` is called for `ProviderType.GROQ`, `ProviderType.COHERE`, or `ProviderType.TOGETHER`, it executes: ```python # For Groq: from langchain_groq import ChatGroq # ImportError — package not installed # For Together: from langchain_together import ChatTogether # ImportError — package not installed # For Cohere: from langchain_cohere import ChatCohere # ImportError — package not installed ``` This raises `ImportError` / `ModuleNotFoundError` at runtime because the packages are not in the dependency graph. ### Evidence **`pyproject.toml` dependencies (relevant excerpt):** ```toml dependencies = [ "langchain>=0.2.14", "langchain-anthropic>=0.2.0", "langchain-community>=0.2.14", "langchain-openai>=0.2.0", "langchain-google-genai>=0.2.0", # langchain-groq — MISSING # langchain-cohere — MISSING # langchain-together — MISSING ] ``` **`uv.lock` — no entries for:** - `langchain-groq` - `langchain-cohere` - `langchain-together` **`registry.py` lines 529–547:** ```python if provider_type == ProviderType.GROQ: from langchain_groq import ChatGroq # Will fail at runtime return ChatGroq(model=model_id or "llama-3.1-70b-versatile", **kwargs) if provider_type == ProviderType.TOGETHER: from langchain_together import ChatTogether # Will fail at runtime return ChatTogether(model=model_id or "meta-llama/Llama-3.1-70B-Instruct-Turbo", **kwargs) if provider_type == ProviderType.COHERE: from langchain_cohere import ChatCohere # Will fail at runtime return ChatCohere(model=model_id or "command-r-plus", **kwargs) ``` **Type stubs exist** in `typings/langchain_groq/__init__.pyi`, `typings/langchain_together/__init__.pyi`, `typings/langchain_cohere/__init__.pyi` — confirming these providers were intentionally designed but the runtime packages were never added. ### Steps to Reproduce 1. Set `GROQ_API_KEY=any-value` 2. Run `agents actor run groq/llama-3.1-70b-versatile "hello"` 3. Observe `ModuleNotFoundError: No module named 'langchain_groq'` ### Impact - **Groq**: Fast inference provider (Llama 3.1 70B) — completely non-functional - **Cohere**: Command R+ provider — completely non-functional - **Together AI**: Open-source model hosting — completely non-functional - All three providers appear in `agents diagnostics` output as supported but fail when actually used ### Fix Add the missing packages to `pyproject.toml`: ```toml "langchain-groq>=0.2.0", "langchain-cohere>=0.2.0", "langchain-together>=0.2.0", ``` Then run `uv lock` and `uv sync` to update the lockfile. ### Code Locations - `src/cleveragents/providers/registry.py` — lines 529–547 (`_create_provider_llm`) - `pyproject.toml` — `[project.dependencies]` section - `typings/langchain_groq/__init__.pyi` — type stub (exists) - `typings/langchain_together/__init__.pyi` — type stub (exists) - `typings/langchain_cohere/__init__.pyi` — type stub (exists) --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
Author
Owner

🏷️ Label compliance fix applied by backlog groomer (cycle 60)

This issue was missing all labels. The following labels have been added based on issue content analysis:

  • State/Verified — confirmed missing runtime dependencies for declared providers
  • Type/Bug — Groq, Cohere, and Together AI providers raise ImportError at runtime
  • Priority/High — three provider integrations completely non-functional

Automated by CleverAgents Bot
Supervisor: Label Management | Agent: forgejo-label-manager

🏷️ **Label compliance fix applied by backlog groomer (cycle 60)** This issue was missing all labels. The following labels have been added based on issue content analysis: - `State/Verified` — confirmed missing runtime dependencies for declared providers - `Type/Bug` — Groq, Cohere, and Together AI providers raise `ImportError` at runtime - `Priority/High` — three provider integrations completely non-functional --- **Automated by CleverAgents Bot** Supervisor: Label Management | Agent: forgejo-label-manager
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#5960
No description provided.