openai-http-proxy 3.3.1__tar.gz → 3.4.0__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. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/PKG-INFO +12 -11
  2. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/README.md +1 -0
  3. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/lm_proxy/base_types.py +1 -1
  4. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/lm_proxy/core.py +17 -2
  5. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/pyproject.toml +11 -11
  6. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/LICENSE +0 -0
  7. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/lm_proxy/__init__.py +0 -0
  8. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/lm_proxy/__main__.py +0 -0
  9. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/lm_proxy/api_key_check/__init__.py +0 -0
  10. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/lm_proxy/api_key_check/allow_all.py +0 -0
  11. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/lm_proxy/api_key_check/in_config.py +0 -0
  12. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/lm_proxy/api_key_check/with_request.py +0 -0
  13. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/lm_proxy/app.py +0 -0
  14. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/lm_proxy/bootstrap.py +0 -0
  15. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/lm_proxy/config.py +0 -0
  16. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/lm_proxy/config_loaders/__init__.py +0 -0
  17. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/lm_proxy/config_loaders/json.py +0 -0
  18. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/lm_proxy/config_loaders/python.py +0 -0
  19. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/lm_proxy/config_loaders/toml.py +0 -0
  20. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/lm_proxy/config_loaders/yaml.py +0 -0
  21. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/lm_proxy/errors.py +0 -0
  22. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/lm_proxy/handlers/__init__.py +0 -0
  23. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/lm_proxy/handlers/forward_http_headers.py +0 -0
  24. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/lm_proxy/handlers/rate_limiter.py +0 -0
  25. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/lm_proxy/loggers.py +0 -0
  26. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/lm_proxy/models_endpoint.py +0 -0
  27. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/lm_proxy/strategies/__init__.py +0 -0
  28. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/lm_proxy/strategies/fallback.py +0 -0
  29. {openai_http_proxy-3.3.1 → openai_http_proxy-3.4.0}/lm_proxy/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openai-http-proxy
3
- Version: 3.3.1
3
+ Version: 3.4.0
4
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-Expression: MIT
6
6
  License-File: LICENSE
@@ -25,20 +25,20 @@ Provides-Extra: all
25
25
  Provides-Extra: anthropic
26
26
  Provides-Extra: google
27
27
  Provides-Extra: test
28
- Requires-Dist: ai-microcore (>=6.7.1,<7)
29
- Requires-Dist: anthropic (>=0.77,<1) ; extra == "all"
30
- Requires-Dist: anthropic (>=0.77,<1) ; extra == "anthropic"
31
- Requires-Dist: fastapi (>=0.136.3,<1)
32
- Requires-Dist: google-genai (>=1.62.0,<2) ; extra == "all"
33
- Requires-Dist: google-genai (>=1.62.0,<2) ; extra == "google"
28
+ Requires-Dist: ai-microcore (>=6.10.0,<7)
29
+ Requires-Dist: anthropic (>=0.77,<2) ; extra == "all"
30
+ Requires-Dist: anthropic (>=0.77,<2) ; extra == "anthropic"
31
+ Requires-Dist: fastapi (>=0.141.1,<1)
32
+ Requires-Dist: google-genai (>=1.62.0,<3) ; extra == "all"
33
+ Requires-Dist: google-genai (>=1.62.0,<3) ; extra == "google"
34
34
  Requires-Dist: pydantic (>=2.12.5,<2.13.0)
35
35
  Requires-Dist: pytest (>=9.1.1,<9.2.0) ; extra == "test"
36
36
  Requires-Dist: pytest-asyncio (>=1.4.0,<1.5.0) ; extra == "test"
37
37
  Requires-Dist: pytest-cov (>=7.1.0,<7.2.0) ; extra == "test"
38
- Requires-Dist: requests (>=2.32.5,<3)
39
- Requires-Dist: typer (>=0.24.0,<1)
40
- Requires-Dist: uvicorn (>=0.41.0)
41
- Requires-Dist: websockets (>=14.0,<16)
38
+ Requires-Dist: requests (>=2.34.2,<3)
39
+ Requires-Dist: typer (>=0.27.1,<1)
40
+ Requires-Dist: uvicorn (>=0.52.4)
41
+ Requires-Dist: websockets (>=14.0,<17)
42
42
  Project-URL: Bug Tracker, https://github.com/Nayjest/lm-proxy/issues
43
43
  Project-URL: Source Code, https://github.com/Nayjest/lm-proxy
44
44
  Description-Content-Type: text/markdown
@@ -53,6 +53,7 @@ Description-Content-Type: text/markdown
53
53
  <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>
54
54
  <img src="https://raw.githubusercontent.com/Nayjest/lm-proxy/coverage-badge/coverage.svg" alt="Code Coverage">
55
55
  <a href="https://www.bestpractices.dev/projects/11364"><img src="https://www.bestpractices.dev/projects/11364/badge"></a>
56
+ <a href="https://inspect.software/software/Nayjest/lm-proxy"><img src="https://raw.githubusercontent.com/inspect-software/badges/main/v1/n/Nayjest/lm-proxy.svg" alt="Software Health"></a>
56
57
  <br>
57
58
  <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>
58
59
  <a href="https://github.com/Nayjest/lm-proxy/blob/main/LICENSE"><img src="https://img.shields.io/github/license/Nayjest/lm-proxy?color=d08aff" alt="License"></a>
@@ -8,6 +8,7 @@
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
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
+ <a href="https://inspect.software/software/Nayjest/lm-proxy"><img src="https://raw.githubusercontent.com/inspect-software/badges/main/v1/n/Nayjest/lm-proxy.svg" alt="Software Health"></a>
11
12
  <br>
12
13
  <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>
13
14
  <a href="https://github.com/Nayjest/lm-proxy/blob/main/LICENSE"><img src="https://img.shields.io/github/license/Nayjest/lm-proxy?color=d08aff" alt="License"></a>
@@ -48,7 +48,7 @@ class ChatCompletionRequest(BaseModel):
48
48
  stop: Optional[Union[str, List[str]]] = None
49
49
  store: Optional[bool] = None
50
50
  stream_options: Optional[dict] = None
51
- tool_choice: Optional[dict] = None
51
+ tool_choice: Optional[Union[str, dict]] = None
52
52
  top_logprobs: Optional[int] = None
53
53
  verbosity: Optional[str] = None
54
54
  web_search_options: Optional[dict] = None
@@ -145,10 +145,25 @@ async def process_stream(
145
145
  ctx.response = result
146
146
  except Exception as e:
147
147
  ctx.error = e
148
- yield make_chunk(error={"message": str(e), "type": type(e).__name__})
148
+ yield make_chunk(error=e)
149
149
  finish_printing_llm_response(ctx)
150
150
 
151
- yield make_chunk(finish_reason="error" if ctx.error else "stop")
151
+ if tool_calls := getattr(ctx.response, "tool_calls", None):
152
+ yield make_chunk(
153
+ delta={
154
+ "tool_calls": [
155
+ {
156
+ "index": i,
157
+ "id": call.id,
158
+ "type": "function",
159
+ "function": {"name": call.name, "arguments": call.arguments},
160
+ }
161
+ for i, call in enumerate(tool_calls)
162
+ ]
163
+ }
164
+ )
165
+ finish_reason = getattr(ctx.response, "finish_reason", None) or "stop"
166
+ yield make_chunk(finish_reason="error" if ctx.error else finish_reason)
152
167
  yield "data: [DONE]\n\n"
153
168
  await log_non_blocking(ctx)
154
169
  if ctx.error:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "openai-http-proxy"
3
- version = "3.3.1"
3
+ version = "3.4.0"
4
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", "llm gateway", "openai", "anthropic", "google genai"]
@@ -34,13 +34,13 @@ documentation = "https://github.com/Nayjest/lm-proxy#readme"
34
34
  license = "MIT"
35
35
 
36
36
  dependencies = [
37
- "ai-microcore>=6.7.1,<7",
38
- "fastapi>=0.136.3,<1",
39
- "uvicorn>=0.41.0",
40
- "typer>=0.24.0,<1",
41
- "requests>=2.32.5,<3",
37
+ "ai-microcore>=6.10.0,<7",
38
+ "fastapi>=0.141.1,<1",
39
+ "uvicorn>=0.52.4",
40
+ "typer>=0.27.1,<1",
41
+ "requests>=2.34.2,<3",
42
42
  "pydantic~=2.12.5",
43
- "websockets>=14.0,<16",
43
+ "websockets>=14.0,<17",
44
44
  ]
45
45
 
46
46
  [project.optional-dependencies]
@@ -50,14 +50,14 @@ test = [
50
50
  "pytest-cov~=7.1.0"
51
51
  ]
52
52
  google = [
53
- "google-genai>=1.62.0,<2",
53
+ "google-genai>=1.62.0,<3",
54
54
  ]
55
55
  anthropic = [
56
- "anthropic>=0.77,<1",
56
+ "anthropic>=0.77,<2",
57
57
  ]
58
58
  all = [
59
- "google-genai>=1.62.0,<2",
60
- "anthropic>=0.77,<1",
59
+ "google-genai>=1.62.0,<3",
60
+ "anthropic>=0.77,<2",
61
61
  ]
62
62
 
63
63
  [project.urls]