Skip to content

Fix #2803: 🚀 Feature: Install less packages#3997

Open
mattiagggg wants to merge 2 commits intotraceloop:mainfrom
mattiagggg:fix/issue-2803-feature-install-less-packages
Open

Fix #2803: 🚀 Feature: Install less packages#3997
mattiagggg wants to merge 2 commits intotraceloop:mainfrom
mattiagggg:fix/issue-2803-feature-install-less-packages

Conversation

@mattiagggg
Copy link
Copy Markdown

@mattiagggg mattiagggg commented Apr 15, 2026

Summary

Move all LLM/AI-provider instrumentation packages from hard dependencies to optional extras, significantly reducing the default install footprint. Users can now install only the instrumentations they need (e.g., pip install traceloop-sdk[openai]) or opt into the full set with traceloop-sdk[all].

Changes

  • Removed 31 provider-specific instrumentation packages from the core dependencies list
  • Added per-provider optional extras (e.g., [openai], [anthropic], [langchain], etc.) for granular installs
  • Added an [all] extra that installs every instrumentation package, preserving backwards compatibility for users who want the previous behavior
  • Core infrastructure deps (OpenTelemetry base, requests, urllib3, logging, threading, SQLAlchemy, Redis) remain as hard dependencies

Testing

  • Install traceloop-sdk without extras and verify only core deps are installed — no provider-specific packages should be present
  • Install with traceloop-sdk[openai] and verify only the OpenAI instrumentation is pulled in
  • Install with traceloop-sdk[all] and verify all instrumentation packages are installed (backwards-compat)
  • Run the existing test suite to confirm no regressions
  • Traceloop.init() continues to work gracefully when instrumentation packages are absent — the SDK already uses is_package_installed() checks for conditional imports

Closes #2803

Summary by CodeRabbit

  • Chores
    • Instrumentation for specific providers has been made optional: the base SDK is smaller and individual OpenTelemetry integrations can be installed as extras (e.g., pip install traceloop[openai,langchain]).
    • Added an "all" extra to install all supported instrumentation in one step; each instrumentation extra targets recent OpenTelemetry builds.

Move all LLM/AI-provider instrumentation packages from hard dependencies to optional extras in traceloop-sdk's pyproject.toml. Keep only core infrastructure packages (requests, urllib3, logging, threading, sqlalchemy, redis) as hard dependencies. Add per-provider extras (e.g., `pip install traceloop-sdk[openai]`) and an `all` extra for the current behavior. No runtime code changes needed — the SDK already uses conditional imports via `is_package_installed()` checks.
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 15, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 49e003a6-b13a-4eb6-ac01-dc53abd2d85e

📥 Commits

Reviewing files that changed from the base of the PR and between fac6ef7 and a83a6c3.

📒 Files selected for processing (1)
  • packages/traceloop-sdk/pyproject.toml
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/traceloop-sdk/pyproject.toml

📝 Walkthrough

Walkthrough

Moved 30+ OpenTelemetry instrumentation packages in packages/traceloop-sdk/pyproject.toml from mandatory project.dependencies into project.optional-dependencies as individual extras and introduced an aggregated all extra, each pinned to >=0.59b0.

Changes

Cohort / File(s) Summary
Package Dependencies Configuration
packages/traceloop-sdk/pyproject.toml
Removed numerous opentelemetry-instrumentation-* packages from project.dependencies and added them as individual extras (e.g., agno, alephalpha, anthropic, bedrock, chromadb, cohere, crewai, google-generativeai, groq, haystack, lancedb, langchain, llamaindex, marqo, mcp, milvus, mistralai, ollama, openai, openai-agents, pinecone, qdrant, replicate, sagemaker, together, transformers, vertexai, voyageai, watsonx, weaviate, writer, etc.), each pinned to >=0.59b0. Added an all extra that aggregates all instrumentation extras.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped through tomes of tangled pins,

I nudged each tool into tidy bins.
Pick the parts you need, keep the rest at bay,
Or choose "all" and let them come out to play.
🥕✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: moving instrumentation packages to optional dependencies to reduce the default install footprint.
Linked Issues check ✅ Passed The pull request implements all coding requirements from issue #2803: moves provider packages to optional extras, provides per-provider extras, adds an [all] extra for backwards compatibility, and maintains core hard dependencies.
Out of Scope Changes check ✅ Passed All changes are within scope: only the pyproject.toml was modified to move dependencies to optional extras as specified in issue #2803; no unrelated code changes were introduced.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In `@packages/traceloop-sdk/pyproject.toml`:
- Around line 40-103: The extras for optional instrumentation (the individual
extras like agno, alephalpha, anthropic, ..., writer and the combined "all"
list) currently pin no minimum version for opentelemetry-instrumentation
packages; update each entry to require at least the SDK-compatible minimum
(e.g., "opentelemetry-instrumentation-<provider> >=0.59b0") and mirror the same
>=0.59b0 specifier for every package string inside the all list so all 31
provider extras enforce the minimum version floor.
🪄 Autofix (Beta)

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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5d83c7e6-d4bb-4fb6-823a-c1219263a4a8

📥 Commits

Reviewing files that changed from the base of the PR and between b80f109 and fac6ef7.

📒 Files selected for processing (1)
  • packages/traceloop-sdk/pyproject.toml

Comment thread packages/traceloop-sdk/pyproject.toml Outdated
…xtras

Ensures all provider extras and the `all` list enforce a minimum version
compatible with SDK 0.59.0, matching the floor used by core instrumentation
dependencies.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

🚀 Feature: Install less packages

2 participants