inference-proxy 3.2.2__tar.gz → 3.2.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/PKG-INFO +42 -6
  2. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/README.md +37 -2
  3. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/lm_proxy/__main__.py +0 -1
  4. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/lm_proxy/app.py +0 -1
  5. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/lm_proxy/base_types.py +0 -1
  6. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/lm_proxy/bootstrap.py +1 -1
  7. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/pyproject.toml +3 -3
  8. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/LICENSE +0 -0
  9. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/lm_proxy/__init__.py +0 -0
  10. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/lm_proxy/api_key_check/__init__.py +0 -0
  11. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/lm_proxy/api_key_check/allow_all.py +0 -0
  12. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/lm_proxy/api_key_check/in_config.py +0 -0
  13. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/lm_proxy/api_key_check/with_request.py +0 -0
  14. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/lm_proxy/config.py +0 -0
  15. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/lm_proxy/config_loaders/__init__.py +0 -0
  16. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/lm_proxy/config_loaders/json.py +0 -0
  17. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/lm_proxy/config_loaders/python.py +0 -0
  18. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/lm_proxy/config_loaders/toml.py +0 -0
  19. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/lm_proxy/config_loaders/yaml.py +0 -0
  20. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/lm_proxy/core.py +0 -0
  21. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/lm_proxy/errors.py +0 -0
  22. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/lm_proxy/handlers/__init__.py +0 -0
  23. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/lm_proxy/handlers/forward_http_headers.py +0 -0
  24. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/lm_proxy/handlers/rate_limiter.py +0 -0
  25. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/lm_proxy/loggers.py +0 -0
  26. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/lm_proxy/models_endpoint.py +0 -0
  27. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/lm_proxy/strategies/__init__.py +0 -0
  28. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/lm_proxy/strategies/fallback.py +0 -0
  29. {inference_proxy-3.2.2 → inference_proxy-3.2.3}/lm_proxy/utils.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: inference-proxy
3
- Version: 3.2.2
3
+ Version: 3.2.3
4
4
  Summary: Inference Proxy is an OpenAI-compatible http proxy server for inferencing various LLMs capable of working with Google, Anthropic, OpenAI APIs, local PyTorch inference, etc.
5
5
  License: MIT License
6
6
 
@@ -23,6 +23,7 @@ License: MIT License
23
23
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
24
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
25
  SOFTWARE.
26
+ License-File: LICENSE
26
27
  Keywords: llm,large language models,ai,gpt,openai,proxy,http,proxy-server,llm gateway,openai,anthropic,google genai
27
28
  Author: Vitalii Stepanenko
28
29
  Author-email: mail@vitaliy.in
@@ -45,10 +46,10 @@ Provides-Extra: all
45
46
  Provides-Extra: anthropic
46
47
  Provides-Extra: google
47
48
  Provides-Extra: test
48
- Requires-Dist: ai-microcore (>=5.1.2,<7)
49
+ Requires-Dist: ai-microcore (>=6.2.1,<7)
49
50
  Requires-Dist: anthropic (>=0.77,<1) ; extra == "all"
50
51
  Requires-Dist: anthropic (>=0.77,<1) ; extra == "anthropic"
51
- Requires-Dist: fastapi (>=0.121.3,<1)
52
+ Requires-Dist: fastapi (>=0.136.3,<1)
52
53
  Requires-Dist: google-genai (>=1.62.0,<2) ; extra == "all"
53
54
  Requires-Dist: google-genai (>=1.62.0,<2) ; extra == "google"
54
55
  Requires-Dist: pydantic (>=2.12.5,<2.13.0)
@@ -71,7 +72,7 @@ Description-Content-Type: text/markdown
71
72
  <a href="https://pypi.org/project/lm-proxy/"><img src="https://img.shields.io/pypi/v/lm-proxy?color=blue" alt="PyPI"></a>
72
73
  <a href="https://github.com/Nayjest/lm-proxy/actions/workflows/tests.yml"><img src="https://github.com/Nayjest/lm-proxy/actions/workflows/tests.yml/badge.svg" alt="Tests"></a>
73
74
  <a href="https://github.com/Nayjest/lm-proxy/actions/workflows/code-style.yml"><img src="https://github.com/Nayjest/lm-proxy/actions/workflows/code-style.yml/badge.svg" alt="Code Style"></a>
74
- <img src="https://raw.githubusercontent.com/Nayjest/lm-proxy/main/coverage.svg" alt="Code Coverage">
75
+ <img src="https://raw.githubusercontent.com/Nayjest/lm-proxy/coverage-badge/coverage.svg" alt="Code Coverage">
75
76
  <a href="https://www.bestpractices.dev/projects/11364"><img src="https://www.bestpractices.dev/projects/11364/badge"></a>
76
77
  <br>
77
78
  <a href="https://github.com/vshymanskyy/StandWithUkraine/blob/main/README.md"><img src="https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/refs/heads/main/badges/StandWithUkraine.svg" alt="Stand With Ukraine"></a>
@@ -91,6 +92,7 @@ It works as a drop-in replacement for OpenAI's API, allowing you to switch betwe
91
92
  - [Getting Started](#-getting-started)
92
93
  - [Installation](#installation)
93
94
  - [Quick Start](#quick-start)
95
+ - [Run with Docker](#run-with-docker)
94
96
  - [Configuration](#-configuration)
95
97
  - [Basic Structure](#basic-structure)
96
98
  - [Environment Variables](#environment-variables)
@@ -210,6 +212,39 @@ completion = client.chat.completions.create(
210
212
  )
211
213
  ```
212
214
 
215
+ ### Run with Docker<a id="run-with-docker"></a>
216
+
217
+ Official images are published to GitHub Container Registry on every release
218
+ (`latest`, `3`, `3.2`, `3.2.2`, …; `edge` tracks the `main` branch).
219
+ They include the Anthropic and Google connectors and YAML config support out of the box.
220
+
221
+ Mount your `config.toml` and provide API keys via an `.env` file:
222
+
223
+ ```bash
224
+ docker run -d --name inference-proxy \
225
+ -p 8000:8000 \
226
+ -v ./config.toml:/app/config.toml:ro \
227
+ --env-file .env \
228
+ lmproxy/lmproxy:edge
229
+ ```
230
+
231
+ Any value referenced in the config as `env:<VAR_NAME>` (upstream provider keys,
232
+ client API keys, etc.) can be defined in the `.env` file:
233
+
234
+ ```ini
235
+ OPENAI_API_KEY=sk-...
236
+ ANTHROPIC_API_KEY=sk-ant-...
237
+ ```
238
+
239
+ See [examples/docker-compose.yml](examples/docker-compose.yml) for a Docker Compose setup.
240
+
241
+ To bake additional Python packages into the image (e.g. for
242
+ [database log storage](#database-connector)), build it with the `EXTRA_PIP_PACKAGES` argument:
243
+
244
+ ```bash
245
+ docker build --build-arg EXTRA_PIP_PACKAGES="inference-proxy-db-connector sqlalchemy psycopg2-binary" -t inference-proxy .
246
+ ```
247
+
213
248
 
214
249
  ## 📝 Configuration<a id="-configuration"></a>
215
250
 
@@ -258,7 +293,7 @@ api_keys = [
258
293
  [[loggers]]
259
294
  class = 'lm_proxy.loggers.BaseLogger'
260
295
  [loggers.log_writer]
261
- class = 'lm_proxy.loggers.log_writers.JsonLogWriter'
296
+ class = 'lm_proxy.loggers.JsonLogWriter'
262
297
  file_name = 'storage/json.log'
263
298
  [loggers.entry_transformer]
264
299
  class = 'lm_proxy.loggers.LogEntryTransformer'
@@ -714,6 +749,7 @@ prefix = "SECURITY_AUDIT"
714
749
  For more detailed information, check out these articles:
715
750
  - [HTTP Header Management](https://github.com/Nayjest/lm-proxy/blob/main/doc/http_headers.md)
716
751
  - [Configuring fallbacks](https://github.com/Nayjest/lm-proxy/blob/main/doc/fallback.md)
752
+ - [HTTPS / TLS Setup](https://github.com/Nayjest/lm-proxy/blob/main/doc/https.md)
717
753
 
718
754
 
719
755
  ## 🚧 Known Limitations<a id="-known-limitations"></a>
@@ -6,7 +6,7 @@
6
6
  <a href="https://pypi.org/project/lm-proxy/"><img src="https://img.shields.io/pypi/v/lm-proxy?color=blue" alt="PyPI"></a>
7
7
  <a href="https://github.com/Nayjest/lm-proxy/actions/workflows/tests.yml"><img src="https://github.com/Nayjest/lm-proxy/actions/workflows/tests.yml/badge.svg" alt="Tests"></a>
8
8
  <a href="https://github.com/Nayjest/lm-proxy/actions/workflows/code-style.yml"><img src="https://github.com/Nayjest/lm-proxy/actions/workflows/code-style.yml/badge.svg" alt="Code Style"></a>
9
- <img src="https://raw.githubusercontent.com/Nayjest/lm-proxy/main/coverage.svg" alt="Code Coverage">
9
+ <img src="https://raw.githubusercontent.com/Nayjest/lm-proxy/coverage-badge/coverage.svg" alt="Code Coverage">
10
10
  <a href="https://www.bestpractices.dev/projects/11364"><img src="https://www.bestpractices.dev/projects/11364/badge"></a>
11
11
  <br>
12
12
  <a href="https://github.com/vshymanskyy/StandWithUkraine/blob/main/README.md"><img src="https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/refs/heads/main/badges/StandWithUkraine.svg" alt="Stand With Ukraine"></a>
@@ -26,6 +26,7 @@ It works as a drop-in replacement for OpenAI's API, allowing you to switch betwe
26
26
  - [Getting Started](#-getting-started)
27
27
  - [Installation](#installation)
28
28
  - [Quick Start](#quick-start)
29
+ - [Run with Docker](#run-with-docker)
29
30
  - [Configuration](#-configuration)
30
31
  - [Basic Structure](#basic-structure)
31
32
  - [Environment Variables](#environment-variables)
@@ -145,6 +146,39 @@ completion = client.chat.completions.create(
145
146
  )
146
147
  ```
147
148
 
149
+ ### Run with Docker<a id="run-with-docker"></a>
150
+
151
+ Official images are published to GitHub Container Registry on every release
152
+ (`latest`, `3`, `3.2`, `3.2.2`, …; `edge` tracks the `main` branch).
153
+ They include the Anthropic and Google connectors and YAML config support out of the box.
154
+
155
+ Mount your `config.toml` and provide API keys via an `.env` file:
156
+
157
+ ```bash
158
+ docker run -d --name inference-proxy \
159
+ -p 8000:8000 \
160
+ -v ./config.toml:/app/config.toml:ro \
161
+ --env-file .env \
162
+ lmproxy/lmproxy:edge
163
+ ```
164
+
165
+ Any value referenced in the config as `env:<VAR_NAME>` (upstream provider keys,
166
+ client API keys, etc.) can be defined in the `.env` file:
167
+
168
+ ```ini
169
+ OPENAI_API_KEY=sk-...
170
+ ANTHROPIC_API_KEY=sk-ant-...
171
+ ```
172
+
173
+ See [examples/docker-compose.yml](examples/docker-compose.yml) for a Docker Compose setup.
174
+
175
+ To bake additional Python packages into the image (e.g. for
176
+ [database log storage](#database-connector)), build it with the `EXTRA_PIP_PACKAGES` argument:
177
+
178
+ ```bash
179
+ docker build --build-arg EXTRA_PIP_PACKAGES="inference-proxy-db-connector sqlalchemy psycopg2-binary" -t inference-proxy .
180
+ ```
181
+
148
182
 
149
183
  ## 📝 Configuration<a id="-configuration"></a>
150
184
 
@@ -193,7 +227,7 @@ api_keys = [
193
227
  [[loggers]]
194
228
  class = 'lm_proxy.loggers.BaseLogger'
195
229
  [loggers.log_writer]
196
- class = 'lm_proxy.loggers.log_writers.JsonLogWriter'
230
+ class = 'lm_proxy.loggers.JsonLogWriter'
197
231
  file_name = 'storage/json.log'
198
232
  [loggers.entry_transformer]
199
233
  class = 'lm_proxy.loggers.LogEntryTransformer'
@@ -649,6 +683,7 @@ prefix = "SECURITY_AUDIT"
649
683
  For more detailed information, check out these articles:
650
684
  - [HTTP Header Management](https://github.com/Nayjest/lm-proxy/blob/main/doc/http_headers.md)
651
685
  - [Configuring fallbacks](https://github.com/Nayjest/lm-proxy/blob/main/doc/fallback.md)
686
+ - [HTTPS / TLS Setup](https://github.com/Nayjest/lm-proxy/blob/main/doc/https.md)
652
687
 
653
688
 
654
689
  ## 🚧 Known Limitations<a id="-known-limitations"></a>
@@ -2,6 +2,5 @@
2
2
 
3
3
  from .app import cli_app
4
4
 
5
-
6
5
  if __name__ == "__main__":
7
6
  cli_app()
@@ -13,7 +13,6 @@ from .core import chat_completions
13
13
  from .models_endpoint import models
14
14
  from .errors import OpenAIHTTPException
15
15
 
16
-
17
16
  cli_app = typer.Typer()
18
17
 
19
18
 
@@ -9,7 +9,6 @@ import microcore as mc
9
9
  from pydantic import BaseModel
10
10
  from starlette.requests import Request
11
11
 
12
-
13
12
  if TYPE_CHECKING:
14
13
  from .config import Group
15
14
 
@@ -84,7 +84,7 @@ class Env:
84
84
  # initialize connections
85
85
  env.connections = {}
86
86
  for conn_name, conn_config in env.config.connections.items():
87
- logging.info("Initializing \"%s\" LLM proxy connection...", ui.green(conn_name))
87
+ logging.info("Initializing '%s' LLM proxy connection...", ui.green(conn_name))
88
88
  try:
89
89
  fn_or_config = resolve_instance_or_callable(conn_config, allow_types=[dict])
90
90
  if _is_async_callable(fn_or_config):
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "inference-proxy"
3
- version = "3.2.2"
3
+ version = "3.2.3"
4
4
  description = "Inference Proxy is an OpenAI-compatible http proxy server for inferencing various LLMs capable of working with Google, Anthropic, OpenAI APIs, local PyTorch inference, etc."
5
5
  readme = "README.md"
6
6
  keywords = ["llm", "large language models", "ai", "gpt", "openai", "proxy", "http", "proxy-server", "llm gateway", "openai", "anthropic", "google genai"]
@@ -35,8 +35,8 @@ documentation = "https://github.com/Nayjest/lm-proxy#readme"
35
35
  license = { file = "LICENSE" }
36
36
 
37
37
  dependencies = [
38
- "ai-microcore>=5.1.2,<7",
39
- "fastapi>=0.121.3,<1",
38
+ "ai-microcore>=6.2.1,<7",
39
+ "fastapi>=0.136.3,<1",
40
40
  "uvicorn>=0.41.0",
41
41
  "typer>=0.24.0,<1",
42
42
  "requests>=2.32.5,<3",
File without changes