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

Implement retry mechanism for LLM failures #236

Open
gentlementlegen opened this issue Jan 8, 2025 · 3 comments · May be fixed by #240
Open

Implement retry mechanism for LLM failures #236

gentlementlegen opened this issue Jan 8, 2025 · 3 comments · May be fixed by #240

Comments

@gentlementlegen
Copy link
Member

gentlementlegen commented Jan 8, 2025

          I would like to do that, but the endpoint is changeable so if another API is used (I know that shiv recommended others) the return code of the API can differ (and actually the return code of OpenAPI doesn't indicate that the comment is too long as far as I remember, just a failure) and parsing the error message feels unreliable.

See error code 429: https://platform.openai.com/docs/guides/error-codes

Originally posted by @gentlementlegen in #225 (comment)

Description

Currently if the LLM fails, we throw and abort the run completely, which cancels all the rewards and results, and needs a new run to be triggered afterwards. While some errors are not recoverable, the ones like us sending too many tokens to be handled can be avoided by splitting the prompt and retrying with a smaller prompt until it fits with the given model.

Needed changes

We should implement:

  • a retry mechanism which, on errors that are not fatal, would give another try with the LLM
  • covering cases like the token amount sent being too large, responses having truncated JSON content, network failures
  • post a message saying the results are being retried
  • set a failure limit
  • throw in the end if every try is unsecessfull
  • add related tests
Copy link

ubiquity-os-beta bot commented Jan 8, 2025

Note

The following contributors may be suitable for this task:

gentlementlegen

78% Match ubiquity-os-marketplace/text-conversation-rewards#4

@whilefoo
Copy link
Member

/start

Copy link

Beneficiary 0xA0B11F474d8ECE1205d38c66d5F2bE8917675d60

Tip

  • Use /wallet 0x0000...0000 if you want to update your registered payment wallet address.
  • Be sure to open a draft pull request as soon as possible to communicate updates on your progress.
  • Be sure to provide timely updates to us when requested, or you will be automatically unassigned from the task.

@whilefoo whilefoo linked a pull request Jan 15, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants