Skip to content

🚀 Feature: Install less packages #2803

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
InAnYan opened this issue Apr 1, 2025 · 8 comments
Open
1 task done

🚀 Feature: Install less packages #2803

InAnYan opened this issue Apr 1, 2025 · 8 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@InAnYan
Copy link

InAnYan commented Apr 1, 2025

Which component is this feature for?

Traceloop SDK

🔖 Feature description

I've installed traceloop-sdk with uv, and it installed a lot of packages:

 + opentelemetry-instrumentation-alephalpha==0.39.0
 + opentelemetry-instrumentation-anthropic==0.39.0
 + opentelemetry-instrumentation-bedrock==0.39.0
 + opentelemetry-instrumentation-chromadb==0.39.0
 + opentelemetry-instrumentation-cohere==0.39.0
 + opentelemetry-instrumentation-crewai==0.39.0
 + opentelemetry-instrumentation-google-generativeai==0.39.0
 + opentelemetry-instrumentation-groq==0.39.0
 + opentelemetry-instrumentation-haystack==0.39.0
 + opentelemetry-instrumentation-lancedb==0.39.0
 + opentelemetry-instrumentation-langchain==0.39.0
 + opentelemetry-instrumentation-llamaindex==0.39.0
 + opentelemetry-instrumentation-logging==0.52b1
 + opentelemetry-instrumentation-marqo==0.39.0
 + opentelemetry-instrumentation-milvus==0.39.0
 + opentelemetry-instrumentation-mistralai==0.39.0
 + opentelemetry-instrumentation-ollama==0.39.0
 + opentelemetry-instrumentation-openai==0.39.0
 + opentelemetry-instrumentation-pinecone==0.39.0
 + opentelemetry-instrumentation-qdrant==0.39.0
 + opentelemetry-instrumentation-replicate==0.39.0
 + opentelemetry-instrumentation-requests==0.52b1
 + opentelemetry-instrumentation-sagemaker==0.39.0
 + opentelemetry-instrumentation-sqlalchemy==0.52b1
 + opentelemetry-instrumentation-threading==0.52b1
 + opentelemetry-instrumentation-together==0.39.0
 + opentelemetry-instrumentation-transformers==0.39.0
 + opentelemetry-instrumentation-urllib3==0.52b1
 + opentelemetry-instrumentation-vertexai==0.39.0
 + opentelemetry-instrumentation-watsonx==0.39.0
 + opentelemetry-instrumentation-weaviate==0.39.0
 + opentelemetry-semantic-conventions-ai==0.4.3
 + opentelemetry-util-http==0.52b1

Is there a way to limit number of packages and install only necessary?

🎤 Why is this feature needed ?

I don't really use all of these technologies in my app. This is too much.

Everywhere where openllmetry is mentioned (even your docs), they tell to use this command:

pip install traceloop-sdk

Many projects use this feature: https://stackoverflow.com/a/46775606/10037342, where extensions are listed in square brackets.

✌️ How do you aim to achieve this?

Use optional dependencies, so that only needed packages are installed.

And replace original command with:

pip install traceloop-sdk[full]

Something like that. Free to discuss, free to close 😄

🔄️ Additional Information

No response

👀 Have you spent some time to check if this feature request has been raised before?

  • I checked and didn't find similar issue

Are you willing to submit PR?

None

@InAnYan
Copy link
Author

InAnYan commented Apr 1, 2025

Side note: I see that you can actually install separate packages: https://qdrant.tech/documentation/observability/openllmetry/

@nirga
Copy link
Member

nirga commented Apr 3, 2025

Hey @InAnYan, you're right. When we began this OSS we just had 5 packages and it has overgrown a bit. We'll prioritize this but feel free to take a stab at it if you have the capacity - we'd love the contribution :)

@nirga nirga added good first issue Good for newcomers help wanted Extra attention is needed labels Apr 3, 2025
@brambhattabhishek
Copy link

/assign

@Rohan5kumar
Copy link

You're absolutely right — installing traceloop-sdk currently pulls in all optional OpenTelemetry instrumentation packages, even when users only need a subset. This can result in unnecessary bloat, especially for minimal or targeted setups.

It would definitely be more efficient to split these dependencies using extras_require in setup.py or pyproject.toml. For example:

pip install traceloop-sdk[openai]
pip install traceloop-sdk[langchain,llamaindex]
pip install traceloop-sdk[full] # for everything

This way, users can install only the integrations they need.

If the maintainers are open to this, I’d be happy to help contribute a PR to implement optional dependencies and update the docs accordingly.

@gauravbh024
Copy link

you can do it manually or you can use some technics for that and sprate them

@amitalokbera
Copy link

picking this up

@amitalokbera
Copy link

amitalokbera commented May 29, 2025

@nirga

I'm planning to modularize the dependencies like this, let me know if this looks good to you

  • llm: openai, anthropic, cohere, groq, etc.
  • frameworks: langchain, llamaindex, crewai, haystack, transformers
  • vectorstores: pinecone, qdrant, weaviate, chromadb, lancedb, milvus
  • cloud: bedrock, vertexai, sagemaker, watsonx, google-generativeai
  • minimal: just the base SDK (opentelemetry + pydantic, logging, etc.)
  • all: includes everything above

To handle cases where a user installs the minimal version but tries to use an integration from a missing group, I'm also thinking of adding a small utility like:

from .utils import require_dependency

# Ensure the 'openai' package is installed
require_dependency("openai", "llm")

This would raise a clear error like:

Missing optional dependency 'openai'. Please install with 'traceloop-sdk[llm]' to use this feature.

One drawback is that this check would need to be added in multiple places across the codebase, which isn’t ideal. Open to better suggestions or ideas for a cleaner solution before I move ahead with the PR.

@nirga
Copy link
Member

nirga commented May 30, 2025

Sounds good @amitalokbera! I might even take it one step further (not sure how easy / hard it will be) - have a module per LLM. So you can even just install traceloop-sdk[openai] - which is a common scenario imo. Same for frameworks - people are more likely to use just one framework, and not all of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants