diff --git a/assistant_dists/universal_prompted_assistant/dev.yml b/assistant_dists/universal_prompted_assistant/dev.yml index c48d8ae30f..9ae2dbcfe1 100644 --- a/assistant_dists/universal_prompted_assistant/dev.yml +++ b/assistant_dists/universal_prompted_assistant/dev.yml @@ -71,6 +71,12 @@ services: - "./common:/src/common" ports: - 8180:8180 + openai-api-gpt4o: + volumes: + - "./services/openai_api_lm:/src" + - "./common:/src/common" + ports: + - 8181:8181 gigachat-api: volumes: - "./services/gigachat_api_lm:/src" diff --git a/assistant_dists/universal_prompted_assistant/docker-compose.override.yml b/assistant_dists/universal_prompted_assistant/docker-compose.override.yml index adde8dc13f..a865719e50 100644 --- a/assistant_dists/universal_prompted_assistant/docker-compose.override.yml +++ b/assistant_dists/universal_prompted_assistant/docker-compose.override.yml @@ -6,8 +6,8 @@ services: sentence-ranker:8128, transformers-lm-gptjt:8161, openai-api-chatgpt:8145, openai-api-davinci3:8131, openai-api-gpt4:8159, openai-api-gpt4-32k:8160, openai-api-chatgpt-16k:8167, - openai-api-gpt4-turbo:8180, gigachat-api:8187, gigachat-pro-api:8188, gigachat-plus-api:8189, - dff-universal-prompted-skill:8147" + openai-api-gpt4-turbo:8180, openai-api-gpt4o:8181, gigachat-api:8187, gigachat-pro-api:8188, + gigachat-plus-api:8189, dff-universal-prompted-skill:8147" WAIT_HOSTS_TIMEOUT: ${WAIT_TIMEOUT:-1000} sentseg: @@ -220,6 +220,25 @@ services: reservations: memory: 100M + openai-api-gpt4o: + env_file: [ .env ] + build: + args: + SERVICE_PORT: 8181 + SERVICE_NAME: openai_api_gpt4o + PRETRAINED_MODEL_NAME_OR_PATH: gpt-4o + context: . + dockerfile: ./services/openai_api_lm/Dockerfile + command: flask run -h 0.0.0.0 -p 8181 + environment: + - FLASK_APP=server + deploy: + resources: + limits: + memory: 500M + reservations: + memory: 100M + gigachat-api: env_file: [ .env ] build: diff --git a/assistant_dists/universal_ru_prompted_assistant/dev.yml b/assistant_dists/universal_ru_prompted_assistant/dev.yml index d1f91a7fc2..e5b8d691f3 100644 --- a/assistant_dists/universal_ru_prompted_assistant/dev.yml +++ b/assistant_dists/universal_ru_prompted_assistant/dev.yml @@ -67,6 +67,12 @@ services: - "./common:/src/common" ports: - 8180:8180 + openai-api-gpt4o: + volumes: + - "./services/openai_api_lm:/src" + - "./common:/src/common" + ports: + - 8181:8181 gigachat-api: volumes: - "./services/gigachat_api_lm:/src" diff --git a/assistant_dists/universal_ru_prompted_assistant/docker-compose.override.yml b/assistant_dists/universal_ru_prompted_assistant/docker-compose.override.yml index ccffcfed30..237c17b21b 100644 --- a/assistant_dists/universal_ru_prompted_assistant/docker-compose.override.yml +++ b/assistant_dists/universal_ru_prompted_assistant/docker-compose.override.yml @@ -6,8 +6,8 @@ services: dialogrpt-ru:8122, transformers-lm-ruxglm:8171, transformers-lm-rugpt35:8178, openai-api-chatgpt:8145, openai-api-davinci3:8131, openai-api-gpt4:8159, openai-api-gpt4-32k:8160, openai-api-chatgpt-16k:8167, - openai-api-gpt4-turbo:8180, gigachat-api:8187, gigachat-pro-api:8188, gigachat-plus-api:8189, - dff-universal-ru-prompted-skill:8161" + openai-api-gpt4-turbo:8180, openai-api-gpt4o:8181, gigachat-api:8187, gigachat-pro-api:8188, + gigachat-plus-api:8189, dff-universal-ru-prompted-skill:8161" WAIT_HOSTS_TIMEOUT: ${WAIT_TIMEOUT:-1800} HIGH_PRIORITY_INTENTS: 0 RESTRICTION_FOR_SENSITIVE_CASE: 0 @@ -214,6 +214,25 @@ services: reservations: memory: 100M + openai-api-gpt4o: + env_file: [ .env ] + build: + args: + SERVICE_PORT: 8181 + SERVICE_NAME: openai_api_gpt4o + PRETRAINED_MODEL_NAME_OR_PATH: gpt-4o + context: . + dockerfile: ./services/openai_api_lm/Dockerfile + command: flask run -h 0.0.0.0 -p 8181 + environment: + - FLASK_APP=server + deploy: + resources: + limits: + memory: 500M + reservations: + memory: 100M + gigachat-api: env_file: [ .env ] build: diff --git a/components.tsv b/components.tsv index 4aa56fd394..06497b5d8d 100644 --- a/components.tsv +++ b/components.tsv @@ -184,7 +184,7 @@ 8178 transformers-lm-rugpt35 8179 dff-robot-prompted-skill 8180 openai-api-gpt4-turbo -8181 +8181 openai-api-gpt-4o 8182 8183 external-integration-skill 8184 external-fake-server diff --git a/components/jaWueh23hfsdias9cdjasdf.yml b/components/jaWueh23hfsdias9cdjasdf.yml new file mode 100644 index 0000000000..8a845b26f1 --- /dev/null +++ b/components/jaWueh23hfsdias9cdjasdf.yml @@ -0,0 +1,25 @@ +name: openai_api_gpt4o +display_name: GPT-4o +component_type: Generative +model_type: NN-based +is_customizable: false +author: publisher@deeppavlov.ai +description: GPT-4o (“o” for “omni”) is our most advanced model. It is multimodal (accepting text or image inputs and + outputting text), and it has the same high intelligence as GPT-4 Turbo but is much more efficient—it generates text + 2x faster and is 50% cheaper. The maximum number of output tokens for this model is 128000. +ram_usage: 100M +gpu_usage: null +group: services +connector: + protocol: http + timeout: 120.0 + url: http://openai-api-gpt4o:8181/respond +dialog_formatter: null +response_formatter: null +previous_services: null +required_previous_services: null +state_manager_method: null +tags: null +endpoint: respond +service: services/openai_api_lm/service_configs/openai-api-gpt-4o +date_created: '2024-05-15T09:45:32' \ No newline at end of file diff --git a/services/openai_api_lm/server.py b/services/openai_api_lm/server.py index 20b6aa5cc0..c5ec5b9418 100644 --- a/services/openai_api_lm/server.py +++ b/services/openai_api_lm/server.py @@ -32,7 +32,7 @@ "gpt-4-32k": json.load(open("common/generative_configs/openai-chatgpt.json", "r")), "gpt-4-1106-preview": json.load(open("common/generative_configs/openai-chatgpt.json", "r")), } -CHAT_COMPLETION_MODELS = ["gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-4", "gpt-4-32k", "gpt-4-1106-preview"] +CHAT_COMPLETION_MODELS = ["gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-4", "gpt-4-32k", "gpt-4-1106-preview", "gpt-4o"] def generate_responses(context, openai_api_key, openai_org, prompt, generation_params, continue_last_uttr=False): diff --git a/services/openai_api_lm/service_configs/openai-api-gpt-4o/environment.yml b/services/openai_api_lm/service_configs/openai-api-gpt-4o/environment.yml new file mode 100644 index 0000000000..6d41dee067 --- /dev/null +++ b/services/openai_api_lm/service_configs/openai-api-gpt-4o/environment.yml @@ -0,0 +1,4 @@ +SERVICE_PORT: 8181 +SERVICE_NAME: openai-api-gpt4o +PRETRAINED_MODEL_NAME_OR_PATH: gpt-4o +FLASK_APP: server diff --git a/services/openai_api_lm/service_configs/openai-api-gpt-4o/service.yml b/services/openai_api_lm/service_configs/openai-api-gpt-4o/service.yml new file mode 100644 index 0000000000..6017f00136 --- /dev/null +++ b/services/openai_api_lm/service_configs/openai-api-gpt-4o/service.yml @@ -0,0 +1,30 @@ +name: openai-api-gpt4o +endpoints: +- respond +- generate_goals +compose: + env_file: + - .env + build: + args: + SERVICE_PORT: 8181 + SERVICE_NAME: openai_api_gpt4_o + PRETRAINED_MODEL_NAME_OR_PATH: gpt-4o + FLASK_APP: server + context: . + dockerfile: ./services/openai_api_lm/Dockerfile + command: flask run -h 0.0.0.0 -p 8181 + environment: + - FLASK_APP=server + deploy: + resources: + limits: + memory: 100M + reservations: + memory: 100M + volumes: + - ./services/openai_api_lm:/src + - ./common:/src/common + ports: + - 8181:8181 +proxy: null