Skip to main content

Generic OpenAI-compatible endpoints (OpenRouter, Together, Groq, self-hosted vLLM/TGI, ...) as a first-class Langflow model provider, packaged as a standalone Extension Bundle.

Project description

lfx-openai-compatible

Generic OpenAI-compatible endpoints as a first-class Langflow model provider, packaged as a standalone Extension Bundle.

Registers an OpenAI Compatible model provider that appears in Langflow's unified model picker alongside the built-in providers. Any service that speaks the OpenAI HTTP API shape can be configured through it — for example:

Provider Base URL
OpenRouter https://openrouter.ai/api/v1
Together AI https://api.together.xyz/v1
Groq https://api.groq.com/openai/v1
Fireworks AI https://api.fireworks.ai/inference/v1
Self-hosted vLLM / TGI / LM Studio http://localhost:8000/v1

The provider reuses the ChatOpenAI / OpenAIEmbeddings classes and discovers the served models live from the endpoint's /v1/models route — the same model is therefore offered in both the Language Model and Embedding Model contexts.

Unlike a component bundle, this ships no component: it contributes a provider through the providers[] block in extension.json, which Langflow's provider registry merges into the unified model system. It edits no Langflow core files.

Configure

Set the endpoint (and, if it requires one, an API key) under Settings → Model Providers → OpenAI Compatible, or via environment variables:

  • OPENAI_COMPATIBLE_BASE_URL — base URL of the endpoint, e.g. https://openrouter.ai/api/v1 or http://localhost:8000/v1 (required).
  • OPENAI_COMPATIBLE_API_KEY — bearer token, if the endpoint enforces one (optional; local servers without auth do not need it).

The provider holds one endpoint at a time. For a second concurrent custom endpoint, combine it with the built-in OpenAI provider's Base URL override or the vLLM provider (lfx-vllm).

Install

pip install lfx-openai-compatible

The bundle is registered automatically via the langflow.extensions entry-point. Restart your Langflow server and select OpenAI Compatible in any Language Model or Embedding Model field.

Develop

cd src/bundles/openai-compatible
pip install -e .
lfx extension validate src/lfx_openai_compatible

Credit

Resolves the feature request in #12839. Follows the provider-bundle pattern established by lfx-vllm (#13919).

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

lfx_openai_compatible-0.1.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file lfx_openai_compatible-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: lfx_openai_compatible-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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 lfx_openai_compatible-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dd09e2ef7d8695fe57a6607d19d4d8fc68eb01e3145aa92698804b75cdf949e5
MD5 2a6a87f689ca5977316db9b4a0597bdb
BLAKE2b-256 53ce734f0b91aed36d50ecd7925a6610a5f466e80f6f7a683e456c692dc59319

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