Skip to content
Closed
Show file tree
Hide file tree
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 Oct 29, 2024
1d30bff
ProductivitySuite: Add docker compose files for Intel Gaudi server al…
sgurunat Oct 29, 2024
8ec0f6a
ProductivitySuite UI: Update names of ChatQnA, CodeGen, DocSum to Dig…
sgurunat Oct 29, 2024
6216b5a
ProductivitySuite UI: Update Docsum to have vertical scroll bar if co…
sgurunat Oct 29, 2024
a6e4a7d
ProductivitySuite UI: Remove <|eot_id|> string from the Chat, Docsum …
sgurunat Oct 29, 2024
b999077
ProductivitySuite UI: Update contextWrapper and contextTitle width to…
sgurunat Oct 29, 2024
cf96dcc
ProductivitySuite UI: Show system prompt input field always to edit i…
sgurunat Oct 29, 2024
debdd0f
ProductivitySuite UI: Update max_new_tokens into max_tokens in Conver…
sgurunat Oct 29, 2024
0a5584a
ProductivitySuite UI: Add multiple models support in ChatQnA. Choose …
sgurunat Oct 29, 2024
4d9b1da
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 30, 2024
594891a
removed langchain related environment variables in ProductivitySuite …
sgurunat Oct 30, 2024
0907b42
removed langchain related environment variables in ProductivitySuite doc
sgurunat Oct 30, 2024
2cd3ea7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 30, 2024
0d3ec68
Merge branch 'main' into multiple-model-with-remote-service
jaswanth8888 Nov 7, 2024
7f6ee31
Merge branch 'main' into multiple-model-with-remote-service
sgurunat Nov 11, 2024
3e4aa57
Updated Dockerfile.wrapper under ChatQnA to clone the git repo instea…
sgurunat Nov 11, 2024
adaa85d
Merge branch 'multiple-model-with-remote-service' of https://github.c…
sgurunat Nov 11, 2024
6f0783e
ProductivitySuite UI: Add model parameter for Codegen so that it work…
sgurunat Nov 11, 2024
46736cc
ProductivitySuite UI: Add model parameter for Docsum so that it works…
sgurunat Nov 11, 2024
740f07a
ProductivitySuite UI: Add model parameter for FaqGen so that it works…
sgurunat Nov 11, 2024
08fd917
Updated compose_remote.yaml file to have vllm instead of tgi. Moved t…
sgurunat Nov 11, 2024
215fa69
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 11, 2024
b0d07f6
ProductivitySuite UI: Updated README of Gaudi docker_compose folder t…
sgurunat Nov 11, 2024
2ace450
Merge branch 'multiple-model-with-remote-service' of https://github.c…
sgurunat Nov 11, 2024
894b13f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 11, 2024
162bd82
ProductivitySuite UI: Deleted README_remote.md file as its contents a…
sgurunat Nov 11, 2024
6ed52b0
Merge branch 'multiple-model-with-remote-service' of https://github.c…
sgurunat Nov 11, 2024
052d3ab
ProductivitySuite UI: Updated LLM_MODEL_ID value in set_env.sh file
sgurunat Nov 11, 2024
461ae9e
ProductivitySuite UI: Deleted set_env_remote.sh file as it is merged …
sgurunat Nov 11, 2024
3bfa45b
ProductivitySuite UI: Update compose.yaml under Gaudi folder with vLL…
sgurunat Nov 11, 2024
16e2c11
ProductivitySuite UI: Removed langchain environment variables in comp…
sgurunat Nov 11, 2024
c88d9d7
ProductivitySuite UI: Delete compose_tgi_remote.yaml file as it is no…
sgurunat Nov 11, 2024
96e797e
Merge branch 'main' into multiple-model-with-remote-service
sgurunat Nov 12, 2024
20908bd
ProductivitySuite UI: Fixed Keycloak path issue
sgurunat Nov 12, 2024
53500d1
Merge branch 'multiple-model-with-remote-service' of https://github.c…
sgurunat Nov 12, 2024
d7414b9
Merge branch 'main' into multiple-model-with-remote-service
sgurunat Nov 13, 2024
502f2d5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 13, 2024
de76c7a
Merge branch 'main' into multiple-model-with-remote-service
sgurunat Nov 13, 2024
4df84e5
Merge branch 'main' into multiple-model-with-remote-service
sgurunat Nov 14, 2024
bdc873f
added test_compose_on_gaudi.sh file
sgurunat Nov 14, 2024
159b58b
Merge branch 'multiple-model-with-remote-service' of https://github.c…
sgurunat Nov 14, 2024
d023af8
Merge branch 'main' into multiple-model-with-remote-service
sgurunat Nov 14, 2024
0bc52a5
Merge branch 'main' into multiple-model-with-remote-service
sgurunat Nov 14, 2024
d961b30
Modified test_compose_on_gaudi compose to use build.yaml file
sgurunat Nov 14, 2024
bd97160
Updated compose.yaml file in gaudi folder related to codegen
sgurunat Nov 14, 2024
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
34 changes: 34 additions & 0 deletions ChatQnA/Dockerfile.wrapper
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"]
68 changes: 68 additions & 0 deletions ChatQnA/chatqna_wrapper.py
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()
Loading
Loading