wyoming-openai


Namewyoming-openai JSON
Version 0.3.7 PyPI version JSON
download
home_pageNone
SummaryOpenAI-Compatible Proxy Middleware for the Wyoming Protocol
upload_time2025-09-10 03:18:59
maintainerNone
docs_urlNone
authorRory Eckel
requires_python>=3.12
licenseNone
keywords proxy tts openai home-assistant stt asr wyoming
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Wyoming OpenAI

OpenAI-Compatible Proxy Middleware for the Wyoming Protocol

[![License](https://img.shields.io/github/license/roryeckel/wyoming-openai.svg)](https://github.com/roryeckel/wyoming-openai/blob/main/LICENSE) [![Python version](https://img.shields.io/pypi/pyversions/wyoming-openai.svg)](https://pypi.org/project/wyoming-openai/) [![GitHub issues](https://img.shields.io/github/issues/roryeckel/wyoming-openai.svg)](https://github.com/roryeckel/wyoming-openai/issues) [![Docker](https://img.shields.io/github/v/release/roryeckel/wyoming-openai?label=ghcr.io&logo=docker&logoColor=white&color=2496ED)](https://github.com/roryeckel/wyoming-openai/pkgs/container/wyoming_openai) [![PyPI version](https://badge.fury.io/py/wyoming-openai.svg)](https://pypi.org/project/wyoming-openai/)

**Author:** Rory Eckel

Note: This project is not affiliated with OpenAI or the Wyoming project.

## Overview

This project introduces a [Wyoming](https://github.com/OHF-Voice/wyoming) server that connects to OpenAI-compatible endpoints of your choice. Like a proxy, it enables Wyoming clients such as the [Home Assistant Wyoming Integration](https://www.home-assistant.io/integrations/wyoming/) to use the transcription (Automatic Speech Recognition - ASR) and text-to-speech synthesis (TTS) capabilities of various OpenAI-compatible projects. By acting as a bridge between the Wyoming protocol and OpenAI, you can consolidate the resource usage on your server and extend the capabilities of Home Assistant. The proxy now provides incremental TTS streaming compatibility by intelligently chunking text at sentence boundaries for responsive audio delivery.

## Featured Models

This project features a variety of examples for using cutting-edge models in both Speech-to-Text (STT) and Text-to-Speech (TTS) scenarios:

- **`gpt-4o-transcribe`**: OpenAI's latest and most advanced model for highly accurate speech recognition.
- **`gpt-4o-mini-tts`**: A compact and efficient text-to-speech model from OpenAI, perfect for responsive vocalization.
- **`kokoro`**: A high-quality, open-source text-to-speech model, available for local deployment via [Speaches](#2-deploying-with-speaches-local-service) and [Kokoro-FastAPI](#4-deploying-with-kokoro-fastapi-and-speaches-local-services).
- **`piper`**: Fast, local neural text-to-speech system with multiple high-quality voices, available for local deployment via [LocalAI](#3-deploying-with-localai-local-service).
- **`whisper`**: The original renowned open-source transcription model from OpenAI, widely used for its accuracy and versatility.
- **`Microsoft Edge TTS`**: High-quality neural voices from Microsoft's free cloud TTS API, no API key required, available via [OpenAI Edge TTS](#5-deploying-with-microsoft-openai-edge-tts).
## Objectives

1. **Wyoming Server, OpenAI-compatible Client**: Function as an intermediary between the Wyoming protocol and OpenAI's ASR and TTS services.
2. **Service Consolidation**: Allow users of various programs to run inference on a single server without needing separate instances for each service.
Example: Sharing TTS/STT services between [Open WebUI](#open-webui) and [Home Assistant](#usage-in-home-assistant).
3. **Asynchronous Processing**: Enable efficient handling of multiple requests by supporting asynchronous processing of audio streams.
4. **Streaming Compatibility**: Bridge Wyoming's streaming TTS protocol with OpenAI-compatible APIs through intelligent sentence boundary chunking, enabling responsive incremental audio delivery even when the underlying API doesn't support streaming text input.
5. **Simple Setup with Docker**: Provide a straightforward deployment process using [Docker and Docker Compose](#docker-recommended) for OpenAI and various popular open source projects.

## Terminology

- **TTS (Text-to-Speech)**: The process of converting text into audible speech output.
- **ASR (Automatic Speech Recognition) / STT (Speech-to-Text)**: Technologies that convert spoken language into written text. ASR and STT are often used interchangeably to describe this function.

## Installation (Local Development)

### Prerequisites

- Tested with Python 3.12
- Optional: OpenAI API key(s) if using proprietary models

### Instructions

1. **Clone the Repository**

   ```bash
   git clone https://github.com/roryeckel/wyoming-openai.git
   cd wyoming-openai
   ```

2. **Create a Virtual Environment** (optional but recommended)

   ```bash
   python3 -m venv venv
   source venv/bin/activate  # On Windows use `venv\Scripts\activate`
   ```

3. **Install as a Development Package**

    ```bash
    pip install -e .
    ```
    Assuming you have activated a virtual environment, the wyoming_openai package will be installed into it. This will build and install the package in editable mode, allowing you to make changes to the code without needing to reinstall it each time.

    Or, if you prefer to install it as a regular (production) package:

    ```bash
    pip install .
    ```

    This is more suitable for a global installation.

4. **Configure Environment Variables or Command Line Arguments**

## Installation from PyPI [![Publish to PyPI](https://github.com/roryeckel/wyoming-openai/actions/workflows/publish-to-pypi.yml/badge.svg)](https://github.com/roryeckel/wyoming-openai/actions/workflows/publish-to-pypi.yml)

Since v0.3.2, `wyoming-openai` is now available on [PyPI](https://pypi.org/project/wyoming-openai/). To install the latest release, run:

```bash
pip install wyoming-openai
```

This is useful for local deployment when you don't want to clone the repository or if you want to use the library components in your own projects.

To upgrade to the latest version, run:

```bash
pip install --upgrade wyoming-openai
```

## Command Line Arguments

The proxy server can be configured using several command line arguments to tailor its behavior to your specific needs.

### Example Usage

Assuming you have installed the package in your current environment, you can run the server with the following command:

```bash
python -m wyoming_openai \
  --uri tcp://0.0.0.0:10300 \
  --log-level INFO \
  --languages en \
  --stt-openai-key YOUR_STT_API_KEY_HERE \
  --stt-openai-url https://api.openai.com/v1 \
  --stt-models whisper-1 \
  --stt-streaming-models gpt-4o-transcribe gpt-4o-mini-transcribe \
  --stt-backend OPENAI \
  --tts-openai-key YOUR_TTS_API_KEY_HERE \
  --tts-openai-url https://api.openai.com/v1 \
  --tts-models gpt-4o-mini-tts tts-1-hd tts-1 \
  --tts-streaming-models tts-1 \
  --tts-voices alloy ash coral echo fable onyx nova sage shimmer \
  --tts-backend OPENAI \
  --tts-speed 1.0
```

## Configuration Options

In addition to using command-line arguments, you can configure the Wyoming OpenAI proxy server via environment variables. This is especially useful for containerized deployments.

### Table of Environment & Command Line Options

| **Command Line Argument**               | **Environment Variable**                   | **Default Value**                           | **Description**                                                      |
|-----------------------------------------|--------------------------------------------|-----------------------------------------------|----------------------------------------------------------------------|
| `--uri`                                 | `WYOMING_URI`                              | tcp://0.0.0.0:10300                           | The URI for the Wyoming server to bind to.                           |
| `--log-level`                           | `WYOMING_LOG_LEVEL`                        | INFO                                          | Sets the logging level (e.g., INFO, DEBUG).                          |
| `--languages`                           | `WYOMING_LANGUAGES`                        | en                                            | Space-separated list of supported languages to advertise.            |
| `--stt-openai-key`                      | `STT_OPENAI_KEY`                           | None                                          | Optional API key for OpenAI-compatible speech-to-text services.      |
| `--stt-openai-url`                      | `STT_OPENAI_URL`                           | https://api.openai.com/v1                     | The base URL for the OpenAI-compatible speech-to-text API            |
| `--stt-models`                          | `STT_MODELS`                               | None (required*)                                          | Space-separated list of models to use for the STT service. Example: `gpt-4o-transcribe gpt-4o-mini-transcribe whisper-1` |
| `--stt-streaming-models`                | `STT_STREAMING_MODELS`                     | None                                          | Space-separated list of STT models that support streaming (e.g. `gpt-4o-transcribe gpt-4o-mini-transcribe`). Only these models will use streaming mode. |
| `--stt-backend`                         | `STT_BACKEND`                              | None (autodetected)                           | Enable unofficial API feature sets.          |
| `--stt-temperature`                     | `STT_TEMPERATURE`                          | None (autodetected)                           | Sampling temperature for speech-to-text (ranges from 0.0 to 1.0)               |
| `--stt-prompt`                          | `STT_PROMPT`                               | None                                          | Optional prompt for STT requests (Text to guide the model's style).   |
| `--tts-openai-key`                      | `TTS_OPENAI_KEY`                           | None                                          | Optional API key for OpenAI-compatible text-to-speech services.      |
| `--tts-openai-url`                      | `TTS_OPENAI_URL`                           | https://api.openai.com/v1                     | The base URL for the OpenAI-compatible text-to-speech API            |
| `--tts-models`                          | `TTS_MODELS`                               | None (required*)                           | Space-separated list of models to use for the TTS service. Example: `gpt-4o-mini-tts tts-1-hd tts-1` |
| `--tts-voices`                          | `TTS_VOICES`                               | Empty (autodetected)                          | Space-separated list of voices for TTS.        |
| `--tts-backend`                         | `TTS_BACKEND`                              | None (autodetected)                           | Enable unofficial API feature sets.          |
| `--tts-speed`                           | `TTS_SPEED`                                | None (autodetected)                           | Speed of the TTS output (ranges from 0.25 to 4.0).               |
| `--tts-instructions`                    | `TTS_INSTRUCTIONS`                         | None                                          | Optional instructions for TTS requests (Control the voice).    |
| `--tts-streaming-models`                | `TTS_STREAMING_MODELS`                     | None                                          | Space-separated list of TTS models to enable incremental streaming via pysbd text chunking (e.g. `tts-1`). |
| `--tts-streaming-min-words`             | `TTS_STREAMING_MIN_WORDS`                  | None                                          | Minimum words per text chunk for incremental TTS streaming (optional). |
| `--tts-streaming-max-chars`             | `TTS_STREAMING_MAX_CHARS`                  | None                                          | Maximum characters per text chunk for incremental TTS streaming (optional). |

## Docker (Recommended) [![Docker Image CI](https://github.com/roryeckel/wyoming-openai/actions/workflows/docker-image.yml/badge.svg)](https://github.com/roryeckel/wyoming-openai/actions/workflows/docker-image.yml)

### Prerequisites

- Ensure you have [Docker](https://www.docker.com/products/docker-desktop) and [Docker Compose](https://docs.docker.com/compose/install/) installed on your system.

### Deployment Options

You can deploy the Wyoming OpenAI proxy server in different environments depending on whether you are using official OpenAI services or a local alternative like Speaches. You can even run multiple wyoming_openai instances on different ports for different purposes. Below are example scenarios:

#### 1. Deploying with Official OpenAI Services

To set up the Wyoming OpenAI proxy to work with official OpenAI APIs, follow these steps:

- **Environment Variables**: Create a `.env` file in your project directory that includes necessary environment variables such as `STT_OPENAI_KEY`, `TTS_OPENAI_KEY`.

- **Docker Compose Configuration**: Use the provided `docker-compose.yml` template. This setup binds a Wyoming server to port 10300 and uses environment variables for OpenAI URLs, model configurations, and voices as specified in the compose file.

- **Command**:
  
  ```bash
  docker compose -f docker-compose.yml up -d
  ```

#### 2. Deploying with Speaches Local Service

If you prefer using a local service like Speaches instead of official OpenAI services, follow these instructions:

- **Docker Compose Configuration**: Use the `docker-compose.speaches.yml` template which includes configuration for both the Wyoming OpenAI proxy and the Speaches service.

- **Speaches Setup**:
  - The Speaches container is configured with specific model settings (`Systran/faster-distil-whisper-large-v3` for STT and `speaches-ai/Kokoro-82M-v1.0-ONNX` for TTS).
  - It uses a local port (8000) to expose the Speaches service.
  - NVIDIA GPU support is enabled, so ensure your system has an appropriate setup if you plan to utilize GPU resources.
  - Note: wyoming_openai disables Speaches VAD (Voice Activity Detection) by default, as it is not yet compatible with the Wyoming protocol.
  - [Learn more about Speaches](https://speaches.ai/)

- **Command**:
  
  ```bash
  docker compose -f docker-compose.speaches.yml up -d
  ```

#### 3. Deploying with LocalAI Local Service

LocalAI is a drop-in replacement for OpenAI API that runs completely locally, supporting both Whisper (STT) and Piper (TTS). This setup provides excellent privacy and performance without requiring external API keys.

- **LocalAI Setup**:
  - The provided example compose uses LocalAI's GPU-accelerated image with NVIDIA CUDA 12 support, but you can adjust things as needed.
  - Automatically downloads `whisper-base` model and multiple Piper TTS voices on first run
  - Provides OpenAI-compatible endpoints for seamless integration
  - No API keys required since everything runs locally
  - Includes automatic model initialization via dedicated init container
  - [Learn more about LocalAI](https://localai.io/)

- **Docker Compose Configuration**: Use the `docker-compose.localai.yml` template which includes configuration for both the Wyoming OpenAI proxy and LocalAI service.

- **Command**:

  ```bash
  docker compose -f docker-compose.localai.yml up -d
  ```

#### 4. Deploying with Kokoro-FastAPI and Speaches Local Services

For users preferring a setup that leverages Kokoro-FastAPI for TTS and Speaches for STT, follow these instructions:

- **Docker Compose Configuration**: Use the `docker-compose.kokoro-fastapi.yml` template which includes configuration for both the Wyoming OpenAI proxy and Kokoro-FastAPI TTS service (Kokoro).

- **Speaches Setup**:
  - Use it in combination with the Speaches container for access to STT.

- **Kokoro Setup**:
  - The Kokoro-FastAPI container provides TTS capabilities.
  - It uses a local port (8880) to expose the Kokoro service.
  - NVIDIA GPU support is enabled, so ensure your system has an appropriate setup if you plan to utilize GPU resources.
  - [Learn more about Kokoro-FastAPI](https://github.com/remsky/Kokoro-FastAPI)

- **Command**:

  ```bash
  docker compose -f docker-compose.speaches.yml -f docker-compose.kokoro-fastapi.yml up -d
  ```

#### 5. Deploying with Microsoft OpenAI Edge TTS

For users who want high-quality text-to-speech without API costs, Microsoft Edge TTS provides excellent neural voices through a free cloud service. This setup requires no API keys and offers a wide variety of natural-sounding voices.

- **OpenAI Edge TTS Setup**:
  - Uses Microsoft's free cloud TTS service (no API key required)
  - Provides access to high-quality neural voices across multiple languages
  - The OpenAI Edge TTS container runs locally and proxies requests to Microsoft's service
  - Includes 17 English (US) voices by default, with support for many more languages
  - OpenAI-compatible API endpoints for seamless integration
  - [Learn more about the OpenAI-Compatible Edge-TTS API](https://github.com/travisvn/openai-edge-tts)

- **Docker Compose Configuration**: Use the `docker-compose.openai-edge-tts.yml` template which includes configuration for both the Wyoming OpenAI proxy and OpenAI Edge TTS service.

- **Command**:
  
  ```bash
  docker compose -f docker-compose.openai-edge-tts.yml up -d
  ```

#### 6. Development with Docker

If you are developing the Wyoming OpenAI proxy server and want to build it from source, use the `docker-compose.dev.yml` file along with the base configuration.

- **Command**:
  
  ```bash
  docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d --build
  ```

#### 7. Example: Development with Additional Local Service

For a development setup using the Speaches local service, combine `docker-compose.speaches.yml` and `docker-compose.dev.yml`. This also works for `docker-compose.kokoro-fastapi.yml`, `docker-compose.localai.yml`, and `docker-compose.openai-edge-tts.yml`.

- **Command**:
  
  ```bash
  docker compose -f docker-compose.speaches.yml -f docker-compose.dev.yml up -d --build
  ```

#### 8. Docker Tags

We follow specific tagging conventions for our Docker images. These tags help in identifying the version and branch of the code that a particular Docker image is based on.

- **`latest`**: This tag always points to the latest stable release of the Wyoming OpenAI proxy server. It is recommended for users who want to run the most recent, well-tested version without worrying about specific versions.

- **`main`**: This tag points to the latest commit on the main code branch. It is suitable for users who want to experiment with the most up-to-date features and changes, but may include unstable or experimental code.

- **`major.minor.patch version`**: Specific version tags (e.g., `0.3.7`) correspond to specific stable releases of the Wyoming OpenAI proxy server. These tags are ideal for users who need a consistent, reproducible environment and want to avoid breaking changes introduced in newer versions.

- **`major.minor version`**: Tags that follow the `major.minor` format (e.g., `0.3`) represent a range of patch-level updates within the same minor version series. These tags are useful for users who want to stay updated with bug fixes and minor improvements without upgrading to a new major or minor version.

- **`pr-{number}`**: Pull request tags (e.g., `pr-123`) are automatically created for each pull request to allow testing of proposed changes before they are merged. These tags are automatically cleaned up when the pull request is closed or merged.

#### 9. Pull Request Docker Images

For contributors and maintainers who want to test changes from pull requests before they are merged, we automatically build and push Docker images for each pull request.

**How it works:**
- When a pull request is opened or updated, a Docker image is automatically built and pushed with the tag `pr-{pr_number}`
- Only pull requests from the main repository (not forks) will trigger image builds for security reasons
- When a pull request is closed or merged, the corresponding Docker image is automatically deleted to save storage space

**Using PR images:**
```bash
# Example: Test PR #123
docker run --rm -p 10300:10300 ghcr.io/roryeckel/wyoming_openai:pr-123

# Or with docker-compose, update your docker-compose.yml:
# image: ghcr.io/roryeckel/wyoming_openai:pr-123
```

**For contributors:**
- PR images are built automatically - no action needed
- Images are available within minutes of opening/updating a PR
- Check the Actions tab to see build status
- Images are automatically cleaned up when the PR is closed

### General Deployment Steps

1. **Start Services**: Run the appropriate Docker Compose command based on your deployment option.
2. **Verify Deployment**: Ensure that all services are running by checking the logs with `docker compose logs -f` or accessing the Wyoming OpenAI proxy through its exposed port (e.g., 10300) to ensure it responds as expected.
3. **Configuration Changes**: You can modify environment variables in the `.env` file or directly within your Docker Compose configuration files to adjust settings such as languages, models, and voices without rebuilding containers.

## Usage in Home Assistant

1. Install & set up your Wyoming OpenAI instance using one of the [deployment options](#deployment-options) above.
2. In HA, Go to Settings, Devices & Services, Add Integration, and search for Wyoming Protocol. Add the Wyoming Protocol integration with the URI of your Wyoming OpenAI instance.
3. The hard part is over! Configure your Voice Assistant pipeline to use the STT/TTS services provided by your new Wyoming OpenAI instance.

#### Reloading Configuration Changes in Home Assistant

When you make changes to your configuration such as updating models, voices, or URLs, it's important to reload the Wyoming OpenAI integration in Home Assistant to apply these changes. Here's how to do it:

1. Go to **Settings** > **Devices & Services**
2. Find and select your **Wyoming OpenAI** integration
3. Click on **Reload**

### Sequence Diagrams

#### Home Assistant

Home Assistant uses the Wyoming Protocol integration to communicate with the Wyoming OpenAI proxy server. The proxy server then communicates with the OpenAI API to perform the requested ASR or TTS tasks. The results are then sent back to Home Assistant.

```mermaid
sequenceDiagram
  participant HA as Home Assistant
  participant WY as wyoming_openai Proxy
  participant OAPI as OpenAI-Compatible API
  
  Note over HA,OAPI: **Speech-to-Text (STT/ASR) Flow**
  HA->>WY: Transcribe event (initiate transcription)
  HA->>WY: AudioStart event (begin sending audio)
  loop While capturing microphone audio
    HA->>WY: AudioChunk events (WAV data)
    Note over WY: Accumulates/buffers WAV PCM chunks
  end
  HA->>WY: AudioStop event (end of input)
  
  alt Non-Streaming Transcription
    WY->>OAPI: Upload complete audio file
    OAPI-->>WY: Full text transcript
    WY->>HA: TranscriptStart event
    WY->>HA: Transcript event (full text result)
    WY->>HA: TranscriptStop event
  else Streaming Transcription
    WY->>OAPI: Send audio with `stream=true`
    WY->>HA: TranscriptStart event
    loop As partial results are returned
      OAPI-->>WY: Transcript delta (partial text)
      WY-->>HA: TranscriptChunk event
    end
    WY->>HA: Transcript event (final text)
    WY->>HA: TranscriptStop event
  end
  
  Note over HA,OAPI: **Text-to-Speech (TTS) Flow**
  
  alt Non-Streaming TTS (Synthesize)
    HA->>WY: Synthesize event (text + voice)
    WY->>OAPI: Speech synthesis request
    WY->>HA: AudioStart event
    loop While receiving audio data
      OAPI-->>WY: Audio stream chunks
      WY-->>HA: AudioChunk events
    end
    WY->>HA: AudioStop event
  else Streaming TTS (SynthesizeStart/Chunk/Stop)
    HA->>WY: SynthesizeStart event (voice config)
    Note over WY: Initialize incremental synthesis<br/>with sentence boundary detection
    WY->>HA: AudioStart event
    loop Sending text chunks
      HA->>WY: SynthesizeChunk events
      Note over WY: Accumulate text and detect<br/>complete sentences using pysbd
      alt Complete sentences detected
        loop For each complete sentence
          WY->>OAPI: Speech synthesis request
          loop While receiving audio data
            OAPI-->>WY: Audio stream chunks
            WY-->>HA: AudioChunk events (incremental)
          end
        end
      end
    end
    HA->>WY: SynthesizeStop event
    Note over WY: Process any remaining text<br/>and finalize synthesis
    WY->>HA: AudioStop event
    WY->>HA: SynthesizeStopped event
  end
```

#### Open WebUI

No proxy is needed for Open WebUI, because it has native support for OpenAI-compatible endpoints.

```mermaid
sequenceDiagram
    participant OW as Open WebUI
    participant OAPI as OpenAI API

    Note over OW,OAPI: Speech-to-Text (STT/ASR) Flow
    OW->>OAPI: Direct audio transcription request
    OAPI-->>OW: Text transcript response
    
    Note over OW,OAPI: Text-to-Speech (TTS) Flow
    OW->>OAPI: Direct speech synthesis request
    OAPI-->>OW: Audio stream response
    
```

## Future Plans (Descending Priority)

- Improved streaming support directly to OpenAI APIs
- Reverse direction support (Server for OpenAI compatible endpoints - possibly FastAPI)
- OpenAI Realtime API

## Contributing

Contributions are welcome! Please feel free to open issues or submit pull requests. For major changes, please first discuss the proposed changes in an issue.

## Quality Assurance

### Linting (Ruff) [![Lint](https://github.com/roryeckel/wyoming-openai/actions/workflows/lint.yml/badge.svg)](https://github.com/roryeckel/wyoming-openai/actions/workflows/lint.yml)

This project uses [Ruff](https://github.com/astral-sh/ruff) for linting and code quality checks. Ruff is a fast Python linter written in Rust that can replace multiple tools like flake8, isort, and more.

To use Ruff during development:

1. Install development dependencies:
   ```bash
   pip install -e ".[dev]"
   ```

2. Run Ruff to check your code:
   ```bash
   ruff check .
   ```

A GitHub Action automatically runs Ruff on all pull requests and branch pushes to ensure code quality.

### Testing (Pytest) [![Test](https://github.com/roryeckel/wyoming-openai/actions/workflows/test.yml/badge.svg)](https://github.com/roryeckel/wyoming-openai/actions/workflows/test.yml)

This project uses [pytest](https://pytest.org/) for unit testing. Tests are located in the [`tests/`](tests/) directory and cover core modules such as compatibility, constants, handlers, initialization, and utilities.

#### Running Tests

1. Install development dependencies:
   ```bash
   pip install -e ".[dev]"
   ```

2. In the [`tests/`](tests/) folder, run all tests with:
   ```bash
   pytest
   ```

3. Check the test coverage with:
   ```bash
   pytest --cov=wyoming_openai
   ```

All new code should include appropriate tests.
A GitHub Action automatically runs pytest on all pull requests and branch pushes to ensure tests pass.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "wyoming-openai",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": null,
    "keywords": "proxy, tts, openai, home-assistant, stt, asr, wyoming",
    "author": "Rory Eckel",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/0b/97/89a30b159381fe76d31a95d43ed613438613398e4a91c4dbf44032b4616b/wyoming_openai-0.3.7.tar.gz",
    "platform": null,
    "description": "# Wyoming OpenAI\n\nOpenAI-Compatible Proxy Middleware for the Wyoming Protocol\n\n[![License](https://img.shields.io/github/license/roryeckel/wyoming-openai.svg)](https://github.com/roryeckel/wyoming-openai/blob/main/LICENSE) [![Python version](https://img.shields.io/pypi/pyversions/wyoming-openai.svg)](https://pypi.org/project/wyoming-openai/) [![GitHub issues](https://img.shields.io/github/issues/roryeckel/wyoming-openai.svg)](https://github.com/roryeckel/wyoming-openai/issues) [![Docker](https://img.shields.io/github/v/release/roryeckel/wyoming-openai?label=ghcr.io&logo=docker&logoColor=white&color=2496ED)](https://github.com/roryeckel/wyoming-openai/pkgs/container/wyoming_openai) [![PyPI version](https://badge.fury.io/py/wyoming-openai.svg)](https://pypi.org/project/wyoming-openai/)\n\n**Author:** Rory Eckel\n\nNote: This project is not affiliated with OpenAI or the Wyoming project.\n\n## Overview\n\nThis project introduces a [Wyoming](https://github.com/OHF-Voice/wyoming) server that connects to OpenAI-compatible endpoints of your choice. Like a proxy, it enables Wyoming clients such as the [Home Assistant Wyoming Integration](https://www.home-assistant.io/integrations/wyoming/) to use the transcription (Automatic Speech Recognition - ASR) and text-to-speech synthesis (TTS) capabilities of various OpenAI-compatible projects. By acting as a bridge between the Wyoming protocol and OpenAI, you can consolidate the resource usage on your server and extend the capabilities of Home Assistant. The proxy now provides incremental TTS streaming compatibility by intelligently chunking text at sentence boundaries for responsive audio delivery.\n\n## Featured Models\n\nThis project features a variety of examples for using cutting-edge models in both Speech-to-Text (STT) and Text-to-Speech (TTS) scenarios:\n\n- **`gpt-4o-transcribe`**: OpenAI's latest and most advanced model for highly accurate speech recognition.\n- **`gpt-4o-mini-tts`**: A compact and efficient text-to-speech model from OpenAI, perfect for responsive vocalization.\n- **`kokoro`**: A high-quality, open-source text-to-speech model, available for local deployment via [Speaches](#2-deploying-with-speaches-local-service) and [Kokoro-FastAPI](#4-deploying-with-kokoro-fastapi-and-speaches-local-services).\n- **`piper`**: Fast, local neural text-to-speech system with multiple high-quality voices, available for local deployment via [LocalAI](#3-deploying-with-localai-local-service).\n- **`whisper`**: The original renowned open-source transcription model from OpenAI, widely used for its accuracy and versatility.\n- **`Microsoft Edge TTS`**: High-quality neural voices from Microsoft's free cloud TTS API, no API key required, available via [OpenAI Edge TTS](#5-deploying-with-microsoft-openai-edge-tts).\n## Objectives\n\n1. **Wyoming Server, OpenAI-compatible Client**: Function as an intermediary between the Wyoming protocol and OpenAI's ASR and TTS services.\n2. **Service Consolidation**: Allow users of various programs to run inference on a single server without needing separate instances for each service.\nExample: Sharing TTS/STT services between [Open WebUI](#open-webui) and [Home Assistant](#usage-in-home-assistant).\n3. **Asynchronous Processing**: Enable efficient handling of multiple requests by supporting asynchronous processing of audio streams.\n4. **Streaming Compatibility**: Bridge Wyoming's streaming TTS protocol with OpenAI-compatible APIs through intelligent sentence boundary chunking, enabling responsive incremental audio delivery even when the underlying API doesn't support streaming text input.\n5. **Simple Setup with Docker**: Provide a straightforward deployment process using [Docker and Docker Compose](#docker-recommended) for OpenAI and various popular open source projects.\n\n## Terminology\n\n- **TTS (Text-to-Speech)**: The process of converting text into audible speech output.\n- **ASR (Automatic Speech Recognition) / STT (Speech-to-Text)**: Technologies that convert spoken language into written text. ASR and STT are often used interchangeably to describe this function.\n\n## Installation (Local Development)\n\n### Prerequisites\n\n- Tested with Python 3.12\n- Optional: OpenAI API key(s) if using proprietary models\n\n### Instructions\n\n1. **Clone the Repository**\n\n   ```bash\n   git clone https://github.com/roryeckel/wyoming-openai.git\n   cd wyoming-openai\n   ```\n\n2. **Create a Virtual Environment** (optional but recommended)\n\n   ```bash\n   python3 -m venv venv\n   source venv/bin/activate  # On Windows use `venv\\Scripts\\activate`\n   ```\n\n3. **Install as a Development Package**\n\n    ```bash\n    pip install -e .\n    ```\n    Assuming you have activated a virtual environment, the wyoming_openai package will be installed into it. This will build and install the package in editable mode, allowing you to make changes to the code without needing to reinstall it each time.\n\n    Or, if you prefer to install it as a regular (production) package:\n\n    ```bash\n    pip install .\n    ```\n\n    This is more suitable for a global installation.\n\n4. **Configure Environment Variables or Command Line Arguments**\n\n## Installation from PyPI [![Publish to PyPI](https://github.com/roryeckel/wyoming-openai/actions/workflows/publish-to-pypi.yml/badge.svg)](https://github.com/roryeckel/wyoming-openai/actions/workflows/publish-to-pypi.yml)\n\nSince v0.3.2, `wyoming-openai` is now available on [PyPI](https://pypi.org/project/wyoming-openai/). To install the latest release, run:\n\n```bash\npip install wyoming-openai\n```\n\nThis is useful for local deployment when you don't want to clone the repository or if you want to use the library components in your own projects.\n\nTo upgrade to the latest version, run:\n\n```bash\npip install --upgrade wyoming-openai\n```\n\n## Command Line Arguments\n\nThe proxy server can be configured using several command line arguments to tailor its behavior to your specific needs.\n\n### Example Usage\n\nAssuming you have installed the package in your current environment, you can run the server with the following command:\n\n```bash\npython -m wyoming_openai \\\n  --uri tcp://0.0.0.0:10300 \\\n  --log-level INFO \\\n  --languages en \\\n  --stt-openai-key YOUR_STT_API_KEY_HERE \\\n  --stt-openai-url https://api.openai.com/v1 \\\n  --stt-models whisper-1 \\\n  --stt-streaming-models gpt-4o-transcribe gpt-4o-mini-transcribe \\\n  --stt-backend OPENAI \\\n  --tts-openai-key YOUR_TTS_API_KEY_HERE \\\n  --tts-openai-url https://api.openai.com/v1 \\\n  --tts-models gpt-4o-mini-tts tts-1-hd tts-1 \\\n  --tts-streaming-models tts-1 \\\n  --tts-voices alloy ash coral echo fable onyx nova sage shimmer \\\n  --tts-backend OPENAI \\\n  --tts-speed 1.0\n```\n\n## Configuration Options\n\nIn addition to using command-line arguments, you can configure the Wyoming OpenAI proxy server via environment variables. This is especially useful for containerized deployments.\n\n### Table of Environment & Command Line Options\n\n| **Command Line Argument**               | **Environment Variable**                   | **Default Value**                           | **Description**                                                      |\n|-----------------------------------------|--------------------------------------------|-----------------------------------------------|----------------------------------------------------------------------|\n| `--uri`                                 | `WYOMING_URI`                              | tcp://0.0.0.0:10300                           | The URI for the Wyoming server to bind to.                           |\n| `--log-level`                           | `WYOMING_LOG_LEVEL`                        | INFO                                          | Sets the logging level (e.g., INFO, DEBUG).                          |\n| `--languages`                           | `WYOMING_LANGUAGES`                        | en                                            | Space-separated list of supported languages to advertise.            |\n| `--stt-openai-key`                      | `STT_OPENAI_KEY`                           | None                                          | Optional API key for OpenAI-compatible speech-to-text services.      |\n| `--stt-openai-url`                      | `STT_OPENAI_URL`                           | https://api.openai.com/v1                     | The base URL for the OpenAI-compatible speech-to-text API            |\n| `--stt-models`                          | `STT_MODELS`                               | None (required*)                                          | Space-separated list of models to use for the STT service. Example: `gpt-4o-transcribe gpt-4o-mini-transcribe whisper-1` |\n| `--stt-streaming-models`                | `STT_STREAMING_MODELS`                     | None                                          | Space-separated list of STT models that support streaming (e.g. `gpt-4o-transcribe gpt-4o-mini-transcribe`). Only these models will use streaming mode. |\n| `--stt-backend`                         | `STT_BACKEND`                              | None (autodetected)                           | Enable unofficial API feature sets.          |\n| `--stt-temperature`                     | `STT_TEMPERATURE`                          | None (autodetected)                           | Sampling temperature for speech-to-text (ranges from 0.0 to 1.0)               |\n| `--stt-prompt`                          | `STT_PROMPT`                               | None                                          | Optional prompt for STT requests (Text to guide the model's style).   |\n| `--tts-openai-key`                      | `TTS_OPENAI_KEY`                           | None                                          | Optional API key for OpenAI-compatible text-to-speech services.      |\n| `--tts-openai-url`                      | `TTS_OPENAI_URL`                           | https://api.openai.com/v1                     | The base URL for the OpenAI-compatible text-to-speech API            |\n| `--tts-models`                          | `TTS_MODELS`                               | None (required*)                           | Space-separated list of models to use for the TTS service. Example: `gpt-4o-mini-tts tts-1-hd tts-1` |\n| `--tts-voices`                          | `TTS_VOICES`                               | Empty (autodetected)                          | Space-separated list of voices for TTS.        |\n| `--tts-backend`                         | `TTS_BACKEND`                              | None (autodetected)                           | Enable unofficial API feature sets.          |\n| `--tts-speed`                           | `TTS_SPEED`                                | None (autodetected)                           | Speed of the TTS output (ranges from 0.25 to 4.0).               |\n| `--tts-instructions`                    | `TTS_INSTRUCTIONS`                         | None                                          | Optional instructions for TTS requests (Control the voice).    |\n| `--tts-streaming-models`                | `TTS_STREAMING_MODELS`                     | None                                          | Space-separated list of TTS models to enable incremental streaming via pysbd text chunking (e.g. `tts-1`). |\n| `--tts-streaming-min-words`             | `TTS_STREAMING_MIN_WORDS`                  | None                                          | Minimum words per text chunk for incremental TTS streaming (optional). |\n| `--tts-streaming-max-chars`             | `TTS_STREAMING_MAX_CHARS`                  | None                                          | Maximum characters per text chunk for incremental TTS streaming (optional). |\n\n## Docker (Recommended) [![Docker Image CI](https://github.com/roryeckel/wyoming-openai/actions/workflows/docker-image.yml/badge.svg)](https://github.com/roryeckel/wyoming-openai/actions/workflows/docker-image.yml)\n\n### Prerequisites\n\n- Ensure you have [Docker](https://www.docker.com/products/docker-desktop) and [Docker Compose](https://docs.docker.com/compose/install/) installed on your system.\n\n### Deployment Options\n\nYou can deploy the Wyoming OpenAI proxy server in different environments depending on whether you are using official OpenAI services or a local alternative like Speaches. You can even run multiple wyoming_openai instances on different ports for different purposes. Below are example scenarios:\n\n#### 1. Deploying with Official OpenAI Services\n\nTo set up the Wyoming OpenAI proxy to work with official OpenAI APIs, follow these steps:\n\n- **Environment Variables**: Create a `.env` file in your project directory that includes necessary environment variables such as `STT_OPENAI_KEY`, `TTS_OPENAI_KEY`.\n\n- **Docker Compose Configuration**: Use the provided `docker-compose.yml` template. This setup binds a Wyoming server to port 10300 and uses environment variables for OpenAI URLs, model configurations, and voices as specified in the compose file.\n\n- **Command**:\n  \n  ```bash\n  docker compose -f docker-compose.yml up -d\n  ```\n\n#### 2. Deploying with Speaches Local Service\n\nIf you prefer using a local service like Speaches instead of official OpenAI services, follow these instructions:\n\n- **Docker Compose Configuration**: Use the `docker-compose.speaches.yml` template which includes configuration for both the Wyoming OpenAI proxy and the Speaches service.\n\n- **Speaches Setup**:\n  - The Speaches container is configured with specific model settings (`Systran/faster-distil-whisper-large-v3` for STT and `speaches-ai/Kokoro-82M-v1.0-ONNX` for TTS).\n  - It uses a local port (8000) to expose the Speaches service.\n  - NVIDIA GPU support is enabled, so ensure your system has an appropriate setup if you plan to utilize GPU resources.\n  - Note: wyoming_openai disables Speaches VAD (Voice Activity Detection) by default, as it is not yet compatible with the Wyoming protocol.\n  - [Learn more about Speaches](https://speaches.ai/)\n\n- **Command**:\n  \n  ```bash\n  docker compose -f docker-compose.speaches.yml up -d\n  ```\n\n#### 3. Deploying with LocalAI Local Service\n\nLocalAI is a drop-in replacement for OpenAI API that runs completely locally, supporting both Whisper (STT) and Piper (TTS). This setup provides excellent privacy and performance without requiring external API keys.\n\n- **LocalAI Setup**:\n  - The provided example compose uses LocalAI's GPU-accelerated image with NVIDIA CUDA 12 support, but you can adjust things as needed.\n  - Automatically downloads `whisper-base` model and multiple Piper TTS voices on first run\n  - Provides OpenAI-compatible endpoints for seamless integration\n  - No API keys required since everything runs locally\n  - Includes automatic model initialization via dedicated init container\n  - [Learn more about LocalAI](https://localai.io/)\n\n- **Docker Compose Configuration**: Use the `docker-compose.localai.yml` template which includes configuration for both the Wyoming OpenAI proxy and LocalAI service.\n\n- **Command**:\n\n  ```bash\n  docker compose -f docker-compose.localai.yml up -d\n  ```\n\n#### 4. Deploying with Kokoro-FastAPI and Speaches Local Services\n\nFor users preferring a setup that leverages Kokoro-FastAPI for TTS and Speaches for STT, follow these instructions:\n\n- **Docker Compose Configuration**: Use the `docker-compose.kokoro-fastapi.yml` template which includes configuration for both the Wyoming OpenAI proxy and Kokoro-FastAPI TTS service (Kokoro).\n\n- **Speaches Setup**:\n  - Use it in combination with the Speaches container for access to STT.\n\n- **Kokoro Setup**:\n  - The Kokoro-FastAPI container provides TTS capabilities.\n  - It uses a local port (8880) to expose the Kokoro service.\n  - NVIDIA GPU support is enabled, so ensure your system has an appropriate setup if you plan to utilize GPU resources.\n  - [Learn more about Kokoro-FastAPI](https://github.com/remsky/Kokoro-FastAPI)\n\n- **Command**:\n\n  ```bash\n  docker compose -f docker-compose.speaches.yml -f docker-compose.kokoro-fastapi.yml up -d\n  ```\n\n#### 5. Deploying with Microsoft OpenAI Edge TTS\n\nFor users who want high-quality text-to-speech without API costs, Microsoft Edge TTS provides excellent neural voices through a free cloud service. This setup requires no API keys and offers a wide variety of natural-sounding voices.\n\n- **OpenAI Edge TTS Setup**:\n  - Uses Microsoft's free cloud TTS service (no API key required)\n  - Provides access to high-quality neural voices across multiple languages\n  - The OpenAI Edge TTS container runs locally and proxies requests to Microsoft's service\n  - Includes 17 English (US) voices by default, with support for many more languages\n  - OpenAI-compatible API endpoints for seamless integration\n  - [Learn more about the OpenAI-Compatible Edge-TTS API](https://github.com/travisvn/openai-edge-tts)\n\n- **Docker Compose Configuration**: Use the `docker-compose.openai-edge-tts.yml` template which includes configuration for both the Wyoming OpenAI proxy and OpenAI Edge TTS service.\n\n- **Command**:\n  \n  ```bash\n  docker compose -f docker-compose.openai-edge-tts.yml up -d\n  ```\n\n#### 6. Development with Docker\n\nIf you are developing the Wyoming OpenAI proxy server and want to build it from source, use the `docker-compose.dev.yml` file along with the base configuration.\n\n- **Command**:\n  \n  ```bash\n  docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d --build\n  ```\n\n#### 7. Example: Development with Additional Local Service\n\nFor a development setup using the Speaches local service, combine `docker-compose.speaches.yml` and `docker-compose.dev.yml`. This also works for `docker-compose.kokoro-fastapi.yml`, `docker-compose.localai.yml`, and `docker-compose.openai-edge-tts.yml`.\n\n- **Command**:\n  \n  ```bash\n  docker compose -f docker-compose.speaches.yml -f docker-compose.dev.yml up -d --build\n  ```\n\n#### 8. Docker Tags\n\nWe follow specific tagging conventions for our Docker images. These tags help in identifying the version and branch of the code that a particular Docker image is based on.\n\n- **`latest`**: This tag always points to the latest stable release of the Wyoming OpenAI proxy server. It is recommended for users who want to run the most recent, well-tested version without worrying about specific versions.\n\n- **`main`**: This tag points to the latest commit on the main code branch. It is suitable for users who want to experiment with the most up-to-date features and changes, but may include unstable or experimental code.\n\n- **`major.minor.patch version`**: Specific version tags (e.g., `0.3.7`) correspond to specific stable releases of the Wyoming OpenAI proxy server. These tags are ideal for users who need a consistent, reproducible environment and want to avoid breaking changes introduced in newer versions.\n\n- **`major.minor version`**: Tags that follow the `major.minor` format (e.g., `0.3`) represent a range of patch-level updates within the same minor version series. These tags are useful for users who want to stay updated with bug fixes and minor improvements without upgrading to a new major or minor version.\n\n- **`pr-{number}`**: Pull request tags (e.g., `pr-123`) are automatically created for each pull request to allow testing of proposed changes before they are merged. These tags are automatically cleaned up when the pull request is closed or merged.\n\n#### 9. Pull Request Docker Images\n\nFor contributors and maintainers who want to test changes from pull requests before they are merged, we automatically build and push Docker images for each pull request.\n\n**How it works:**\n- When a pull request is opened or updated, a Docker image is automatically built and pushed with the tag `pr-{pr_number}`\n- Only pull requests from the main repository (not forks) will trigger image builds for security reasons\n- When a pull request is closed or merged, the corresponding Docker image is automatically deleted to save storage space\n\n**Using PR images:**\n```bash\n# Example: Test PR #123\ndocker run --rm -p 10300:10300 ghcr.io/roryeckel/wyoming_openai:pr-123\n\n# Or with docker-compose, update your docker-compose.yml:\n# image: ghcr.io/roryeckel/wyoming_openai:pr-123\n```\n\n**For contributors:**\n- PR images are built automatically - no action needed\n- Images are available within minutes of opening/updating a PR\n- Check the Actions tab to see build status\n- Images are automatically cleaned up when the PR is closed\n\n### General Deployment Steps\n\n1. **Start Services**: Run the appropriate Docker Compose command based on your deployment option.\n2. **Verify Deployment**: Ensure that all services are running by checking the logs with `docker compose logs -f` or accessing the Wyoming OpenAI proxy through its exposed port (e.g., 10300) to ensure it responds as expected.\n3. **Configuration Changes**: You can modify environment variables in the `.env` file or directly within your Docker Compose configuration files to adjust settings such as languages, models, and voices without rebuilding containers.\n\n## Usage in Home Assistant\n\n1. Install & set up your Wyoming OpenAI instance using one of the [deployment options](#deployment-options) above.\n2. In HA, Go to Settings, Devices & Services, Add Integration, and search for Wyoming Protocol. Add the Wyoming Protocol integration with the URI of your Wyoming OpenAI instance.\n3. The hard part is over! Configure your Voice Assistant pipeline to use the STT/TTS services provided by your new Wyoming OpenAI instance.\n\n#### Reloading Configuration Changes in Home Assistant\n\nWhen you make changes to your configuration such as updating models, voices, or URLs, it's important to reload the Wyoming OpenAI integration in Home Assistant to apply these changes. Here's how to do it:\n\n1. Go to **Settings** > **Devices & Services**\n2. Find and select your **Wyoming OpenAI** integration\n3. Click on **Reload**\n\n### Sequence Diagrams\n\n#### Home Assistant\n\nHome Assistant uses the Wyoming Protocol integration to communicate with the Wyoming OpenAI proxy server. The proxy server then communicates with the OpenAI API to perform the requested ASR or TTS tasks. The results are then sent back to Home Assistant.\n\n```mermaid\nsequenceDiagram\n  participant HA as Home Assistant\n  participant WY as wyoming_openai Proxy\n  participant OAPI as OpenAI-Compatible API\n  \n  Note over HA,OAPI: **Speech-to-Text (STT/ASR) Flow**\n  HA->>WY: Transcribe event (initiate transcription)\n  HA->>WY: AudioStart event (begin sending audio)\n  loop While capturing microphone audio\n    HA->>WY: AudioChunk events (WAV data)\n    Note over WY: Accumulates/buffers WAV PCM chunks\n  end\n  HA->>WY: AudioStop event (end of input)\n  \n  alt Non-Streaming Transcription\n    WY->>OAPI: Upload complete audio file\n    OAPI-->>WY: Full text transcript\n    WY->>HA: TranscriptStart event\n    WY->>HA: Transcript event (full text result)\n    WY->>HA: TranscriptStop event\n  else Streaming Transcription\n    WY->>OAPI: Send audio with `stream=true`\n    WY->>HA: TranscriptStart event\n    loop As partial results are returned\n      OAPI-->>WY: Transcript delta (partial text)\n      WY-->>HA: TranscriptChunk event\n    end\n    WY->>HA: Transcript event (final text)\n    WY->>HA: TranscriptStop event\n  end\n  \n  Note over HA,OAPI: **Text-to-Speech (TTS) Flow**\n  \n  alt Non-Streaming TTS (Synthesize)\n    HA->>WY: Synthesize event (text + voice)\n    WY->>OAPI: Speech synthesis request\n    WY->>HA: AudioStart event\n    loop While receiving audio data\n      OAPI-->>WY: Audio stream chunks\n      WY-->>HA: AudioChunk events\n    end\n    WY->>HA: AudioStop event\n  else Streaming TTS (SynthesizeStart/Chunk/Stop)\n    HA->>WY: SynthesizeStart event (voice config)\n    Note over WY: Initialize incremental synthesis<br/>with sentence boundary detection\n    WY->>HA: AudioStart event\n    loop Sending text chunks\n      HA->>WY: SynthesizeChunk events\n      Note over WY: Accumulate text and detect<br/>complete sentences using pysbd\n      alt Complete sentences detected\n        loop For each complete sentence\n          WY->>OAPI: Speech synthesis request\n          loop While receiving audio data\n            OAPI-->>WY: Audio stream chunks\n            WY-->>HA: AudioChunk events (incremental)\n          end\n        end\n      end\n    end\n    HA->>WY: SynthesizeStop event\n    Note over WY: Process any remaining text<br/>and finalize synthesis\n    WY->>HA: AudioStop event\n    WY->>HA: SynthesizeStopped event\n  end\n```\n\n#### Open WebUI\n\nNo proxy is needed for Open WebUI, because it has native support for OpenAI-compatible endpoints.\n\n```mermaid\nsequenceDiagram\n    participant OW as Open WebUI\n    participant OAPI as OpenAI API\n\n    Note over OW,OAPI: Speech-to-Text (STT/ASR) Flow\n    OW->>OAPI: Direct audio transcription request\n    OAPI-->>OW: Text transcript response\n    \n    Note over OW,OAPI: Text-to-Speech (TTS) Flow\n    OW->>OAPI: Direct speech synthesis request\n    OAPI-->>OW: Audio stream response\n    \n```\n\n## Future Plans (Descending Priority)\n\n- Improved streaming support directly to OpenAI APIs\n- Reverse direction support (Server for OpenAI compatible endpoints - possibly FastAPI)\n- OpenAI Realtime API\n\n## Contributing\n\nContributions are welcome! Please feel free to open issues or submit pull requests. For major changes, please first discuss the proposed changes in an issue.\n\n## Quality Assurance\n\n### Linting (Ruff) [![Lint](https://github.com/roryeckel/wyoming-openai/actions/workflows/lint.yml/badge.svg)](https://github.com/roryeckel/wyoming-openai/actions/workflows/lint.yml)\n\nThis project uses [Ruff](https://github.com/astral-sh/ruff) for linting and code quality checks. Ruff is a fast Python linter written in Rust that can replace multiple tools like flake8, isort, and more.\n\nTo use Ruff during development:\n\n1. Install development dependencies:\n   ```bash\n   pip install -e \".[dev]\"\n   ```\n\n2. Run Ruff to check your code:\n   ```bash\n   ruff check .\n   ```\n\nA GitHub Action automatically runs Ruff on all pull requests and branch pushes to ensure code quality.\n\n### Testing (Pytest) [![Test](https://github.com/roryeckel/wyoming-openai/actions/workflows/test.yml/badge.svg)](https://github.com/roryeckel/wyoming-openai/actions/workflows/test.yml)\n\nThis project uses [pytest](https://pytest.org/) for unit testing. Tests are located in the [`tests/`](tests/) directory and cover core modules such as compatibility, constants, handlers, initialization, and utilities.\n\n#### Running Tests\n\n1. Install development dependencies:\n   ```bash\n   pip install -e \".[dev]\"\n   ```\n\n2. In the [`tests/`](tests/) folder, run all tests with:\n   ```bash\n   pytest\n   ```\n\n3. Check the test coverage with:\n   ```bash\n   pytest --cov=wyoming_openai\n   ```\n\nAll new code should include appropriate tests.\nA GitHub Action automatically runs pytest on all pull requests and branch pushes to ensure tests pass.\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "OpenAI-Compatible Proxy Middleware for the Wyoming Protocol",
    "version": "0.3.7",
    "project_urls": {
        "Homepage": "https://github.com/roryeckel/wyoming_openai",
        "Issues": "https://github.com/roryeckel/wyoming_openai/issues"
    },
    "split_keywords": [
        "proxy",
        " tts",
        " openai",
        " home-assistant",
        " stt",
        " asr",
        " wyoming"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7a3595e9b8be5c575196635e373e968a65206dd797a3841a7ecae1685feaaf72",
                "md5": "75042c83341ef93bc7d5b0bbff6fefab",
                "sha256": "543a2f055b1f4fe1674ce587ab8c4f738e99f122aea1bd17fc86205c116cfd85"
            },
            "downloads": -1,
            "filename": "wyoming_openai-0.3.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "75042c83341ef93bc7d5b0bbff6fefab",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 31126,
            "upload_time": "2025-09-10T03:18:58",
            "upload_time_iso_8601": "2025-09-10T03:18:58.617694Z",
            "url": "https://files.pythonhosted.org/packages/7a/35/95e9b8be5c575196635e373e968a65206dd797a3841a7ecae1685feaaf72/wyoming_openai-0.3.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0b9789a30b159381fe76d31a95d43ed613438613398e4a91c4dbf44032b4616b",
                "md5": "d67a832a03ac74f06cb543ae35d903a0",
                "sha256": "a0c189d3eb16673ea7d140d0e833b9ca66c47bfe8bdc9786d0d9eec22d72ef6d"
            },
            "downloads": -1,
            "filename": "wyoming_openai-0.3.7.tar.gz",
            "has_sig": false,
            "md5_digest": "d67a832a03ac74f06cb543ae35d903a0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 47386,
            "upload_time": "2025-09-10T03:18:59",
            "upload_time_iso_8601": "2025-09-10T03:18:59.752934Z",
            "url": "https://files.pythonhosted.org/packages/0b/97/89a30b159381fe76d31a95d43ed613438613398e4a91c4dbf44032b4616b/wyoming_openai-0.3.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-10 03:18:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "roryeckel",
    "github_project": "wyoming_openai",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "wyoming-openai"
}
        
Elapsed time: 1.90954s