11# llm_bridge
22
3- > ** Open source by Santander AI Lab.** A tiny, vendor-neutral ** LLM client library** — one interface for ** OpenAI, DeepSeek, AWS Bedrock and Google Gemini** (or bring your own AI backend).
3+ > ** Open source by Santander AI Lab.** A tiny, vendor-neutral ** LLM client library** — one interface for ** OpenAI, DeepSeek, Alibaba Qwen, AWS Bedrock and Google Gemini** (or bring your own AI backend).
44
55[ ![ License: Apache 2.0] ( https://img.shields.io/badge/License-Apache_2.0-blue.svg )] ( LICENSE )
66[ ![ Python 3.9+] ( https://img.shields.io/badge/python-3.9%2B-blue.svg )] ( https://www.python.org/downloads/ )
@@ -15,7 +15,8 @@ Part of [**Santander AI Open Source**](https://github.com/SantanderAI) — open
1515
1616A tiny, ** vendor-neutral wrapper for any LLM backend** . One small interface,
1717pluggable providers. Write your application against ` LLMClient ` once and switch
18- between OpenAI, DeepSeek, AWS Bedrock, Google Gemini, a local server, or your own
18+ between OpenAI, DeepSeek, Alibaba Qwen, AWS Bedrock, Google Gemini, a local
19+ server, or your own
1920internal backend — without touching your code.
2021
2122- ** Canonical interface + thin SDK adapters.** One contract (` LLMClient ` ) with
@@ -34,6 +35,7 @@ internal backend — without touching your code.
3435pip install llm-bridge # core only (no vendor SDKs)
3536pip install " llm-bridge[openai]" # + OpenAI SDK
3637pip install " llm-bridge[deepseek]" # + OpenAI SDK for DeepSeek
38+ pip install " llm-bridge[qwen]" # + OpenAI SDK for Qwen/DashScope
3739pip install " llm-bridge[aws]" # + AWS Bedrock (boto3)
3840pip install " llm-bridge[google]" # + Google Gemini (google-genai)
3941pip install " llm-bridge[all]" # everything
@@ -51,6 +53,7 @@ print(llm.complete("Hello!").content)
5153# Switch provider by changing one dict — your code stays the same.
5254llm = create_llm({" provider" : " openai" , " model" : " gpt-4o-mini" }) # needs [openai] + OPENAI_API_KEY
5355llm = create_llm({" provider" : " deepseek" , " model" : " deepseek-v4-pro" }) # needs [deepseek] + DEEPSEEK_API_KEY
56+ llm = create_llm({" provider" : " qwen" , " model" : " qwen-plus" }) # needs [qwen] + DASHSCOPE_API_KEY
5457llm = create_llm({" provider" : " bedrock" , " model" : " <bedrock-model-id>" }) # needs [aws] + AWS creds
5558llm = create_llm({" provider" : " google" , " model" : " gemini-2.5-flash" }) # needs [google] + GOOGLE_API_KEY
5659
@@ -85,11 +88,13 @@ print(llm.complete("Hi").content)
8588| Bring your own | ` callable ` | none |
8689| OpenAI (and OpenAI-compatible) | ` openai ` | ` [openai] ` |
8790| DeepSeek | ` deepseek ` | ` [deepseek] ` |
91+ | Alibaba Qwen | ` qwen ` | ` [qwen] ` |
8892| AWS Bedrock (Converse) | ` bedrock ` , ` aws ` | ` [aws] ` |
8993| Google Gemini | ` google ` , ` gemini ` | ` [google] ` |
9094
9195Credentials are read from environment variables (` OPENAI_API_KEY ` ,
92- ` DEEPSEEK_API_KEY ` , ` GOOGLE_API_KEY ` /` GEMINI_API_KEY ` , standard AWS credential chain). Never
96+ ` DEEPSEEK_API_KEY ` , ` DASHSCOPE_API_KEY ` , ` GOOGLE_API_KEY ` /` GEMINI_API_KEY ` ,
97+ standard AWS credential chain). Never
9398hardcode secrets.
9499
95100The ` openai ` provider also targets any ** OpenAI-compatible** endpoint (vLLM,
@@ -100,6 +105,11 @@ The `deepseek` provider uses DeepSeek's OpenAI-compatible API via the OpenAI
100105SDK, defaults to ` https://api.deepseek.com ` , and accepts ` base_url ` or
101106` DEEPSEEK_BASE_URL ` for compatible endpoints.
102107
108+ The ` qwen ` provider uses Alibaba Model Studio/DashScope's OpenAI-compatible API
109+ via the OpenAI SDK. It defaults to
110+ ` https://dashscope-intl.aliyuncs.com/compatible-mode/v1 ` and accepts ` base_url `
111+ or ` DASHSCOPE_BASE_URL ` for other regions or workspaces.
112+
103113## The interface
104114
105115``` python
@@ -132,13 +142,13 @@ Implement `LLMClient`, expose `build(config) -> LLMClient`, and register it in
132142
133143See [ ` examples/ ` ] ( examples ) : ` mock_example.py ` , ` callable_example.py ` ,
134144` openai_example.py ` , ` deepseek_example.py ` , ` bedrock_example.py ` ,
135- ` google_example.py ` .
145+ ` qwen_example.py ` , ` bedrock_example.py ` , ` google_example.py ` .
136146
137147## Requirements
138148
139149- Python 3.9+
140150- No required runtime dependencies for the core (` mock ` , ` callable ` ).
141- - Optional vendor SDKs are installed on demand via extras (` [openai] ` , ` [aws] ` , ` [google] ` , ` [all] ` ).
151+ - Optional vendor SDKs are installed on demand via extras (` [openai] ` , ` [deepseek] ` , ` [qwen] ` , ` [ aws]` , ` [google] ` , ` [all] ` ).
142152
143153## Contributing
144154
0 commit comments