Skip to content

Commit

Permalink
use ingress/egress
Browse files Browse the repository at this point in the history
  • Loading branch information
adilhafeez committed Feb 15, 2025
1 parent 4a957f2 commit 136daa2
Show file tree
Hide file tree
Showing 18 changed files with 31 additions and 27 deletions.
7 changes: 3 additions & 4 deletions arch/arch_config_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ properties:
type: string
listeners:
type: object
additionalProperties: false
properties:
prompt_gateway:
ingress_traffic:
type: object
properties:
address:
Expand All @@ -20,7 +21,7 @@ properties:
timeout:
type: string
additionalProperties: false
llm_gateway:
egress_traffic:
type: object
properties:
address:
Expand All @@ -31,7 +32,6 @@ properties:
type: string
enum:
- openai
- huggingface
timeout:
type: string
additionalProperties: false
Expand Down Expand Up @@ -247,5 +247,4 @@ properties:
additionalProperties: false
required:
- version
- listeners
- llm_providers
6 changes: 4 additions & 2 deletions arch/tools/cli/config_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,17 @@ def validate_and_render_schema():
arch_config_string = yaml.dump(config_yaml)
arch_llm_config_string = yaml.dump(config_yaml)

prompt_gateway_listener = config_yaml.get("listeners", {}).get("prompt_gateway", {})
prompt_gateway_listener = config_yaml.get("listeners", {}).get(
"ingress_traffic", {}
)
if prompt_gateway_listener.get("port") == None:
prompt_gateway_listener["port"] = 10000 # default port for prompt gateway
if prompt_gateway_listener.get("address") == None:
prompt_gateway_listener["address"] = "127.0.0.1"
if prompt_gateway_listener.get("timeout") == None:
prompt_gateway_listener["timeout"] = "10s"

llm_gateway_listener = config_yaml.get("listeners", {}).get("llm_gateway", {})
llm_gateway_listener = config_yaml.get("listeners", {}).get("egress_traffic", {})
if llm_gateway_listener.get("port") == None:
llm_gateway_listener["port"] = 12000 # default port for llm gateway
if llm_gateway_listener.get("address") == None:
Expand Down
4 changes: 2 additions & 2 deletions arch/tools/cli/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@ def start_arch(arch_config_file, env, log_timeout=120, foreground=False):

prompt_gateway_port = (
arch_config_dict.get("listeners", {})
.get("prompt_gateway", {})
.get("ingress_traffic", {})
.get("port", 10000)
)
llm_gateway_port = (
arch_config_dict.get("listeners", {})
.get("llm_gateway", {})
.get("egress_traffic", {})
.get("port", 12000)
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: v0.1
listeners:
prompt_gateway:
ingress_traffic:
address: 0.0.0.0
port: 10000
message_format: openai
Expand Down
2 changes: 1 addition & 1 deletion demos/samples_python/currency_exchange/arch_config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: v0.1

listeners:
prompt_gateway:
ingress_traffic:
address: 0.0.0.0
port: 10000
message_format: openai
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: v0.1
listeners:
prompt_gateway:
ingress_traffic:
address: 0.0.0.0
port: 10000
message_format: openai
Expand Down
2 changes: 1 addition & 1 deletion demos/samples_python/multi_turn_rag_agent/arch_config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: v0.1

listeners:
prompt_gateway:
ingress_traffic:
address: 0.0.0.0
port: 10000
message_format: openai
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: v0.1
listeners:
prompt_gateway:
ingress_traffic:
address: 0.0.0.0
port: 10000
message_format: openai
Expand Down
3 changes: 2 additions & 1 deletion demos/samples_python/stock_quote/arch_config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
version: v0.1

listeners:
prompt_gateway:
ingress_traffic:
address: 0.0.0.0
port: 10000
message_format: openai
timeout: 30s

llm_providers:
- name: gpt-4o
access_key: $OPENAI_API_KEY
Expand Down
2 changes: 1 addition & 1 deletion demos/samples_python/weather_forecast/arch_config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "0.1-beta"

listeners:
prompt_gateway:
ingress_traffic:
address: 0.0.0.0
port: 10000
message_format: openai
Expand Down
4 changes: 2 additions & 2 deletions demos/use_cases/llm_routing/arch_config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: "0.1-beta"

listeners:
prompt_gateway:
egress_traffic:
address: 0.0.0.0
port: 10000
port: 12000
message_format: openai
timeout: 30s

Expand Down
2 changes: 1 addition & 1 deletion demos/use_cases/ollama/arch_config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: v0.1

listeners:
prompt_gateway:
ingress_traffic:
address: 0.0.0.0
port: 10000
message_format: openai
Expand Down
2 changes: 1 addition & 1 deletion demos/use_cases/spotify_bearer_auth/arch_config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: v0.1
listeners:
prompt_gateway:
ingress_traffic:
address: 0.0.0.0
port: 10000
message_format: openai
Expand Down
2 changes: 1 addition & 1 deletion docs/source/concepts/includes/arch_config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: v0.1

listeners:
prompt_gateway:
ingress_traffic:
address: 0.0.0.0
port: 10000
message_format: openai
Expand Down
6 changes: 3 additions & 3 deletions docs/source/get_started/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Create ``arch_config.yaml`` file with the following content:
version: v0.1
listeners:
prompt_gateway:
ingress_traffic:
address: 0.0.0.0
port: 10000
message_format: openai
Expand Down Expand Up @@ -146,9 +146,9 @@ Create ``arch_config.yaml`` file with the following content:
version: v0.1
listeners:
prompt_gateway:
egress_traffic:
address: 0.0.0.0
port: 10000
port: 12000
message_format: openai
timeout: 30s
Expand Down
2 changes: 1 addition & 1 deletion docs/source/guides/includes/arch_config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: v0.1

listeners:
prompt_gateway:
ingress_traffic:
address: 0.0.0.0
port: 10000
message_format: openai
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
version: v0.1

listeners:
prompt_gateway:
ingress_traffic:
address: 0.0.0.0
port: 10000
message_format: openai
timeout: 5s
llm_gateway:
egress_traffic:
address: 0.0.0.0
port: 12000
message_format: openai
timeout: 5s

# Arch creates a round-robin load balancing between different endpoints, managed via the cluster subsystem.
endpoints:
Expand Down
2 changes: 1 addition & 1 deletion tests/archgw/arch_config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "0.1-beta"

listeners:
prompt_gateway:
ingress_traffic:
address: 0.0.0.0
port: 10000
message_format: openai
Expand Down

0 comments on commit 136daa2

Please sign in to comment.