ZackBradshaw commited on
Commit
e91b0da
1 Parent(s): b73905e

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. README.md +2 -8
  2. app.py +50 -0
  3. requirements.txt +2 -0
README.md CHANGED
@@ -1,12 +1,6 @@
1
  ---
2
- title: Skypilot Gradio
3
- emoji: 👀
4
- colorFrom: pink
5
- colorTo: pink
6
  sdk: gradio
7
  sdk_version: 4.19.2
8
- app_file: app.py
9
- pinned: false
10
  ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: skypilot-gradio
3
+ app_file: app.py
 
 
4
  sdk: gradio
5
  sdk_version: 4.19.2
 
 
6
  ---
 
 
app.py ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import sky
3
+
4
+ def deploy_vllm_on_sky(model_path, gpu_type, cpus, memory, cloud_provider, region, disk_size, disk_type):
5
+ task = sky.Task(
6
+ name="vllm_serving",
7
+ setup="pip install vllm",
8
+ run=f"vllm serve --model_name_or_path {model_path} --port 8080",
9
+ envs={"MODEL_PATH": model_path},
10
+ workdir=".",
11
+ ports=8080
12
+ )
13
+
14
+ task.set_resources(
15
+ sky.Resources(
16
+ cloud=sky.Cloud(provider=cloud_provider, region=region),
17
+ accelerators=f"{gpu_type}:1",
18
+ cpus=cpus,
19
+ memory=memory,
20
+ disk=sky.Disk(size=disk_size, type=disk_type)
21
+ )
22
+ )
23
+
24
+ cluster = sky.Cluster(
25
+ name="vllm-cluster",
26
+ cloud=sky.Cloud(provider=cloud_provider, region=region)
27
+ )
28
+
29
+ sky.launch(task, cluster=cluster)
30
+ return f"VLLM model deployed on SkyPilot with cluster name: {cluster.name}"
31
+
32
+ sky_pilot_interface = gr.Interface(
33
+ fn=deploy_vllm_on_sky,
34
+ inputs=[
35
+ gr.Textbox(label="Model Path", placeholder="EleutherAI/gpt-neo-2.7B"),
36
+ gr.Dropdown(label="GPU Type", choices=["V100", "P100", "T4"], value="V100"),
37
+ gr.Slider(label="CPUs", minimum=1, maximum=16, value=4),
38
+ gr.Slider(label="Memory (GB)", minimum=4, maximum=64, value=16),
39
+ gr.Dropdown(label="Cloud Provider", choices=["AWS", "GCP", "Azure"], value="AWS"),
40
+ gr.Textbox(label="Region", placeholder="us-west-2"),
41
+ gr.Slider(label="Disk Size (GB)", minimum=20, maximum=1000, value=100),
42
+ gr.Dropdown(label="Disk Type", choices=["standard", "ssd"], value="ssd")
43
+ ],
44
+ outputs="text",
45
+ title="Deploy VLLM on SkyPilot",
46
+ description="Configure and deploy a VLLM model on a SkyPilot-managed cloud instance with full parameter customization."
47
+ )
48
+
49
+ if __name__ == "__main__":
50
+ sky_pilot_interface.launch()
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ gradio
2
+ sk