kalavai-client 0.5.20__py3-none-any.whl → 0.5.22__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.5.20"
2
+ __version__ = "0.5.22"
@@ -139,7 +139,7 @@ releases:
139
139
  - name: replicas
140
140
  value: 2
141
141
  - name: image_tag
142
- value: "v2025.01.10"
142
+ value: "v2025.03.1"
143
143
  - name: deployment.in_cluster
144
144
  value: "True"
145
145
  - name: deployment.use_auth_key
@@ -103,7 +103,7 @@ services:
103
103
  {% endif %}
104
104
  {% endif %}
105
105
 
106
- networks:
107
- custom-network:
108
- driver: bridge
106
+ # networks:
107
+ # custom-network:
108
+ # driver: bridge
109
109
 
@@ -64,7 +64,8 @@ def pool_join(request: JoinPoolRequest):
64
64
  result = join_pool(
65
65
  token=request.token,
66
66
  num_gpus=request.num_gpus,
67
- node_name=request.node_name
67
+ node_name=request.node_name,
68
+ ip_address=request.ip_address
68
69
  )
69
70
  return result
70
71
 
@@ -17,6 +17,7 @@ class DeleteNodesRequest(BaseModel):
17
17
 
18
18
  class JoinPoolRequest(BaseModel):
19
19
  token: str
20
+ ip_address: str = None
20
21
  node_name: str = None
21
22
  num_gpus: int = None
22
23
 
kalavai_client/cli.py CHANGED
@@ -319,14 +319,12 @@ def pool__publish(*others, description=None):
319
319
  console.log(f"[red]Problems with your pool: {str(e)}")
320
320
  return
321
321
  choices = select_token_type()
322
- token = pool__token(**choices)
322
+ token = pool__token(**choices)["token"]
323
323
 
324
324
  if description is None:
325
325
  console.log("[yellow] [Markdown] In a few words (max 500 chars), describe your goals with this cluster. Remember, this is what other users will see to decide whether to share their resources with you, [blue]so inspire them!")
326
326
  description = input(f"(You can edit this later in {KALAVAI_PLATFORM_URL}\n")
327
327
 
328
- description = description
329
-
330
328
  try:
331
329
  valid = check_token(token=token, public=True)
332
330
  if "error" in valid:
@@ -462,7 +460,7 @@ def pool__token(*others, admin=False, user=False, worker=False):
462
460
  console.log(f"[red]{join_token}")
463
461
  else:
464
462
  console.log("[green]Join token:")
465
- print(join_token)
463
+ print(join_token["token"])
466
464
  return join_token
467
465
 
468
466
  @arguably.command
@@ -513,11 +511,16 @@ def pool__join(token, *others, node_name=None):
513
511
  console.log("[red]Installation aborted")
514
512
  return
515
513
 
514
+ # select IP address (for external discovery)
515
+ console.log(f"Scanning for valid IPs")
516
+ ip_address = select_ip_address()
517
+
516
518
  console.log("Connecting worker to the pool...")
517
519
  result = join_pool(
518
520
  token=token,
519
521
  node_name=node_name,
520
- num_gpus=num_gpus
522
+ num_gpus=num_gpus,
523
+ ip_address=ip_address
521
524
  )
522
525
  if "error" in result:
523
526
  console.log(f"[red]Error when connecting: {result}")
@@ -1048,7 +1051,7 @@ def job__run(template_name, *others, values: str=None, force_namespace: str=None
1048
1051
  )
1049
1052
 
1050
1053
  if "error" in result:
1051
- console.log(f"[red]Error when deploying job: {str(e)}")
1054
+ console.log(f"[red]Error when deploying job: {str(result['error'])}")
1052
1055
  else:
1053
1056
  console.log(f"[green]{template_name} job deployed")
1054
1057
 
kalavai_client/core.py CHANGED
@@ -267,6 +267,8 @@ def fetch_job_details(jobs: list[Job]):
267
267
  if ns != namespace: # same job name, different namespace
268
268
  continue
269
269
  for _, values in ss.items():
270
+ # TODO get 'restart_count' from values['conditions'][-1]["restart_count"]
271
+ # TODO: get nodes involved in deployment (needs kubewatcher)
270
272
  workers_status[values["status"]] += 1
271
273
  workers = "\n".join([f"{k}: {v}" for k, v in workers_status.items()])
272
274
  # get URL details
@@ -287,10 +289,14 @@ def fetch_job_details(jobs: list[Job]):
287
289
  urls = [f"http://{load_server_info(data_key=SERVER_IP_KEY, file=USER_LOCAL_SERVER_FILE)}:{node_port}" for node_port in node_ports]
288
290
  if "Ready" in workers_status and len(workers_status) == 1:
289
291
  status = "running"
290
- elif any([st in workers_status for st in ["Failed", "Completed"]]):
292
+ elif any([st in workers_status for st in ["Failed"]]):
291
293
  status = "error"
292
- else:
294
+ elif any([st in workers_status for st in ["Pending"]]) or len(workers_status) == 0:
293
295
  status = "pending"
296
+ elif any([st in workers_status for st in ["Succeeded", "Completed"]]):
297
+ status = "completed"
298
+ else:
299
+ status = "working"
294
300
  job_details.append(
295
301
  Job(owner=namespace,
296
302
  name=deployment,
@@ -567,7 +573,7 @@ def get_max_gpus():
567
573
  except:
568
574
  return 0
569
575
 
570
- def join_pool(token, num_gpus=None, node_name=None):
576
+ def join_pool(token, num_gpus=None, node_name=None, ip_address=None):
571
577
  compatibility = check_worker_compatibility()
572
578
  if len(compatibility["issues"]) > 0:
573
579
  return {"error": compatibility["issues"]}
@@ -624,6 +630,7 @@ def join_pool(token, num_gpus=None, node_name=None):
624
630
  # Generate docker compose recipe
625
631
  generate_compose_config(
626
632
  role="agent",
633
+ node_ip_address=ip_address,
627
634
  pool_ip=f"https://{kalavai_seed_ip}:6443",
628
635
  pool_token=kalavai_token,
629
636
  num_gpus=num_gpus,
@@ -699,6 +706,9 @@ def create_pool(cluster_name: str, ip_address: str, app_values: str=None, pool_c
699
706
  node_labels[USER_NODE_LABEL] = user["username"]
700
707
  except Exception as e:
701
708
  return {"error": f"[red]Error when joining network: {str(e)}"}
709
+
710
+ if num_gpus is None:
711
+ num_gpus = get_max_gpus()
702
712
 
703
713
  # Generate docker compose recipe
704
714
  generate_compose_config(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: kalavai-client
3
- Version: 0.5.20
3
+ Version: 0.5.22
4
4
  Summary: Client app for kalavai platform
5
5
  License: Apache-2.0
6
6
  Keywords: LLM,platform
@@ -26,6 +26,7 @@ Requires-Dist: Pillow (==10.3.0)
26
26
  Requires-Dist: anvil-uplink (==0.5.1)
27
27
  Requires-Dist: arguably (>=1.2.5)
28
28
  Requires-Dist: build ; extra == "dev"
29
+ Requires-Dist: fastapi (==0.115.8)
29
30
  Requires-Dist: importlib_resources (==6.5.2)
30
31
  Requires-Dist: jinja2 (==3.1.4)
31
32
  Requires-Dist: netifaces (==0.11.0)
@@ -38,6 +39,7 @@ Requires-Dist: requests (>=2.25)
38
39
  Requires-Dist: rich (==13.7.1)
39
40
  Requires-Dist: setuptools (>75.0.0)
40
41
  Requires-Dist: twine ; extra == "dev"
42
+ Requires-Dist: uvicorn (==0.34.0)
41
43
  Project-URL: Homepage, https://platform.kalavai.net
42
44
  Project-URL: Website, https://kalavai.net
43
45
  Description-Content-Type: text/markdown
@@ -154,8 +156,6 @@ Not what you were looking for? [Tell us](https://github.com/kalavai-net/kalavai-
154
156
 
155
157
  The `kalavai-client` is the main tool to interact with the Kalavai platform, to create and manage both local and public pools and also to interact with them (e.g. deploy models). Let's go over its installation.
156
158
 
157
- From release **v0.5.0, you can now install `kalavai-client` in non-worker computers**. You can run a pool on a set of machines and have the client on a remote computer from which you access the LLM pool. Because the client only requires having python installed, this means more computers are now supported to run it.
158
-
159
159
 
160
160
  <details>
161
161
 
@@ -211,7 +211,7 @@ pip install kalavai-client
211
211
  ```
212
212
 
213
213
 
214
- ## Createa a local, private LLM pool
214
+ ## Create a a local, private LLM pool
215
215
 
216
216
  > Kalavai is **free to use, no caps, for both commercial and non-commercial purposes**. All you need to get started is one or more computers that can see each other (i.e. within the same network), and you are good to go. If you are interested in join computers in different locations / networks, [contact us](mailto:info@kalavai.net) or [book a demo](https://app.onecal.io/b/kalavai/book-a-demo) with the founders.
217
217
 
@@ -237,11 +237,7 @@ Check out [our guide](https://kalavai-net.github.io/kalavai-client/public_llm_po
237
237
 
238
238
  ## Enough already, let's run stuff!
239
239
 
240
- Check our [examples](examples/) to put your new AI pool to good use!
241
- - [Single node vLLM GPU LLM](examples/singlenode_gpu_vllm.md) deployment
242
- - [Multi node vLLM GPU LLM](examples/multinode_gpu_vllm.md) deployment
243
- - [Aphrodite-engine quantized LLM](examples/quantized_gpu_llm.md) deployment, including Kobold interface
244
- - [Ray cluster](examples/ray_cluster.md) for distributed computation.
240
+ Check our [examples](examples/) to put your new AI pool to good use! For an end to end tour, check our [self-hosted](https://kalavai-net.github.io/kalavai-client/self_hosted_llm_pool/) and [public LLM pools](https://kalavai-net.github.io/kalavai-client/public_llm_pool/) guides.
245
241
 
246
242
 
247
243
  ## Compatibility matrix
@@ -1,25 +1,25 @@
1
- kalavai_client/__init__.py,sha256=YJ16sMq9PK__3-NzHbGxz6Zz5IYwpCEzy4p-Yddy-o8,23
1
+ kalavai_client/__init__.py,sha256=B8BZXxq8ga04_YWJxV1IYhwDos_rr2WoHNu4_srpzOM,23
2
2
  kalavai_client/__main__.py,sha256=WQUfxvRsBJH5gsCJg8pLz95QnZIj7Ol8psTO77m0QE0,73
3
3
  kalavai_client/assets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- kalavai_client/assets/apps.yaml,sha256=V1x1FY-fyYsYrXvcIMv3QrBCgJ7jNunluRyJh67eWB0,5983
4
+ kalavai_client/assets/apps.yaml,sha256=yeKtxkz1e_EW7tNpxMb0M-FAF4vKLW27nMRd8xJY9C8,5982
5
5
  kalavai_client/assets/apps_values.yaml,sha256=CjKVelPQHd-hm-DTMEuya92feKiphU9mh3HrosLYYPE,1676
6
6
  kalavai_client/assets/docker-compose-gui.yaml,sha256=oE-neG3HC2PhdH-mIxrZdQlhqnycrSP_p8fRxjaxDFE,192
7
- kalavai_client/assets/docker-compose-template.yaml,sha256=Fnsk44oFtUqS2E77umVUiWl1-eS96E13TPe31GYo1XI,2825
7
+ kalavai_client/assets/docker-compose-template.yaml,sha256=ii24Nn-dM5cZk9lxFgrzxnmK7yv_6kIIw7KUlWhvYeI,2831
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=QsBh28L2LwjBBK6pTUE4Xu36lLDTyetyU1YfS1Hbb6g,1717
14
- kalavai_client/bridge_api.py,sha256=hp5YjMu0HBI9VGMx6hahXfMIGPLwNtSd09UKxmKnGXc,4852
15
- kalavai_client/bridge_models.py,sha256=rXBnE5r6Oe9GxGkk1ITkvp6YQqahp72Rrzf-QM2quH8,771
16
- kalavai_client/cli.py,sha256=u9zy2H3Ntn3fOnQyYU8XjVPmouZNqyJxiyXBVA5EtEA,47862
14
+ kalavai_client/bridge_api.py,sha256=lFS1fvH7UQxZ24vrHGeea5z8bnGWhOZhgU_zKIrnlHI,4891
15
+ kalavai_client/bridge_models.py,sha256=hWxEODqHwc8Sj21zkIZoZmU9W3PvNdK-CA1tH6yMQ4s,798
16
+ kalavai_client/cli.py,sha256=8HBAVAgLEJo6XHHF5eORIvtn7_ObykkCQZwbP5ngzpU,48024
17
17
  kalavai_client/cluster.py,sha256=gwjmdsd--YrffT0BmZDOEpbrdm3lPskUuN5jdgcrOR0,12947
18
- kalavai_client/core.py,sha256=JTyGpi4Xez_kAgEpcInErS-Ot3dFLoNY48nEBQJLuOc,29653
18
+ kalavai_client/core.py,sha256=c9UI_RJ7QmvWPfB9VQpc5QtNCbExOcPtGc-zed1ZgzI,30187
19
19
  kalavai_client/env.py,sha256=Zg2pP-xGJpQumo56KMBxBLgIsBmcNN0S9R-ZP2-s630,2604
20
20
  kalavai_client/utils.py,sha256=rz5W9PRZrTpgdmOs6yeqUi4f_q_L-3BJ5g1o7Asgnyo,13386
21
- kalavai_client-0.5.20.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
22
- kalavai_client-0.5.20.dist-info/METADATA,sha256=aHwXRZpoiBBSDbjthDxR2ncdeLTInAUJ2cci3Li7Dn0,14800
23
- kalavai_client-0.5.20.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
24
- kalavai_client-0.5.20.dist-info/entry_points.txt,sha256=9T6D45gxwzfVbglMm1r6XPdXuuZdHfy_7fCeu2jUphc,50
25
- kalavai_client-0.5.20.dist-info/RECORD,,
21
+ kalavai_client-0.5.22.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
22
+ kalavai_client-0.5.22.dist-info/METADATA,sha256=fSOCPN-YiifsInCwIyooSmPZ6GsLdqmANN6s7rtHKNg,14443
23
+ kalavai_client-0.5.22.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
24
+ kalavai_client-0.5.22.dist-info/entry_points.txt,sha256=9T6D45gxwzfVbglMm1r6XPdXuuZdHfy_7fCeu2jUphc,50
25
+ kalavai_client-0.5.22.dist-info/RECORD,,