Skip to main content

A library that wraps multiple LLM providers into a consistent API while using each provider's native SDK internally, supporting multimodal I/O, file processing, and stream output.

Project description

LLM Bridge

LLM Bridge is a Python library that wraps multiple LLM providers into a consistent API while using each provider's native SDK internally, supporting multimodal I/O, file processing, and stream output.

GitHub: https://github.com/windsnow1025/LLM-Bridge

PyPI: https://pypi.org/project/LLM-Bridge/

Workflow and Features

  1. Chat Client Factory: creates a client for the specific LLM API with model parameters
    1. Model Message Converter: converts general messages to model messages
      1. Media Processor: converts general media to model compatible formats.
  2. Chat Client: generate stream or non-stream responses

Supported Features for API Types

The features listed represent the maximum capabilities of each API type supported by LLM Bridge.

API Type Input Format Capabilities Output Format
OpenAI Completion API Text, Image, PDF Thinking, Structured Output Text
OpenAI Responses API Text, Image, PDF Thinking, Web Search, Code Execution, Structured Output Text, Image
Google GenAI Text, Image, PDF, Audio, Video Thinking, Web Search, Web Fetch, Code Execution, Structured Output Text, Image, File
Anthropic Text, Image, PDF Thinking, Web Search, Web Fetch, Code Execution, Structured Output Text, File
xAI Text, Image, PDF, Audio, Video, docx, xlsx, pptx Thinking, Web Search, Code Execution, Structured Output Text

Development

Python uv

  1. Install uv: powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
  2. Install Python in uv: uv python install 3.12; upgrade Python in uv: uv python upgrade 3.12
  3. Configure requirements:
uv sync --refresh

PyCharm

Add New Interpreter >> Add Local Interpreter

  • Environment: Select existing
  • Type: uv

Usage

Copy ./usage/.env.example and rename it to ./usage/.env, then fill in the environment variables.

Build

uv build

Project details


Release history Release notifications | RSS feed

This version

2.0.6

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm_bridge-2.0.6.tar.gz (131.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm_bridge-2.0.6-py3-none-any.whl (49.2 kB view details)

Uploaded Python 3

File details

Details for the file llm_bridge-2.0.6.tar.gz.

File metadata

  • Download URL: llm_bridge-2.0.6.tar.gz
  • Upload date:
  • Size: 131.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.10 {"installer":{"name":"uv","version":"0.11.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llm_bridge-2.0.6.tar.gz
Algorithm Hash digest
SHA256 d8837a13c7daaa6a3e900c98f0d920aa5634186ad6648fe173d5873afbd9071e
MD5 86e89f4b5167a9bb3a341f1d2ecf7f1a
BLAKE2b-256 e3cdbd00ab9c677b6f8aec3a0b67934a92e03e544b2015af2b59c2050e0ffeee

See more details on using hashes here.

File details

Details for the file llm_bridge-2.0.6-py3-none-any.whl.

File metadata

  • Download URL: llm_bridge-2.0.6-py3-none-any.whl
  • Upload date:
  • Size: 49.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.10 {"installer":{"name":"uv","version":"0.11.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llm_bridge-2.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 6b65067e4b07fc5a1443d1334bcb9c0a17ed6bc4c0558514885191f3ae33dd30
MD5 07770bc5ab5e57288cde644fce7311d6
BLAKE2b-256 8b165220eb6e81886e45c6ac4f6930de402c57bfd5105580240fb4580a4f111d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page