Skip to content

fix(adapters): raise a clear error for Groq embeddings#1536

Merged
Tomas2D merged 1 commit into
i-am-bee:mainfrom
BrUn3y:fix/groq-embedding-unsupported
Jul 3, 2026
Merged

fix(adapters): raise a clear error for Groq embeddings#1536
Tomas2D merged 1 commit into
i-am-bee:mainfrom
BrUn3y:fix/groq-embedding-unsupported

Conversation

@BrUn3y

@BrUn3y BrUn3y commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Description

#1537
The GroqEmbeddingModel shipped with a default model_id of "llama-3.1-8b-instant", which is a Groq chat model — not an embedding model. Worse, Groq does not expose a text embeddings API at all (Groq models), so constructing the model without an explicit model_id (e.g. EmbeddingModel.from_name("groq") or GroqEmbeddingModel()) produced a cryptic provider failure on the first request.

This PR makes the limitation explicit instead of failing obscurely:

  • GroqEmbeddingModel.__init__ now raises a clear NotImplementedError explaining that Groq has no embeddings API and pointing to providers that do (OpenAI, Ollama, watsonx, Gemini, MistralAI). Because the dynamic model loader resolves the same class, this also covers EmbeddingModel.from_name("groq").
  • Removes the broken GroqEmbeddingModel() usage from python/examples/backend/providers/groq.py.
  • Updates the supported-providers table in docs/src/content/docs/modules/backend.mdx: Groq embedding ✅ → ❌, and drops the misleading GROQ_EMBEDDING_MODEL env var.
  • Adds unit tests (python/tests/adapters/groq/) asserting both construction paths raise the clear error.

No breaking change for working code: there was no valid Groq embedding configuration before, so any prior usage already failed at runtime — now it fails immediately with an actionable message.

Note: the TypeScript GroqEmbeddingModel already requires an explicit modelId (it throws ValueError("Missing modelId!") otherwise), so it never carried the invalid-default bug. Making the TS side consistently reject Groq embeddings can be a separate follow-up.

Checklist

General

Code quality checks

  • Code quality checks pass: mise check (mise fix to auto-fix)

Testing

  • Unit tests pass: mise test:unit
  • E2E tests pass: mise test:e2e
  • Tests are included (for bug fixes or new features)

Documentation

  • Documentation is updated
  • Embedme embeds code examples in docs. To update after edits, run: Python mise docs:fix

…y Groq API)

Groq has no text embeddings API, but GroqEmbeddingModel defaulted to 'llama-3.1-8b-instant' (a Groq chat model), causing a cryptic failure on first use. Raise a clear NotImplementedError instead, covering both GroqEmbeddingModel() and EmbeddingModel.from_name('groq'). Remove the broken example usage, mark Groq embedding as unsupported in the docs table, and add unit tests.

Signed-off-by: Edgar Bruney Castañeda Torres <edgar.castaneda@ibm.com>
@BrUn3y
BrUn3y requested review from a team as code owners June 29, 2026 22:04
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jun 29, 2026
@github-actions github-actions Bot added documentation Improvements or additions to documentation python Python related functionality labels Jun 29, 2026

@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 disables the unsupported Groq embedding model and updates the documentation, examples, and tests accordingly. Since Groq does not offer a text embeddings API, the GroqEmbeddingModel class now explicitly raises a NotImplementedError with a clear, actionable error message. I have no feedback to provide.

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.

@BrUn3y BrUn3y changed the title fix(adapters): raise a clear error for Groq embeddings ( fix(adapters): raise a clear error for Groq embeddings Jun 29, 2026

@Tomas2D Tomas2D 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.

Correctly resolves #1537 — raises a clear NotImplementedError for both direct construction and the from_name path, with matching tests and docs updates. CI green. Thanks @BrUn3y! 🐝

@Tomas2D
Tomas2D merged commit a3b22fd into i-am-bee:main Jul 3, 2026
5 checks passed
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation lgtm This PR has been approved by a maintainer python Python related functionality size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants