Skip to content

Commit

Permalink
removed langchain related environment variables in ProductivitySuite doc
Browse files Browse the repository at this point in the history
ker compose files
  • Loading branch information
sgurunat committed Oct 30, 2024
2 parents 594891a + 4d9b1da commit 0907b42
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 55 deletions.
81 changes: 42 additions & 39 deletions ProductivitySuite/docker_compose/intel/hpu/gaudi/README_remote.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Build Mega Service of Productivity Suite

This document outlines the deployment process for OPEA Productivity Suite utilizing the [GenAIComps](https://github.com/opea-project/GenAIComps.git) microservice pipeline on Intel Gaudi server and [GenAIExamples](https://github.com/opea-project/GenAIExamples.git) solutions. The steps include Docker image creation, container deployment via Docker Compose, and service execution to integrate microservices such as `embedding`, `retriever`, `rerank`, and `llm`.
This document outlines the deployment process for OPEA Productivity Suite utilizing the [GenAIComps](https://github.com/opea-project/GenAIComps.git) microservice pipeline on Intel Gaudi server and [GenAIExamples](https://github.com/opea-project/GenAIExamples.git) solutions. The steps include Docker image creation, container deployment via Docker Compose, and service execution to integrate microservices such as `embedding`, `retriever`, `rerank`, and `llm`.

## 🚀 Build Docker Images

Expand All @@ -10,6 +10,7 @@ Create a directory and clone the GenAIComps repository
mkdir genai
git clone --branch v1.0 https://github.com/opea-project/GenAIComps.git
```

Copy patch files related to GenAIComps inside GenAIComps folder and apply the patch

```bash
Expand Down Expand Up @@ -68,6 +69,7 @@ cd GenAIExamples
Copy the patch files related to GenAIExamples into above cloned GenAIExamples folder

Apply the patches

```bash
git am *.patch
```
Expand Down Expand Up @@ -177,10 +179,10 @@ export tgi_endpoint="Your_Remote_TGI_Endpoint"
```

**To use multiple TGI models**

> Create the model_configs.json file under /GenAIExamples/ProductivitySuite/docker_compose/intel/hpu/gaudi folder
> Add the model details as shown in the below example

```bash
cd ..
cd docker_compose/intel/hpu/gaudi
Expand All @@ -190,46 +192,46 @@ touch model_configs.json
File Structure:

[
{
"model_name": "Your Model Name",
"displayName": "Model Display Name for the UI",
"endpoint": "Model Endpoint with http/https",
"minToken": 100, //Min Token Value
"maxToken": 2000 //Max Token Value
},
{
"model_name": "Your Model Name",
"displayName": "Model Display Name for the UI",
"endpoint": "Model Endpoint with http/https",
"minToken": 100, //Min Token Value
"maxToken": 2000 //Max Token Value
}
{
"model_name": "Your Model Name",
"displayName": "Model Display Name for the UI",
"endpoint": "Model Endpoint with http/https",
"minToken": 100, //Min Token Value
"maxToken": 2000 //Max Token Value
},
{
"model_name": "Your Model Name",
"displayName": "Model Display Name for the UI",
"endpoint": "Model Endpoint with http/https",
"minToken": 100, //Min Token Value
"maxToken": 2000 //Max Token Value
}
]

Example:

[
{
"model_name": "meta-llama/Meta-Llama-3.1-70B-Instruct",
"displayName": "llama-3.1-70B",
"endpoint": "https://<host>/<endpoint>",
"minToken": 100,
"maxToken": 2000
},
{
"model_name": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"displayName": "llama-3.1-8B",
"endpoint": "https://<host>/<endpoint>",
"minToken": 100,
"maxToken": 2000
},
{
"model_name": "Intel/neural-chat-7b-v3-3",
"displayName": "neural chat",
"endpoint": "https://<host>/<endpoint>",
"minToken": 100,
"maxToken": 1000
}
{
"model_name": "meta-llama/Meta-Llama-3.1-70B-Instruct",
"displayName": "llama-3.1-70B",
"endpoint": "https://<host>/<endpoint>",
"minToken": 100,
"maxToken": 2000
},
{
"model_name": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"displayName": "llama-3.1-8B",
"endpoint": "https://<host>/<endpoint>",
"minToken": 100,
"maxToken": 2000
},
{
"model_name": "Intel/neural-chat-7b-v3-3",
"displayName": "neural chat",
"endpoint": "https://<host>/<endpoint>",
"minToken": 100,
"maxToken": 1000
}
]

> After creating and adding details in the model_configs.json file. Copy the same file into the public folder of the UI
Expand All @@ -252,16 +254,19 @@ Note: Please replace with `host_ip` with you external IP address, do not use loc
### Start all the services Docker Containers

#### Run all services locally

```bash
docker compose -f compose.yaml up -d
```

#### Run TGI and TEI inference remote

```bash
docker compose -f compose_remote.yaml up -d
```

#### Run only TGI remote

```bash
docker compose -f compose_tgi_remote.yaml up -d
```
Expand All @@ -270,8 +275,6 @@ docker compose -f compose_tgi_remote.yaml up -d

Please refer to [keycloak_setup_guide](keycloak_setup_guide.md) for more detail related to Keycloak configuration setup.


## 🚀 Launch the UI

To access the frontend, open the following URL in your browser: http://{host_ip}:5174.

Original file line number Diff line number Diff line change
Expand Up @@ -377,4 +377,4 @@ services:
restart: always
networks:
default:
driver: bridge
driver: bridge
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ services:
CLIENTID: ${CLIENTID}
CLIENT_SECRET: ${CLIENT_SECRET}
TOKEN_URL: ${TOKEN_URL}

restart: unless-stopped
chatqna-gaudi-backend-server:
image: ${REGISTRY:-opea}/chatqna:${TAG:-latest}
Expand Down Expand Up @@ -259,7 +259,7 @@ services:
- KEYCLOAK_ADMIN_PASSWORD=admin
- KC_PROXY=edge
ipc: host
command:
command:
- start-dev
restart: always
productivity-suite-gaudi-react-ui-server:
Expand All @@ -285,4 +285,4 @@ services:
restart: always
networks:
default:
driver: bridge
driver: bridge
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ services:
CLIENTID: ${CLIENTID}
CLIENT_SECRET: ${CLIENT_SECRET}
TOKEN_URL: ${TOKEN_URL}

restart: unless-stopped
chatqna-gaudi-backend-server:
image: ${REGISTRY:-opea}/chatqna:${TAG:-latest}
Expand Down Expand Up @@ -333,4 +333,4 @@ services:
restart: always
networks:
default:
driver: bridge
driver: bridge
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ export LLM_SERVICE_HOST_PORT_DOCSUM=9003
export PROMPT_COLLECTION_NAME="prompt"
export CLIENTID=${clientid}
export CLIENT_SECRET=${client_secret}
export TOKEN_URL=${token_url}
export TOKEN_URL=${token_url}
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ type file = {
export type Model = {
model_name: string;
displayName: string;
minToken: number,
maxToken:number
}
minToken: number;
maxToken: number;
};

export interface ConversationReducer {
selectedConversationId: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
CHAT_HISTORY_GET,
CHAT_HISTORY_DELETE,
} from "../../config";
import { Model } from './Conversation';
import { Model } from "./Conversation";

const initialState: ConversationReducer = {
conversations: [],
Expand Down Expand Up @@ -79,9 +79,9 @@ export const ConversationSlice = createSlice({
setMaxToken: (state, action: PayloadAction<number>) => {
state.maxToken = action.payload;
},
setModels: (state, action: PayloadAction<Model []>) => {
setModels: (state, action: PayloadAction<Model[]>) => {
state.models = action.payload;
}
},
},
extraReducers(builder) {
builder.addCase(uploadFile.fulfilled, () => {
Expand Down Expand Up @@ -245,7 +245,7 @@ export const deleteConversation = createAsyncThunkWrapper(

export const doConversation = (conversationRequest: ConversationRequest) => {
const { conversationId, userPrompt, messages, model, token, temperature } = conversationRequest;
if(messages.length==1){
if (messages.length == 1) {
store.dispatch(addMessageToMessages(messages[0]));
}
store.dispatch(addMessageToMessages(userPrompt));
Expand Down Expand Up @@ -287,7 +287,7 @@ export const doConversation = (conversationRequest: ConversationRequest) => {
const match = msg.data.match(/b'([^']*)'/);
if (match && match[1] != "</s>") {
const extractedText = match[1];
result += extractedText.replace("<|eot_id|>","").replace(/\\n/g, "\n");
result += extractedText.replace("<|eot_id|>", "").replace(/\\n/g, "\n");
store.dispatch(setOnGoingResult(result));
}
} catch (e) {
Expand Down Expand Up @@ -340,7 +340,7 @@ export const {
setModel,
setMinToken,
setMaxToken,
setModels
setModels,
} = ConversationSlice.actions;
export const conversationSelector = (state: RootState) => state.conversationReducer;
export default ConversationSlice.reducer;

0 comments on commit 0907b42

Please sign in to comment.