Skip to main content

A simple Vertex AI proxy that automatically refresh tokens for you.

Project description

Simple Vertex Bridge

A simple Vertex AI proxy that automatically refresh tokens for you.

[中文]

Feature

  • OpenAI style chat completion API with token attached
  • OpenAI style model list API
  • Automatically refresh tokens
  • Stream output
  • Reused h2 connection

Usage

Prerequisites

  • Install uv.

Authentication

There are two ways to authenticate:

  1. By gcloud CLI
    • Install gcloud CLI.
    • Run gcloud auth application-default login to authenticate.
  2. By service account key
    • Create a service account key in the Google Cloud Console, according to this documentation.
    • Download the json key file.
    • Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of the key file.

Launch

  • Note: svbridge-config.json will be created in the current directory.
  1. You can run uvx simple-vertex-bridge to launch the bridge directly from pypi.
  2. Or clone this repo and enter and run uv sync, then activate venv and run python svbridge.py.

Now your API is ready

  • Model List: http://localhost:8086/v1/models, v1 can be omitted.
  • API Endpoint: http://localhost:8086/v1/chat/completions, v1 can be omitted.
  • API Key: anything, the bridge will replace it with the Vertex AI token.

License

The Unlicense.

TBH I dont care what you do with this code, just dont sue me if it breaks something. uwu

Project details


Download files

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

Source Distribution

simple_vertex_bridge-0.2.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

simple_vertex_bridge-0.2.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file simple_vertex_bridge-0.2.0.tar.gz.

File metadata

  • Download URL: simple_vertex_bridge-0.2.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for simple_vertex_bridge-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8c39101eed6f9a008e75412cd420d0ae134b69bd7f2bddd5d0354a77c817948f
MD5 1044d5bd571f77bb2acabaacd6ece675
BLAKE2b-256 08780146deb3944bc866e459cb7d2487ac1f0ef250fb95c661261582276fc629

See more details on using hashes here.

File details

Details for the file simple_vertex_bridge-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_vertex_bridge-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e0167c9bbbc137ef45202da54b09421c3f3b53615bbe08aecb559e387c025b5
MD5 fdca1400fd0335e5ebf77a1b6d685d7f
BLAKE2b-256 9dfa563255edd6aee9e328282f8da1ee294718cf9ccf9945b573e105be05bbda

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