Skip to content

[BUG] Conflicting versions for openai when using OpenLit #4270

@titimoby

Description

@titimoby

Description

Currently using crewai == 1.8.1
Following the OpenLit integration documentation, I added the package openlit to my project.
The version is openlit==1.36.3

The issue is that crewai depends on openai>=1.83.0,<1.84.dev0
but openlit requires openai >= 1.92.0

Running a Crew with OpenLit activated results in a message:

DependencyConflict: requested: "openai >= 1.92.0" but found: "openai 1.83.0"
OpenLIT metrics setup failed. Metrics will not be available: 'NoneType' object has no attribute 'create_histogram'
DependencyConflict: requested: "openai >= 1.92.0" but found: "openai 1.83.0"```

And then a bunch of:
```Attempting to instrument while already instrumented
Attempting to instrument while already instrumented
Attempting to instrument while already instrumented```

The Crew executes but all logs are still pure CrewAI logs and traces.

### Steps to Reproduce

Follow the [OpenLit integration](https://docs.crewai.com/en/observability/openlit) documentation:
- pip install openlit
- add the activation code in the project
- run the project

### Expected behavior

CrewAI Crew runs and OpenLit collect the telemetry information.

### Screenshots/Code snippets

import openlit
openlit.init(otlp_endpoint="http://127.0.0.1:4318")
openlit.init(disable_metrics=True)

...
crew.kickoff(inputs={"customer_query": customer_query})

### Operating System

Other (specify in additional context)

### Python Version

3.10

### crewAI Version

1.8.1

### crewAI Tools Version

1.8.1

### Virtual Environment

Venv

### Evidence

```❯ uv run 03-MultiAgentsCrew.py
Overriding of current TracerProvider is not allowed
DependencyConflict: requested: "openai >= 1.92.0" but found: "openai 1.83.0"
OpenLIT metrics setup failed. Metrics will not be available: 'NoneType' object has no attribute 'create_histogram'
DependencyConflict: requested: "openai >= 1.92.0" but found: "openai 1.83.0"
Attempting to instrument while already instrumented
Attempting to instrument while already instrumented
Attempting to instrument while already instrumented
Attempting to instrument while already instrumented
Attempting to instrument while already instrumented
Attempting to instrument while already instrumented
Attempting to instrument while already instrumented
Attempting to instrument while already instrumented
Attempting to instrument while already instrumented```

### Possible Solution

a fix needs to be done in dependencies

### Additional context

macOS Sequoia
Python 3.13

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions