-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli.py
95 lines (93 loc) · 2.42 KB
/
cli.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import argparse
def parse():
parser = argparse.ArgumentParser(
description="uLLM-API: A simple HTTP API for running LLM's."
)
parser.add_argument(
"--host",
type=str,
default="localhost",
help="The host to run the server on. (0.0.0.0 for all interfaces)",
)
parser.add_argument(
"--http",
type=bool,
action=argparse.BooleanOptionalAction,
default=False,
help="Whether to run the http server.",
)
parser.add_argument(
"--http-port",
type=int,
default=8080,
help="The port to run the http server on.",
)
parser.add_argument(
"--sockets",
type=bool,
action=argparse.BooleanOptionalAction,
default=False,
help="Whether to run the websocket server.",
)
parser.add_argument(
"--sockets-port",
type=str,
default=8081,
help="The port to run the websocket server on.",
)
parser.add_argument(
"--rabbitmq",
type=bool,
action=argparse.BooleanOptionalAction,
default=False,
help="Whether to run the rabbitmq server.",
)
parser.add_argument(
"--rabbitmq-host",
type=str,
default="localhost",
help="The host to run the rabbitmq server on.",
)
parser.add_argument(
"--rabbitmq-port",
type=int,
default=5672,
help="The port to run the rabbitmq server on.",
)
parser.add_argument(
"--rabbitmq-vhost",
type=str,
default="/",
help="The vhost to use for rabbitmq.",
)
parser.add_argument(
"--rabbitmq-queue",
type=str,
default="ullm",
help="The queue to listen on for rabbitmq.",
)
parser.add_argument(
"--rabbitmq-reply-queue",
type=str,
default="ullm.reply",
help="The queue ullm publishes responses to.",
)
parser.add_argument(
"--rabbitmq-username",
type=str,
default="guest",
help="The username for rabbitmq.",
)
parser.add_argument(
"--rabbitmq-password",
type=str,
default="guest",
help="The password for rabbitmq.",
)
parser.add_argument(
"--data-dir",
type=str,
default="$XDG_DATA_HOME/ullm-api",
help="The directory to store the data and models in.",
)
return parser.parse_args()