-
Notifications
You must be signed in to change notification settings - Fork 331
Multiple model selection with remote service #1049
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
Closed
sgurunat
wants to merge
45
commits into
opea-project:main
from
sgurunat:multiple-model-with-remote-service
+2,095
−43
Closed
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
a3ef260
Add chatqna_wrapper.py along with updated Dockerfile.wrapper. To sup…
sgurunat 1d30bff
ProductivitySuite: Add docker compose files for Intel Gaudi server al…
sgurunat 8ec0f6a
ProductivitySuite UI: Update names of ChatQnA, CodeGen, DocSum to Dig…
sgurunat 6216b5a
ProductivitySuite UI: Update Docsum to have vertical scroll bar if co…
sgurunat a6e4a7d
ProductivitySuite UI: Remove <|eot_id|> string from the Chat, Docsum …
sgurunat b999077
ProductivitySuite UI: Update contextWrapper and contextTitle width to…
sgurunat cf96dcc
ProductivitySuite UI: Show system prompt input field always to edit i…
sgurunat debdd0f
ProductivitySuite UI: Update max_new_tokens into max_tokens in Conver…
sgurunat 0a5584a
ProductivitySuite UI: Add multiple models support in ChatQnA. Choose …
sgurunat 4d9b1da
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 594891a
removed langchain related environment variables in ProductivitySuite …
sgurunat 0907b42
removed langchain related environment variables in ProductivitySuite doc
sgurunat 2cd3ea7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 0d3ec68
Merge branch 'main' into multiple-model-with-remote-service
jaswanth8888 7f6ee31
Merge branch 'main' into multiple-model-with-remote-service
sgurunat 3e4aa57
Updated Dockerfile.wrapper under ChatQnA to clone the git repo instea…
sgurunat adaa85d
Merge branch 'multiple-model-with-remote-service' of https://github.c…
sgurunat 6f0783e
ProductivitySuite UI: Add model parameter for Codegen so that it work…
sgurunat 46736cc
ProductivitySuite UI: Add model parameter for Docsum so that it works…
sgurunat 740f07a
ProductivitySuite UI: Add model parameter for FaqGen so that it works…
sgurunat 08fd917
Updated compose_remote.yaml file to have vllm instead of tgi. Moved t…
sgurunat 215fa69
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] b0d07f6
ProductivitySuite UI: Updated README of Gaudi docker_compose folder t…
sgurunat 2ace450
Merge branch 'multiple-model-with-remote-service' of https://github.c…
sgurunat 894b13f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 162bd82
ProductivitySuite UI: Deleted README_remote.md file as its contents a…
sgurunat 6ed52b0
Merge branch 'multiple-model-with-remote-service' of https://github.c…
sgurunat 052d3ab
ProductivitySuite UI: Updated LLM_MODEL_ID value in set_env.sh file
sgurunat 461ae9e
ProductivitySuite UI: Deleted set_env_remote.sh file as it is merged …
sgurunat 3bfa45b
ProductivitySuite UI: Update compose.yaml under Gaudi folder with vLL…
sgurunat 16e2c11
ProductivitySuite UI: Removed langchain environment variables in comp…
sgurunat c88d9d7
ProductivitySuite UI: Delete compose_tgi_remote.yaml file as it is no…
sgurunat 96e797e
Merge branch 'main' into multiple-model-with-remote-service
sgurunat 20908bd
ProductivitySuite UI: Fixed Keycloak path issue
sgurunat 53500d1
Merge branch 'multiple-model-with-remote-service' of https://github.c…
sgurunat d7414b9
Merge branch 'main' into multiple-model-with-remote-service
sgurunat 502f2d5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] de76c7a
Merge branch 'main' into multiple-model-with-remote-service
sgurunat 4df84e5
Merge branch 'main' into multiple-model-with-remote-service
sgurunat bdc873f
added test_compose_on_gaudi.sh file
sgurunat 159b58b
Merge branch 'multiple-model-with-remote-service' of https://github.c…
sgurunat d023af8
Merge branch 'main' into multiple-model-with-remote-service
sgurunat 0bc52a5
Merge branch 'main' into multiple-model-with-remote-service
sgurunat d961b30
Modified test_compose_on_gaudi compose to use build.yaml file
sgurunat bd97160
Updated compose.yaml file in gaudi folder related to codegen
sgurunat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
|
|
||
|
|
||
| # Copyright (C) 2024 Intel Corporation | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| FROM python:3.11-slim | ||
|
|
||
| RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ | ||
| libgl1-mesa-glx \ | ||
| libjemalloc-dev \ | ||
| git | ||
|
|
||
| RUN useradd -m -s /bin/bash user && \ | ||
| mkdir -p /home/user && \ | ||
| chown -R user /home/user/ | ||
|
|
||
| WORKDIR /home/user/ | ||
| RUN git clone https://github.com/opea-project/GenAIComps.git | ||
|
|
||
| WORKDIR /home/user/GenAIComps | ||
| RUN pip install --no-cache-dir --upgrade pip && \ | ||
| pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt | ||
|
|
||
| COPY ./chatqna_wrapper.py /home/user/chatqna.py | ||
|
|
||
| ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps | ||
|
|
||
| USER user | ||
|
|
||
| WORKDIR /home/user | ||
|
|
||
| RUN echo 'ulimit -S -n 999999' >> ~/.bashrc | ||
|
|
||
| ENTRYPOINT ["python", "chatqna.py"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| # Copyright (C) 2024 Intel Corporation | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| import os | ||
|
|
||
| from comps import ChatQnAGateway, MicroService, ServiceOrchestrator, ServiceType | ||
|
|
||
| MEGA_SERVICE_HOST_IP = os.getenv("MEGA_SERVICE_HOST_IP", "0.0.0.0") | ||
| MEGA_SERVICE_PORT = int(os.getenv("MEGA_SERVICE_PORT", 8888)) | ||
| EMBEDDING_SERVICE_HOST_IP = os.getenv("EMBEDDING_SERVICE_HOST_IP", "0.0.0.0") | ||
| EMBEDDING_SERVICE_PORT = int(os.getenv("EMBEDDING_SERVICE_PORT", 6000)) | ||
| RETRIEVER_SERVICE_HOST_IP = os.getenv("RETRIEVER_SERVICE_HOST_IP", "0.0.0.0") | ||
| RETRIEVER_SERVICE_PORT = int(os.getenv("RETRIEVER_SERVICE_PORT", 7000)) | ||
| RERANK_SERVICE_HOST_IP = os.getenv("RERANK_SERVICE_HOST_IP", "0.0.0.0") | ||
| RERANK_SERVICE_PORT = int(os.getenv("RERANK_SERVICE_PORT", 8000)) | ||
| LLM_SERVICE_HOST_IP = os.getenv("LLM_SERVICE_HOST_IP", "0.0.0.0") | ||
| LLM_SERVICE_PORT = int(os.getenv("LLM_SERVICE_PORT", 9000)) | ||
|
|
||
|
|
||
| class ChatQnAService: | ||
| def __init__(self, host="0.0.0.0", port=8000): | ||
| self.host = host | ||
| self.port = port | ||
| self.megaservice = ServiceOrchestrator() | ||
|
|
||
| def add_remote_service(self): | ||
| embedding = MicroService( | ||
| name="embedding", | ||
| host=EMBEDDING_SERVICE_HOST_IP, | ||
| port=EMBEDDING_SERVICE_PORT, | ||
| endpoint="/v1/embeddings", | ||
| use_remote_service=True, | ||
| service_type=ServiceType.EMBEDDING, | ||
| ) | ||
| retriever = MicroService( | ||
| name="retriever", | ||
| host=RETRIEVER_SERVICE_HOST_IP, | ||
| port=RETRIEVER_SERVICE_PORT, | ||
| endpoint="/v1/retrieval", | ||
| use_remote_service=True, | ||
| service_type=ServiceType.RETRIEVER, | ||
| ) | ||
| rerank = MicroService( | ||
| name="rerank", | ||
| host=RERANK_SERVICE_HOST_IP, | ||
| port=RERANK_SERVICE_PORT, | ||
| endpoint="/v1/reranking", | ||
| use_remote_service=True, | ||
| service_type=ServiceType.RERANK, | ||
| ) | ||
| llm = MicroService( | ||
| name="llm", | ||
| host=LLM_SERVICE_HOST_IP, | ||
| port=LLM_SERVICE_PORT, | ||
| endpoint="/v1/chat/completions", | ||
| use_remote_service=True, | ||
| service_type=ServiceType.LLM, | ||
| ) | ||
| self.megaservice.add(embedding).add(retriever).add(rerank).add(llm) | ||
| self.megaservice.flow_to(embedding, retriever) | ||
| self.megaservice.flow_to(retriever, rerank) | ||
| self.megaservice.flow_to(rerank, llm) | ||
| self.gateway = ChatQnAGateway(megaservice=self.megaservice, host="0.0.0.0", port=self.port) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| chatqna = ChatQnAService(host=MEGA_SERVICE_HOST_IP, port=MEGA_SERVICE_PORT) | ||
| chatqna.add_remote_service() |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.