Skip to content

docs(rag): add xpu to embedding device options - #6808

Open
mhbuehler wants to merge 2 commits into
crewAIInc:mainfrom
mhbuehler:docs/rag-xpu-device-option
Open

docs(rag): add xpu to embedding device options#6808
mhbuehler wants to merge 2 commits into
crewAIInc:mainfrom
mhbuehler:docs/rag-xpu-device-option

Conversation

@mhbuehler

Copy link
Copy Markdown

Summary

Add xpu to the documented device options for the Instructor and Sentence Transformer embedding providers.

Changes

  • adds xpu to the RagTool configuration documentation
  • updates provider field descriptions to list cpu, cuda, mps, and xpu
  • extends the Sentence Transformer configuration test to verify that documented device strings are preserved

Motivation

The providers pass the configured device string to their underlying embedding implementations, but their documentation and field descriptions did not mention Intel XPU as an available option. This update makes the documented options more complete and consistent.

Testing

Ran unit tests and code quality checks and all passed.

  • uv run pytest lib/crewai/tests/ -x -q -> 4588 passed
  • uv run mypy lib/ -> Success: no issues found in 895 source files

Copilot AI lite review requested due to automatic review settings August 4, 2026 17:53
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: db7c9645-ba5b-4936-8e94-c00e66c05765

📥 Commits

Reviewing files that changed from the base of the PR and between 2216736 and 93a0a9b.

📒 Files selected for processing (1)
  • lib/crewai/tests/rag/embeddings/test_backward_compatibility.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • lib/crewai/tests/rag/embeddings/test_backward_compatibility.py

📝 Walkthrough

Walkthrough

The change documents xpu for Instructor and Sentence Transformer providers in English and Arabic. Provider descriptions also document mps. The compatibility test validates preservation of cpu, cuda, mps, and xpu.

Changes

Embedding device support

Layer / File(s) Summary
Provider device descriptions
lib/crewai/src/crewai/rag/embeddings/providers/*, docs/edge/{en,ar}/tools/ai-ml/ragtool.mdx
Provider descriptions document mps and xpu. English and Arabic documentation adds xpu to the device options.
Device compatibility validation
lib/crewai/tests/rag/embeddings/test_backward_compatibility.py
The SentenceTransformer compatibility test parameterizes cpu, cuda, mps, and xpu, then verifies that each value is preserved.

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding xpu to embedding device options.
Description check ✅ Passed The description directly explains the documentation, provider description, and test updates in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI 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.

Pull request overview

This PR updates the RAG embeddings documentation and provider metadata to explicitly include Intel xpu as a supported/commonly used device string for the Instructor and Sentence Transformer embedding providers, and extends a backward-compatibility test to ensure documented device values are preserved in configuration.

Changes:

  • Document xpu as a device option for Instructor and Sentence Transformer in ragtool.mdx (EN + AR).
  • Update Pydantic field descriptions for device in the Instructor and Sentence Transformer providers to include mps and xpu.
  • Parameterize the Sentence Transformer config test to validate that documented device strings are preserved.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lib/crewai/tests/rag/embeddings/test_backward_compatibility.py Parameterizes the Sentence Transformer config test over device strings.
lib/crewai/src/crewai/rag/embeddings/providers/sentence_transformer/sentence_transformer_provider.py Expands device field description to include mps/xpu.
lib/crewai/src/crewai/rag/embeddings/providers/instructor/instructor_provider.py Expands device field description to include mps/xpu.
docs/edge/en/tools/ai-ml/ragtool.mdx Adds xpu to documented device options for Instructor and Sentence Transformer.
docs/edge/ar/tools/ai-ml/ragtool.mdx Mirrors the English doc update by adding xpu to the Arabic device options lists.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


def test_ragtool_sentence_transformer_config(self):
"""Test RagTool SentenceTransformer config from ragtool.mdx."""
@pytest.mark.parametrize("device", ["cuda", "mps", "xpu"])

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/crewai/tests/rag/embeddings/test_backward_compatibility.py`:
- Around line 342-347: Update the device parameterization in
test_ragtool_sentence_transformer_config to include the documented cpu value
alongside cuda, mps, and xpu, preserving the docstring’s claim that all
documented device strings are covered.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e88b0346-bf6f-4f1e-b8a6-22e705daeaca

📥 Commits

Reviewing files that changed from the base of the PR and between 7accafb and 2216736.

📒 Files selected for processing (5)
  • docs/edge/ar/tools/ai-ml/ragtool.mdx
  • docs/edge/en/tools/ai-ml/ragtool.mdx
  • lib/crewai/src/crewai/rag/embeddings/providers/instructor/instructor_provider.py
  • lib/crewai/src/crewai/rag/embeddings/providers/sentence_transformer/sentence_transformer_provider.py
  • lib/crewai/tests/rag/embeddings/test_backward_compatibility.py

Comment thread lib/crewai/tests/rag/embeddings/test_backward_compatibility.py Outdated
Copilot AI review requested due to automatic review settings August 4, 2026 21:34

Copilot AI 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.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

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.

2 participants