Skip to content
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

Async version in aisuite.AsyncClient class #185

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

kapulkin
Copy link

@kapulkin kapulkin commented Feb 4, 2025

Async LLM calls support proposal

Description

I added aisuite.AsyncClient interface with async version of llm calls and implemented support for a few providers: OpenAI, Anthropic, Mistral, Fireworks. Async tests for supported providers are written.

Demand

Async calls are necessary for industrial development and have huge adoption in python libraries like FastAPI. It is easy and popular way to run llm calls in parallel with asyncio.gather() function.

The PR addresses request #61

Changes Made

Class aisuite.AsyncClient is added. The new method def chat_completions_create_async(self, model, messages) is added into Provider class. Default implementation throws NotImplementedError.

Checklist

  • Tests are written
  • Pre-commit hooks pass

@kapulkin
Copy link
Author

kapulkin commented Feb 5, 2025

@ksolo @foxty @jeffxtang @joaomdmoura can you, please, review the PR?

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.

1 participant