Metadata-Version: 2.4
Name: polyllm-openai-compatible
Version: 0.1.0
Summary: OpenAI-compatible endpoint plugin for PolyLLM.
Author: PolyLLM contributors
License-Expression: MIT
Project-URL: Homepage, https://polyllm.raingpt.top
Project-URL: Repository, https://github.com/you-want/PolyLLM
Project-URL: Issues, https://github.com/you-want/PolyLLM/issues
Keywords: llm,polyllm,openai-compatible,gateway
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: polyllm-core>=0.1.0
Dynamic: license-file

# PolyLLM OpenAI-Compatible Plugin for Python

适用于 Qwen、Moonshot、OpenRouter、Groq、vLLM、Ollama 等所有兼容 OpenAI Chat Completions 协议的服务。

```python
from polyllm_core import create_llm
from polyllm_openai_compatible import OpenAICompatiblePlugin

plugin = OpenAICompatiblePlugin()
llm = create_llm(
    plugins=[plugin],
    providers={"openai-compatible": {"api_key": "...", "base_url": "https://your-endpoint/v1"}},
    allow_unlisted_models=True,
)
response = await llm.chat("openai-compatible:your-model", messages=[{"role": "user", "content": "你好"}])
```
