Metadata-Version: 2.4
Name: lfx-boldrouter
Version: 0.1.0
Summary: BoldRouter for Langflow: a model component and model provider for one API key across 129 models from 26 providers.
Project-URL: Homepage, https://boldrouter.com
Project-URL: Documentation, https://boldrouter.com/docs
Author-email: BoldRouter <support@boldrouter.com>
License: MIT
License-File: LICENSE
Keywords: boldrouter,bundle,extension,gateway,langflow,lfx,llm,openai-compatible,router
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: <3.15,>=3.10
Requires-Dist: httpx>=0.27
Requires-Dist: langchain-openai>=1.1.6
Requires-Dist: lfx<2.0.0,>=1.12.0
Provides-Extra: test
Requires-Dist: pytest>=8; extra == 'test'
Description-Content-Type: text/markdown

# BoldRouter for Langflow

[BoldRouter](https://boldrouter.com) for [Langflow](https://www.langflow.org): one API key for 129 models across 26 providers, with provider routing, automatic failover, prompt caching and PII anonymization.

`lfx-boldrouter` is a Langflow extension. Install it next to Langflow and it adds two things:

- A **BoldRouter provider** in Langflow's model settings. Its models then appear in the built-in **Language Model**, **Agent** and **Embedding Model** components.
- A **BoldRouter component** in the palette, with every BoldRouter option: routing strategy, provider order, fallback models, reasoning effort, anonymization and prompt caching.

## Install

Requires Langflow 1.12 or later.

```bash
uv pip install lfx-boldrouter   # or: pip install lfx-boldrouter
langflow run
```

Langflow discovers the extension at startup. To confirm it loaded:

```bash
lfx extension list
```

## Use the provider

1. Open **Settings → Model Providers** and choose **BoldRouter**.
2. Paste your API key. Create one at [boldrouter.com/dashboard/keys](https://boldrouter.com/dashboard/keys); keys start with `sk-bold-`.
3. Optionally set a **Routing Strategy** (balanced, price, latency or uptime). It applies to every BoldRouter model you use.
4. In a **Language Model** or **Agent** component, pick a BoldRouter model such as `bold/auto`.

The key can also come from the `BOLDROUTER_API_KEY` environment variable.

## Use the component

Find **BoldRouter** in the component palette, add your API key and click refresh on **Model** to load the live catalog. The advanced fields map to BoldRouter options:

| Field | Sent as | Docs |
|---|---|---|
| Model | `model`. `bold/auto` by default. | [Models](https://boldrouter.com/docs/models) |
| Routing Strategy | `x-bold-routing` header | [Routing](https://boldrouter.com/docs/routing) |
| Provider Order | `provider.order` | [Routing](https://boldrouter.com/docs/routing) |
| Fallback Models | `models` chain, primary model first | [Routing](https://boldrouter.com/docs/routing) |
| Reasoning Effort | `reasoning`: `off` turns thinking off; `minimal` to `max` set the effort | [Chat completions](https://boldrouter.com/docs/chat-completions#reasoning) |
| Anonymize Prompts | `anonymize: true` | [Anonymization](https://boldrouter.com/docs/anonymization) |
| Prompt Caching | `cache: false` when off | [Prompt caching](https://boldrouter.com/docs/prompt-caching) |
| Base URL | Endpoint override, for example for a proxy | |

The component returns a LangChain chat model, so it works anywhere Langflow accepts a language model: agents, chains, structured output and tools. Token usage, including hidden reasoning tokens, is reported for streamed and non-streamed responses.

## Develop

```bash
uv pip install -e ".[test]"
pytest
lfx extension validate src/lfx_boldrouter --execute-imports
lfx extension dev src/lfx_boldrouter   # Langflow dev server with the extension loaded
```

## License

MIT. Project: [BoldRouter](https://boldrouter.com). Author: GentleBulldozer ([GentleDozer on X](https://x.com/GentleDozer)). Owner: Cybrient Technologies SA.
