unitxt icon indicating copy to clipboard operation
unitxt copied to clipboard

'This event loop is already running' error when using LiteLLM inside another event loop

Open martinscooper opened this issue 9 months ago • 1 comments

LiteLLMInferenceEngine, as it is implemented on unitxt, creates an event loop. FastAPI/Jupyter Notebooks also create one. asyncio doesn't allow nested loop, so we need to rely on nest_asyncio to handle them.

We should catch this error and add an error message with instructions and suggested fix

Refer to this discussion for more details.

martinscooper avatar Mar 05 '25 19:03 martinscooper

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Apr 10 '25 02:04 github-actions[bot]