crewAI icon indicating copy to clipboard operation
crewAI copied to clipboard

Throttling and rate limiting on non LLM API calls

Open leonard-henriquez opened this issue 9 months ago • 4 comments

I use API that have rate limits and others that need throttling. What is the right way to this ? I feel like the Max RPM parameter on the Agent is not a good fit because it seems focused on the number of LLM calls.

leonard-henriquez avatar May 14 '24 08:05 leonard-henriquez

Just read the docs its right there

https://docs.crewai.com/core-concepts/Agents/#agent-attributes

noggynoggy avatar May 15 '24 09:05 noggynoggy

@noggynoggy thanks for your answer !!

Actually, as I mentioned in my message, I don't think that the "max_rpm" attribute in the documentation is a good fit for my problem because:

  • it's focused on the number of calls to LLM not my end APIs
  • it doesn't solve throttling problem

Is there something that I missed ?

leonard-henriquez avatar May 15 '24 10:05 leonard-henriquez

I am sorry - I do not seem to understand what you want to throttle. Do you mean like "x about of tokens per x amount of time"? I don't know what "my end APIs" is.

noggynoggy avatar May 15 '24 12:05 noggynoggy

I'm using tools that make calls to third-party APIs like:

  • a company search API that allows finding an EU tax number from a business (needs API rate limiting)
  • an email server to send emails (needs throttling)

In case it's not clear what I mean by API rate limiting vs. API throttling, here is an article that talks about it: API Rate Limiting vs. API Throttling: How Are They Different?

Company Search (Rate Limiting)

My API has an X requests per minute limit, so I can't use it more than that. I need to put a limit on tasks, not on agents, for this.

Sending Emails (Throttling)

I can send as many emails as I want, but if I don't put some delay between each email, I will get flagged as spam. I would need to add throttling on tasks for this.

leonard-henriquez avatar May 15 '24 13:05 leonard-henriquez

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Aug 17 '24 12:08 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Aug 23 '24 12:08 github-actions[bot]