Skip to content

Support chat models in dstack-proxy#1953

Merged
jvstme merged 2 commits intomasterfrom
issue_1595_openai
Nov 5, 2024
Merged

Support chat models in dstack-proxy#1953
jvstme merged 2 commits intomasterfrom
issue_1595_openai

Conversation

@jvstme
Copy link
Copy Markdown
Collaborator

@jvstme jvstme commented Nov 4, 2024

This commit adds the OpenAI-compatible endpoint
to dstack-proxy, which effectively allows running
services with model mappings without a gateway.

Most of the OpenAI- and TGI-specific code is
copied from dstack-gateway. This code
duplication will be eliminated later, once
dstack-proxy supports running on gateways.

The commit also contains some refactoring in
dstack-proxy: introduces ProxyError and
UnexpectedProxyError exceptions and simplifies
error logging in service_proxy.py.

Behind the PROXY feature flag.

Part of #1595

This commit adds the OpenAI-compatible endpoint to
`dstack-proxy`, which effectively allow running
services with model mappings without a gateway.

Most of the OpenAI- and TGI-specific code is
copied from `dstack-gateway`. This code
duplication will be eliminated later, once
`dstack-proxy` supports running on gateways.

The commit also contains some refactoring in
`dstack-proxy`: introduces `ProxyError` and
`UnexpectedProxyError` exceptions and simplifies
error logging in `service_proxy.py`.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied from dstack-gateway with minor adjustments

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The next 3 files were copied from dstack-gateway with minor adjustments

@jvstme jvstme requested a review from r4victor November 4, 2024 14:05
Pydantic can actually work with two discriminators
as long as all classes define both.
@jvstme jvstme merged commit f139f01 into master Nov 5, 2024
@jvstme jvstme deleted the issue_1595_openai branch November 5, 2024 07:43
superprat pushed a commit to bahaal-tech/dstack that referenced this pull request Dec 20, 2024
This commit adds the OpenAI-compatible endpoint to
`dstack-proxy`, which effectively allows running
services with model mappings without a gateway.

Most of the OpenAI- and TGI-specific code is
copied from `dstack-gateway`. This code
duplication will be eliminated later, once
`dstack-proxy` supports running on gateways.

The commit also contains some refactoring in
`dstack-proxy`: introduces `ProxyError` and
`UnexpectedProxyError` exceptions and simplifies
error logging in `service_proxy.py`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants