kalavai-client 0.6.1__py3-none-any.whl → 0.6.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
 
2
- __version__ = "0.6.1"
2
+ __version__ = "0.6.3"
@@ -2,7 +2,6 @@ services:
2
2
  kalavai_gui:
3
3
  container_name: kalavai_gui
4
4
  image: bundenth/kalavai-gui:latest
5
- #network_mode: host
6
5
  extra_hosts:
7
6
  - "host.docker.internal:host-gateway"
8
7
  networks:
@@ -7,34 +7,13 @@ services:
7
7
  - NET_ADMIN
8
8
  - SYS_MODULE
9
9
  network_mode: host
10
- # networks:
11
- # - custom-network
12
- # ports:
13
- # # https://docs.k3s.io/installation/requirements#inbound-rules-for-k3s-nodes
14
- # - "6443:6443" # kube server
15
- # - "10250:10250" # worker balancer
16
- # - "8472:8472/udp" # flannel vxlan
17
- # - "51820-51830:51820-51830" # flannel wireguard
18
- # {% if command == "server" %}
19
- # - "30000-30500:30000-30500"
20
- # {% endif %}
21
10
  environment:
22
11
  - HOST_NAME={{node_name}}
23
12
  - TOKEN={{vpn_token}}
24
13
  volumes:
25
14
  - /dev/net/tun:/dev/net/tun
26
15
  restart: unless-stopped
27
- # nginx:
28
- # image: nginx:latest
29
- # ports:
30
- # - "{{redirect_source_port}}:{{redirect_source_port}}"
31
- # restart: unless-stopped
32
- # networks:
33
- # - custom-network
34
- # volumes:
35
- # - {{nginx_path}}/nginx.conf:/etc/nginx/nginx.conf
36
16
  {% endif %}
37
-
38
17
  # run worker only if command is set
39
18
  {%if command %}
40
19
  {{service_name}}:
@@ -46,21 +25,6 @@ services:
46
25
  network_mode: "service:{{vpn_name}}"
47
26
  {% else %}
48
27
  network_mode: host
49
- # hostname: {{node_name}}
50
- # networks:
51
- # - custom-network
52
- # ports:
53
- # - "6443:6443" # kube server
54
- # - "2379-2380:2379-2380" # etcd server
55
- # - "10259:10259" # kube scheduler
56
- # - "10257:10257" # kube controller manager
57
- # - "10250:10250" # worker balancer
58
- # - "8285:8285" # flannel
59
- # - "8472:8472" # flannel vxlan
60
- # - "51820:51820" # flannel wireguard
61
- # {% if command == "server" %}
62
- # - "30000-32767:30000-32767"
63
- # {% endif %}
64
28
  {% endif %}
65
29
  privileged: true
66
30
  restart: unless-stopped
@@ -100,8 +64,3 @@ services:
100
64
  capabilities: [gpu]
101
65
  {% endif %}
102
66
  {% endif %}
103
-
104
- # networks:
105
- # custom-network:
106
- # driver: bridge
107
-
@@ -75,7 +75,8 @@ def pool_create(request: CreatePoolRequest, api_key: str = Depends(verify_api_ke
75
75
  only_registered_users=request.only_registered_users,
76
76
  location=request.location,
77
77
  description=request.description,
78
- token_mode=request.token_mode
78
+ token_mode=request.token_mode,
79
+ frontend=request.frontend
79
80
  )
80
81
  return result
81
82
 
@@ -85,7 +86,8 @@ def pool_join(request: JoinPoolRequest, api_key: str = Depends(verify_api_key)):
85
86
  token=request.token,
86
87
  num_gpus=request.num_gpus,
87
88
  node_name=request.node_name,
88
- ip_address=request.ip_address
89
+ ip_address=request.ip_address,
90
+ frontend=request.frontend
89
91
  )
90
92
  return result
91
93
 
@@ -93,7 +95,8 @@ def pool_join(request: JoinPoolRequest, api_key: str = Depends(verify_api_key)):
93
95
  def pool_attach(request: JoinPoolRequest, api_key: str = Depends(verify_api_key)):
94
96
  result = attach_to_pool(
95
97
  token=request.token,
96
- node_name=request.node_name
98
+ node_name=request.node_name,
99
+ frontend=request.frontend
97
100
  )
98
101
  return result
99
102
 
@@ -16,6 +16,7 @@ class CreatePoolRequest(BaseModel):
16
16
  location: str = None
17
17
  token_mode: TokenType = TokenType.USER
18
18
  description: str = ""
19
+ frontend: bool = False
19
20
 
20
21
  class NodesActionRequest(BaseModel):
21
22
  nodes: list[str]
@@ -25,7 +26,7 @@ class JoinPoolRequest(BaseModel):
25
26
  ip_address: str = None
26
27
  node_name: str = None
27
28
  num_gpus: int = None
28
-
29
+ frontend: bool = False
29
30
  class JobDetailsRequest(BaseModel):
30
31
  jobs: list[Job]
31
32
 
kalavai_client/cli.py CHANGED
@@ -205,33 +205,29 @@ def input_gpus(non_interactive=False):
205
205
  @arguably.command
206
206
  def gui__start(
207
207
  *others,
208
- backend_only=False,
209
208
  gui_frontend_port=3000,
210
209
  gui_backend_port=8000,
211
210
  bridge_port=8001,
212
211
  log_level="critical",
213
- protected_access=False
212
+ protected_access=False,
213
+ backend_only=False
214
214
  ):
215
215
  """Run GUI (docker) and kalavai core backend (api)"""
216
216
  if len(set([gui_frontend_port, gui_backend_port, bridge_port])) < 3:
217
217
  console.log("[red]Error: ports must be unique")
218
218
  return
219
219
 
220
- user_key = None
221
- if protected_access:
222
- user_key = load_user_id()
223
- if user_key is None:
224
- console.log("[red]Error: user key not found (required for protected access)")
225
- return
226
-
220
+ user_key = load_user_id()
221
+ if user_key is not None:
222
+ console.log(f"[green]Using user key: {user_key}")
227
223
  if not backend_only:
228
224
  values = {
229
225
  "gui_frontend_port": gui_frontend_port,
230
226
  "gui_backend_port": gui_backend_port,
231
227
  "bridge_port": bridge_port,
232
- "path": user_path(""),
228
+ "path": user_path("", create_path=True),
233
229
  "protected_access": user_key
234
- }
230
+ }
235
231
  compose_yaml = load_template(
236
232
  template_path=DOCKER_COMPOSE_GUI,
237
233
  values=values)
@@ -245,11 +241,10 @@ def gui__start(
245
241
  "Deploying bridge API"
246
242
  )
247
243
  run_api(port=bridge_port, log_level=log_level)
248
-
244
+
249
245
  if not backend_only:
250
246
  run_cmd(f"docker compose --file {USER_GUI_COMPOSE_FILE} down")
251
- console.log("[green]Kalavai GUI has been stopped")
252
-
247
+ console.log("[green]Kalavai GUI has been stopped")
253
248
 
254
249
  @arguably.command
255
250
  def auth(user_key, *others):
kalavai_client/core.py CHANGED
@@ -789,7 +789,6 @@ def create_pool(
789
789
  auth_key = user_id if user_id is not None else str(uuid.uuid4())
790
790
  write_auth_key = str(uuid.uuid4())
791
791
  readonly_auth_key = str(uuid.uuid4())
792
-
793
792
  watcher_service = f"{ip_address}:{DEFAULT_WATCHER_PORT}"
794
793
  values = {
795
794
  CLUSTER_NAME_KEY: cluster_name,
kalavai_client/env.py CHANGED
@@ -3,11 +3,11 @@ from pathlib import Path
3
3
  import importlib.resources
4
4
 
5
5
 
6
- DEFAULT_KALAVAI_PATH = os.getenv("KALAVAI_PATH", None)
6
+ DEFAULT_KALAVAI_PATH = os.getenv("KALAVAI_PATH", "")
7
7
 
8
8
  def user_path(relative_path, create_path=False):
9
9
  """Transform a relative path into the user's cache folder path"""
10
- if DEFAULT_KALAVAI_PATH is not None:
10
+ if len(DEFAULT_KALAVAI_PATH.strip()) > 0:
11
11
  kalavai_user_path = DEFAULT_KALAVAI_PATH
12
12
  else:
13
13
  base = os.path.expanduser("~")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: kalavai-client
3
- Version: 0.6.1
3
+ Version: 0.6.3
4
4
  Summary: Client app for kalavai platform
5
5
  License: Apache-2.0
6
6
  Keywords: LLM,platform
@@ -1,25 +1,25 @@
1
- kalavai_client/__init__.py,sha256=RUEIQh8z_V_kGKsMyzH8WJLz-dW7GvzomrpPti1qfDw,22
1
+ kalavai_client/__init__.py,sha256=YPRovmUtXL2teOic_KNYxHp09zJ6yS_T_hR6yiFy5hI,22
2
2
  kalavai_client/__main__.py,sha256=WQUfxvRsBJH5gsCJg8pLz95QnZIj7Ol8psTO77m0QE0,73
3
3
  kalavai_client/assets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  kalavai_client/assets/apps.yaml,sha256=H2HZQ_oqdNz2qPDs5_NtHvJo4rblH1DRPugzQYq_t5Q,6366
5
5
  kalavai_client/assets/apps_values.yaml,sha256=WRew3bS1MztjzcJfphuJcKn0n2T1ICRupPpr_Csjt_s,1644
6
- kalavai_client/assets/docker-compose-gui.yaml,sha256=IHClIltiu8C4nHbgDgAscf3Ls6UFngbeQP07kj31kjM,776
7
- kalavai_client/assets/docker-compose-template.yaml,sha256=uct7xmXtO1XgNimdirSiQusb-RYsPbnL67TVkj2oWrU,2772
6
+ kalavai_client/assets/docker-compose-gui.yaml,sha256=DGCyGYzz1kH6kkMbo62FJHe3F9vcAmA8DOHw-c_o0Kw,752
7
+ kalavai_client/assets/docker-compose-template.yaml,sha256=88Bi8mxynoK9lHi4d_yqaRVQCwbJfzkY8SUoYnEArRU,1589
8
8
  kalavai_client/assets/nginx.conf,sha256=drVVCg8GHucz7hmt_BI6giAhK92OV71257NTs3LthwM,225
9
9
  kalavai_client/assets/pool_config_template.yaml,sha256=fFz4w2-fMKD5KvyzFdfcWD_jSneRlmnjLc8hCctweX0,576
10
10
  kalavai_client/assets/pool_config_values.yaml,sha256=VrM3XHQfQo6QLZ68qvagooUptaYgl1pszniY_JUtemk,233
11
11
  kalavai_client/assets/user_workspace.yaml,sha256=wDvlMYknOPABAEo0dsQwU7bac8iubjAG9tdkFbJZ5Go,476
12
12
  kalavai_client/assets/user_workspace_values.yaml,sha256=G0HOzQUxrDMCwuW9kbWUZaKMzDDPVwDwzBHCL2Xi2ZM,542
13
13
  kalavai_client/auth.py,sha256=EB3PMvKUn5_KAQkezkEHEt-OMZXyfkZguIQlUFkEHcA,3243
14
- kalavai_client/bridge_api.py,sha256=IkKq_CODA4p4UJkk6UqXKHkz5m2ESq2mL3tKqkQk6T0,6910
15
- kalavai_client/bridge_models.py,sha256=k4ILxa8jfAcfgIIBJqK1DunDzHh_oNUpuiEpmhAfTP0,977
16
- kalavai_client/cli.py,sha256=TUZJDmHdpBnF7Po-rnI97S1VYDPWxde1JqaHtb9xlIQ,46996
14
+ kalavai_client/bridge_api.py,sha256=KecIZvsGRiZgUQaDSgvRBLaqPDBhxFKS6FBH_w5ArCc,7015
15
+ kalavai_client/bridge_models.py,sha256=IGPLAYEZG4f5EUtBuoR2u_cYoyCCVkhx4H2rMeGuJ_Y,1030
16
+ kalavai_client/cli.py,sha256=kvQXuIdSd2BYavnqLkd7phFUD3htxjVcSJaqnaEAGtI,46904
17
17
  kalavai_client/cluster.py,sha256=gwjmdsd--YrffT0BmZDOEpbrdm3lPskUuN5jdgcrOR0,12947
18
- kalavai_client/core.py,sha256=CWJQ38BZ2mLavfOCyR7wsDdy4fRTpjnYmggoXcR9Ji8,32531
19
- kalavai_client/env.py,sha256=J-9_YopIIVBCnwTFxoQ9jq8JWUDdKrB__S-Wig6TWSU,2767
18
+ kalavai_client/core.py,sha256=1qT6d4LpZIHHQaCDZHVmk4crkcOShzVMCL4Pax8ShVI,32526
19
+ kalavai_client/env.py,sha256=wAd-P8XDlDB8Oau76f0bG2aHTkNA793xb_V0frbNeJE,2770
20
20
  kalavai_client/utils.py,sha256=k2Bpvl16zDpWBXMIMsd_LbkinZtctPO6bygfB7DyiZ8,12018
21
- kalavai_client-0.6.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
22
- kalavai_client-0.6.1.dist-info/METADATA,sha256=0VhOSaYS1GdoXSE0w_YNYjfjiXHZ57SiLe3IRVJ7Sz4,13353
23
- kalavai_client-0.6.1.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
24
- kalavai_client-0.6.1.dist-info/entry_points.txt,sha256=9T6D45gxwzfVbglMm1r6XPdXuuZdHfy_7fCeu2jUphc,50
25
- kalavai_client-0.6.1.dist-info/RECORD,,
21
+ kalavai_client-0.6.3.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
22
+ kalavai_client-0.6.3.dist-info/METADATA,sha256=8Q4iCcpjFF9gRDYEeQbaZHAegUn_v4yn8-w5Y7sAiM4,13353
23
+ kalavai_client-0.6.3.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
24
+ kalavai_client-0.6.3.dist-info/entry_points.txt,sha256=9T6D45gxwzfVbglMm1r6XPdXuuZdHfy_7fCeu2jUphc,50
25
+ kalavai_client-0.6.3.dist-info/RECORD,,