Catalog PyPI
PACKAGE EXPLORERView in registry

a4f-local

PyPI

A unified wrapper for various reverse-engineered AI provider APIs, aiming for OpenAI compatibility.

aiapiopenaireverse-engineeringtext-to-speechttswrapper
Versions collected1
Direct dependencies8From release 0.1.1
Last observed20 Oct, 16:42 UTC

README

Version 0.1.1 documentation

a4f-local

PyPI version PyPI - Python Version

A unified, professional Python wrapper for various reverse-engineered AI provider APIs, designed to be OpenAI-compatible and easy to use.


Key Features

  • Unified API: Call multiple unofficial AI providers with a single, OpenAI-like interface.
  • Modular: Easily extend with new providers and capabilities.
  • Supports Text-to-Speech (TTS): Initial implementation includes OpenAI.fm reverse-engineered TTS.
  • OpenAI-Compatible: Accepts and returns data in the same format as OpenAI's official API.
  • Simple to Use: Designed for developers of all skill levels.

Installation

Install directly from PyPI:

pip install -U a4f-local

Usage Example

from a4f_local import A4F

client = A4F()

try:
    audio_bytes = client.audio.speech.create(
        model="tts-1",  # Model name (currently informational)
        input="Hello from a4f-local!",
        voice="alloy"   # Choose a supported voice
    )
    with open("output.mp3", "wb") as f:
        f.write(audio_bytes)
    print("Generated output.mp3")
except Exception as e:
    print(f"An error occurred: {e}")

Supported Voices

The following voice names are supported (mapped to OpenAI's official voices):

  • alloy
  • echo
  • fable
  • onyx
  • nova
  • shimmer

Use one of these as the voice parameter in your TTS requests.


How It Works

  • You interact with the A4F client just like OpenAI's Python SDK.
  • The client automatically discovers available providers and their capabilities.
  • When you call a method (e.g., client.audio.speech.create()), it routes the request to the appropriate provider.
  • The provider translates the OpenAI-compatible request into its own API format, calls the API, and translates the response back.

Roadmap

  • More Providers: Support for chat, image generation, and other AI capabilities.
  • Configuration: Easier ways to configure API keys and provider preferences.
  • Async Support: Async versions of API calls.
  • Better Error Handling: More informative error messages and exceptions.

License

See the LICENSE file for details. This software is not open source in the traditional sense. Please review the license terms carefully before use.


Disclaimer

This package uses reverse-engineered, unofficial APIs. These may break or change at any time. Use at your own risk.


More Information

More detailed documentation, tutorials, and examples will be published here and on PyPI.

For now, refer to the example above and the source code for guidance.


Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.113 Apr 20258

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
devs-do-code/a4f-local

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 16:42 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:e6f02d45e505c819b953a191ef7e26e881c0feab54fd9147524522c5c6d82090