Skip to main content

VibeRetry

Table of Contents

Introduction

VibeRetry is a lightweight python package that allows users to use natural language (LLMs) to intelligently retry failed function calls. For example, VibeRetry can be used as a decorator to wrap a function and, in the event of an exception, the LLM will decide whether to retry the function and for how long to wait before retrying. It supports OpenAI and Google Gemini clients currently and a simple example illustrating how it can be used can be seen below:

from google import genai
from viberetry import VibeRetry

# create a google gemini client
client = genai.Client(api_key=os.getenv("GEMINI_API_KEY"))

# create a viberetry instance using the above client and specify a model
viberetry = VibeRetry(client, model="gemini-2.0-flash-lite")

# the example below simulates a function that always raises an exception
# to demonstrate the retry mechanism
@viberetry(max_retries=3, remarks="use exponential backoff")
def simulate_failure() -> int:
    """
    This function raises a simulated exception to demonstrate the retry mechanism.
    """
    raise Exception("Simulated exception.")

# this will fail, but the LLM will retry it a few times
# before finally raising the exception
simulate_failure()

VibeRetry is published on pypi and can be easily installed with:

python3 -m pip install viberetry

Details on the usage of the package and available APIs can be found on the wiki page.

Features

  • Natural Language Conditions: Use natural language to check for conditions, making your code more readable and intuitive.
  • Multi-provider Support: Seamlessly switch between different LLM providers. VibeRetry currently supports OpenAI and Google Gemini.
  • Extensible: The modular design allows for easy extension to other LLM providers in the future.
  • Custom Exceptions: Provides custom exceptions for better error handling and debugging.

Technologies

Technologies used by VibeRetry are as below:

Done with:

Python

Project Repository
https://github.com/vibe-engineers/viberetry

Team

Contributing

If you are looking to contribute to the project, you may find the Developer Guide useful.

In general, the forking workflow is encouraged and you may open a pull request with clear descriptions on the changes and what they are intended to do (enhancement, bug fixes etc). Alternatively, you may simply raise bugs or suggestions by opening an issue or raising it up on discord.

Note: Templates have been created for pull requests and issues to guide you in the process.

Others

For any questions regarding the implementation of the project, you may also reach out on discord.

Release files for viberetry 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for viberetry 1.0.0
File Size Uploaded
viberetry-1.0.0.tar.gz 7.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for viberetry 1.0.0
File Interpreter ABI Platform
viberetry-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.2 kB

Release files / viberetry-1.0.0.tar.gz

Download URL viberetry-1.0.0.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e019683699adac3e7831e3b74a11068429e0350b5298bb86b10e38f060dfd6f6
BLAKE2b-256 checksum
How to use checksums
508deed7f98d69ebfae879f4749f769a772d2757e74703e80071ff51172cb591
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / viberetry-1.0.0-py3-none-any.whl

Download URL viberetry-1.0.0-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7adad2326807cf3286ef31b6fefca2cf6c6a08c9cad9882fbef95e201af167db
BLAKE2b-256 checksum
How to use checksums
a946a54efc885e332c67083a280a2921b34c6c80cc36fef0548501d33d18a5fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page