Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(proxy - RPS) - Get 2K RPS at 4 instances, minor fix aiohttp_openai/ #7659

Merged
merged 4 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions litellm/llms/aiohttp_openai/chat/transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from litellm.llms.openai_like.chat.transformation import OpenAILikeChatConfig
from litellm.types.llms.openai import AllMessageValues
from litellm.types.utils import ModelResponse
from litellm.types.utils import Choices, ModelResponse

if TYPE_CHECKING:
from litellm.litellm_core_utils.litellm_logging import Logging as _LiteLLMLoggingObj
Expand Down Expand Up @@ -66,4 +66,12 @@ async def transform_response( # type: ignore
json_mode: Optional[bool] = None,
) -> ModelResponse:
_json_response = await raw_response.json()
return ModelResponse(**_json_response)
model_response.id = _json_response.get("id")
model_response.choices = [
Choices(**choice) for choice in _json_response.get("choices")
]
model_response.created = _json_response.get("created")
model_response.model = _json_response.get("model")
model_response.object = _json_response.get("object")
model_response.system_fingerprint = _json_response.get("system_fingerprint")
return model_response
2 changes: 1 addition & 1 deletion tests/llm_translation/test_aiohttp_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

sys.path.insert(
0, os.path.abspath("../../")
) # Adds the parent directory to the system path
) # Adds the parent directory to the system-path

import litellm

Expand Down
Loading