openai-http-proxy 2.1.1__tar.gz → 3.0.0.dev1__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 (24) hide show
  1. {openai_http_proxy-2.1.1 → openai_http_proxy-3.0.0.dev1}/LICENSE +1 -1
  2. {openai_http_proxy-2.1.1 → openai_http_proxy-3.0.0.dev1}/PKG-INFO +16 -12
  3. {openai_http_proxy-2.1.1 → openai_http_proxy-3.0.0.dev1}/README.md +4 -4
  4. {openai_http_proxy-2.1.1 → openai_http_proxy-3.0.0.dev1}/lm_proxy/api_key_check/with_request.py +1 -1
  5. {openai_http_proxy-2.1.1 → openai_http_proxy-3.0.0.dev1}/lm_proxy/utils.py +2 -1
  6. {openai_http_proxy-2.1.1 → openai_http_proxy-3.0.0.dev1}/pyproject.toml +17 -15
  7. {openai_http_proxy-2.1.1 → openai_http_proxy-3.0.0.dev1}/lm_proxy/__init__.py +0 -0
  8. {openai_http_proxy-2.1.1 → openai_http_proxy-3.0.0.dev1}/lm_proxy/__main__.py +0 -0
  9. {openai_http_proxy-2.1.1 → openai_http_proxy-3.0.0.dev1}/lm_proxy/_app.py +0 -0
  10. {openai_http_proxy-2.1.1 → openai_http_proxy-3.0.0.dev1}/lm_proxy/api_key_check/__init__.py +0 -0
  11. {openai_http_proxy-2.1.1 → openai_http_proxy-3.0.0.dev1}/lm_proxy/api_key_check/allow_all.py +0 -0
  12. {openai_http_proxy-2.1.1 → openai_http_proxy-3.0.0.dev1}/lm_proxy/api_key_check/in_config.py +0 -0
  13. {openai_http_proxy-2.1.1 → openai_http_proxy-3.0.0.dev1}/lm_proxy/app.py +0 -0
  14. {openai_http_proxy-2.1.1 → openai_http_proxy-3.0.0.dev1}/lm_proxy/base_types.py +0 -0
  15. {openai_http_proxy-2.1.1 → openai_http_proxy-3.0.0.dev1}/lm_proxy/bootstrap.py +0 -0
  16. {openai_http_proxy-2.1.1 → openai_http_proxy-3.0.0.dev1}/lm_proxy/config.py +0 -0
  17. {openai_http_proxy-2.1.1 → openai_http_proxy-3.0.0.dev1}/lm_proxy/config_loaders/__init__.py +0 -0
  18. {openai_http_proxy-2.1.1 → openai_http_proxy-3.0.0.dev1}/lm_proxy/config_loaders/json.py +0 -0
  19. {openai_http_proxy-2.1.1 → openai_http_proxy-3.0.0.dev1}/lm_proxy/config_loaders/python.py +0 -0
  20. {openai_http_proxy-2.1.1 → openai_http_proxy-3.0.0.dev1}/lm_proxy/config_loaders/toml.py +0 -0
  21. {openai_http_proxy-2.1.1 → openai_http_proxy-3.0.0.dev1}/lm_proxy/config_loaders/yaml.py +0 -0
  22. {openai_http_proxy-2.1.1 → openai_http_proxy-3.0.0.dev1}/lm_proxy/core.py +0 -0
  23. {openai_http_proxy-2.1.1 → openai_http_proxy-3.0.0.dev1}/lm_proxy/loggers.py +0 -0
  24. {openai_http_proxy-2.1.1 → openai_http_proxy-3.0.0.dev1}/lm_proxy/models_endpoint.py +0 -0
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 Vitalii Stepanenko
3
+ Copyright (c) 2025–2026 Vitalii Stepanenko
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: openai-http-proxy
3
- Version: 2.1.1
4
- Summary: "OpenAI HTTP Proxy" is OpenAI-compatible http proxy server for inferencing various LLMs capable of working with Google, Anthropic, OpenAI APIs, local PyTorch inference, etc.
3
+ Version: 3.0.0.dev1
4
+ Summary: OpenAI HTTP 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
 
7
- Copyright (c) 2025 Vitalii Stepanenko
7
+ Copyright (c) 2025–2026 Vitalii Stepanenko
8
8
 
9
9
  Permission is hereby granted, free of charge, to any person obtaining a copy
10
10
  of this software and associated documentation files (the "Software"), to deal
@@ -25,9 +25,9 @@ License: MIT License
25
25
  SOFTWARE.
26
26
  Keywords: llm,large language models,ai,gpt,openai,proxy,http,proxy-server
27
27
  Author: Vitalii Stepanenko
28
- Author-email: mail@vitalii.in
28
+ Author-email: mail@vitaliy.in
29
29
  Maintainer: Vitalii Stepanenko
30
- Maintainer-email: mail@vitalii.in
30
+ Maintainer-email: mail@vitaliy.in
31
31
  Requires-Python: >=3.11,<4
32
32
  Classifier: Intended Audience :: Developers
33
33
  Classifier: Operating System :: OS Independent
@@ -36,10 +36,14 @@ Classifier: Programming Language :: Python :: 3.11
36
36
  Classifier: Programming Language :: Python :: 3.12
37
37
  Classifier: Programming Language :: Python :: 3.13
38
38
  Classifier: License :: OSI Approved :: MIT License
39
- Requires-Dist: ai-microcore (>=4.4.4,<4.5.0)
39
+ Provides-Extra: test
40
+ Requires-Dist: ai-microcore (>=5.0.0.dev7,<6)
40
41
  Requires-Dist: fastapi (>=0.121.3,<1)
41
- Requires-Dist: pydantic (>=2.12.3,<2.13.0)
42
- Requires-Dist: requests (>=2.32.3,<2.33.0)
42
+ Requires-Dist: pydantic (>=2.12.5,<2.13.0)
43
+ Requires-Dist: pytest (>=8.4.2,<8.5.0) ; extra == "test"
44
+ Requires-Dist: pytest-asyncio (>=1.2.0,<1.3.0) ; extra == "test"
45
+ Requires-Dist: pytest-cov (>=7.0.0,<7.1.0) ; extra == "test"
46
+ Requires-Dist: requests (>=2.32.5,<2.33.0)
43
47
  Requires-Dist: typer (>=0.16.1)
44
48
  Requires-Dist: uvicorn (>=0.22.0)
45
49
  Project-URL: Source Code, https://github.com/Nayjest/lm-proxy
@@ -203,7 +207,7 @@ api_base = "https://api.openai.com/v1/"
203
207
  api_key = "env:OPENAI_API_KEY"
204
208
 
205
209
  [connections.google]
206
- api_type = "google_ai_studio"
210
+ api_type = "google"
207
211
  api_key = "env:GOOGLE_API_KEY"
208
212
 
209
213
  [connections.anthropic]
@@ -289,7 +293,7 @@ openai-http-proxy --env=""
289
293
  OpenAI HTTP Proxy utilizes two distinct types of API keys to facilitate secure and efficient request handling.
290
294
 
291
295
  - **Proxy API Key (Virtual API Key, Client API Key):**
292
- A unique key generated and managed within the OpenAI HTTP Proxy.
296
+ A unique key generated and managed within OpenAI HTTP Proxy.
293
297
  Clients use these keys to authenticate their requests to the proxy's API endpoints.
294
298
  Each Client API Key is associated with a specific group, which defines the scope of access and permissions for the client's requests.
295
299
  These keys allow users to securely interact with the proxy without direct access to external service credentials.
@@ -468,7 +472,7 @@ This allows fine-grained control over which users can access which AI providers,
468
472
 
469
473
  #### Overview
470
474
 
471
- LM-proxy includes 2 built-in methods for validating Virtual API keys:
475
+ OpenAI HTTP Proxy includes 2 built-in methods for validating Virtual API keys:
472
476
  - `lm_proxy.api_key_check.check_api_key_in_config` - verifies API keys against those defined in the config file; used by default
473
477
  - `lm_proxy.api_key_check.CheckAPIKeyWithRequest` - validates API keys via an external HTTP service
474
478
 
@@ -639,5 +643,5 @@ Contributions are welcome! Please feel free to submit a Pull Request.
639
643
  ## 📄 License
640
644
 
641
645
  This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
642
- © 2025 Vitalii Stepanenko
646
+ © 2025–2026 [Vitalii Stepanenko](mailto:mail@vitaliy.in)
643
647
 
@@ -156,7 +156,7 @@ api_base = "https://api.openai.com/v1/"
156
156
  api_key = "env:OPENAI_API_KEY"
157
157
 
158
158
  [connections.google]
159
- api_type = "google_ai_studio"
159
+ api_type = "google"
160
160
  api_key = "env:GOOGLE_API_KEY"
161
161
 
162
162
  [connections.anthropic]
@@ -242,7 +242,7 @@ openai-http-proxy --env=""
242
242
  OpenAI HTTP Proxy utilizes two distinct types of API keys to facilitate secure and efficient request handling.
243
243
 
244
244
  - **Proxy API Key (Virtual API Key, Client API Key):**
245
- A unique key generated and managed within the OpenAI HTTP Proxy.
245
+ A unique key generated and managed within OpenAI HTTP Proxy.
246
246
  Clients use these keys to authenticate their requests to the proxy's API endpoints.
247
247
  Each Client API Key is associated with a specific group, which defines the scope of access and permissions for the client's requests.
248
248
  These keys allow users to securely interact with the proxy without direct access to external service credentials.
@@ -421,7 +421,7 @@ This allows fine-grained control over which users can access which AI providers,
421
421
 
422
422
  #### Overview
423
423
 
424
- LM-proxy includes 2 built-in methods for validating Virtual API keys:
424
+ OpenAI HTTP Proxy includes 2 built-in methods for validating Virtual API keys:
425
425
  - `lm_proxy.api_key_check.check_api_key_in_config` - verifies API keys against those defined in the config file; used by default
426
426
  - `lm_proxy.api_key_check.CheckAPIKeyWithRequest` - validates API keys via an external HTTP service
427
427
 
@@ -592,4 +592,4 @@ Contributions are welcome! Please feel free to submit a Pull Request.
592
592
  ## 📄 License
593
593
 
594
594
  This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
595
- © 2025 Vitalii Stepanenko
595
+ © 2025–2026 [Vitalii Stepanenko](mailto:mail@vitaliy.in)
@@ -69,7 +69,7 @@ class CheckAPIKeyWithRequest: # pylint: disable=too-many-instance-attributes
69
69
  "Missing optional dependency 'cachetools'. "
70
70
  "Using 'lm_proxy.api_key_check.CheckAPIKeyWithRequest' with 'use_cache = true' "
71
71
  "requires installing 'cachetools' package. "
72
- "\nPlease install it with following command: 'pip install cachetools'"
72
+ "\nPlease install it with the following command: 'pip install cachetools'"
73
73
  ) from e
74
74
  cache = cachetools.TTLCache(maxsize=self.cache_size, ttl=self.cache_ttl)
75
75
  self._func = cachetools.cached(cache)(check_func)
@@ -86,7 +86,8 @@ def get_client_ip(request: Request) -> str:
86
86
  return real_ip
87
87
  if forwarded := request.headers.get("Forwarded"):
88
88
  # Parse Forwarded header (RFC 7239)
89
- return forwarded.split("for=")[1].split(";")[0].strip()
89
+ if "for=" in forwarded:
90
+ return forwarded.split("for=")[1].split(";")[0].strip()
90
91
 
91
92
  # Fallback to direct client
92
93
  return request.client.host if request.client else "unknown"
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "openai-http-proxy"
3
- version = "2.1.1"
4
- description = "\"OpenAI HTTP Proxy\" is OpenAI-compatible http proxy server for inferencing various LLMs capable of working with Google, Anthropic, OpenAI APIs, local PyTorch inference, etc."
3
+ version = "3.0.0.dev1"
4
+ description = "OpenAI HTTP 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"]
7
7
  classifiers = [
@@ -14,21 +14,21 @@ classifiers = [
14
14
  "License :: OSI Approved :: MIT License",
15
15
  ]
16
16
  dependencies = [
17
- "ai-microcore~=4.4.4",
17
+ "ai-microcore>=5.0.0.dev7,<6",
18
18
  "fastapi>=0.121.3,<1",
19
19
  "uvicorn>=0.22.0",
20
20
  "typer>=0.16.1",
21
- "requests~=2.32.3",
22
- "pydantic~=2.12.3",
21
+ "requests~=2.32.5",
22
+ "pydantic~=2.12.5",
23
23
  ]
24
24
 
25
25
  requires-python = ">=3.11,<4"
26
26
 
27
27
  authors = [
28
- { name = "Vitalii Stepanenko", email = "mail@vitalii.in" },
28
+ { name = "Vitalii Stepanenko", email = "mail@vitaliy.in" },
29
29
  ]
30
30
  maintainers = [
31
- { name = "Vitalii Stepanenko", email = "mail@vitalii.in" },
31
+ { name = "Vitalii Stepanenko", email = "mail@vitaliy.in" },
32
32
  ]
33
33
  license = { file = "LICENSE" }
34
34
 
@@ -42,6 +42,16 @@ yml = "lm_proxy.config_loaders:load_yaml_config"
42
42
  yaml = "lm_proxy.config_loaders:load_yaml_config"
43
43
  json = "lm_proxy.config_loaders:load_json_config"
44
44
 
45
+ [project.optional-dependencies]
46
+ test = [
47
+ "pytest~=8.4.2",
48
+ "pytest-asyncio~=1.2.0",
49
+ "pytest-cov~=7.0.0"
50
+ ]
51
+
52
+ [project.scripts]
53
+ openai-http-proxy = "lm_proxy.app:cli_app"
54
+
45
55
  [build-system]
46
56
  requires = ["poetry-core"]
47
57
  build-backend = "poetry.core.masonry.api"
@@ -50,14 +60,6 @@ build-backend = "poetry.core.masonry.api"
50
60
  package-mode = true
51
61
  packages = [{ include = "lm_proxy"}]
52
62
 
53
- [tool.poetry.group.test.dependencies]
54
- pytest = "~=8.4.2"
55
- pytest-asyncio = "~=1.2.0"
56
- pytest-cov = "~7.0.0"
57
-
58
- [tool.poetry.scripts]
59
- openai-http-proxy = "lm_proxy.app:cli_app"
60
-
61
63
  [tool.pytest.ini_options]
62
64
  asyncio_mode = "auto"
63
65
  testpaths = [