gpustack 0.1.0__tar.gz

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.
Files changed (180) hide show
  1. gpustack-0.1.0/LICENSE +190 -0
  2. gpustack-0.1.0/PKG-INFO +245 -0
  3. gpustack-0.1.0/README.md +204 -0
  4. gpustack-0.1.0/gpustack/__init__.py +2 -0
  5. gpustack-0.1.0/gpustack/api/exceptions.py +136 -0
  6. gpustack-0.1.0/gpustack/api/middlewares.py +132 -0
  7. gpustack-0.1.0/gpustack/chat/__init__.py +0 -0
  8. gpustack-0.1.0/gpustack/chat/manager.py +227 -0
  9. gpustack-0.1.0/gpustack/client/__init__.py +4 -0
  10. gpustack-0.1.0/gpustack/client/generated_clientset.py +47 -0
  11. gpustack-0.1.0/gpustack/client/generated_http_client.py +297 -0
  12. gpustack-0.1.0/gpustack/client/generated_model_client.py +69 -0
  13. gpustack-0.1.0/gpustack/client/generated_model_instance_client.py +69 -0
  14. gpustack-0.1.0/gpustack/client/generated_user_client.py +69 -0
  15. gpustack-0.1.0/gpustack/client/generated_worker_client.py +69 -0
  16. gpustack-0.1.0/gpustack/cmd/__init__.py +3 -0
  17. gpustack-0.1.0/gpustack/cmd/chat.py +32 -0
  18. gpustack-0.1.0/gpustack/cmd/start.py +269 -0
  19. gpustack-0.1.0/gpustack/cmd/version.py +24 -0
  20. gpustack-0.1.0/gpustack/codegen/__init__.py +0 -0
  21. gpustack-0.1.0/gpustack/codegen/filters.py +17 -0
  22. gpustack-0.1.0/gpustack/codegen/generate.py +91 -0
  23. gpustack-0.1.0/gpustack/codegen/templates/client.py.jinja +70 -0
  24. gpustack-0.1.0/gpustack/codegen/templates/clientset.py.jinja +43 -0
  25. gpustack-0.1.0/gpustack/codegen/templates/http_client.py.jinja +297 -0
  26. gpustack-0.1.0/gpustack/config/__init__.py +4 -0
  27. gpustack-0.1.0/gpustack/config/config.py +160 -0
  28. gpustack-0.1.0/gpustack/http_proxy/__init__.py +0 -0
  29. gpustack-0.1.0/gpustack/http_proxy/load_balancer.py +17 -0
  30. gpustack-0.1.0/gpustack/http_proxy/strategies.py +35 -0
  31. gpustack-0.1.0/gpustack/logging.py +39 -0
  32. gpustack-0.1.0/gpustack/main.py +41 -0
  33. gpustack-0.1.0/gpustack/migrations/README +1 -0
  34. gpustack-0.1.0/gpustack/migrations/env.py +82 -0
  35. gpustack-0.1.0/gpustack/migrations/script.py.mako +28 -0
  36. gpustack-0.1.0/gpustack/migrations/versions/2024_07_24_1113-1dd9fa5b38ff_initialize_tables.py +149 -0
  37. gpustack-0.1.0/gpustack/mixins/__init__.py +6 -0
  38. gpustack-0.1.0/gpustack/mixins/active_record.py +383 -0
  39. gpustack-0.1.0/gpustack/mixins/timestamp.py +37 -0
  40. gpustack-0.1.0/gpustack/routes/__init__.py +0 -0
  41. gpustack-0.1.0/gpustack/routes/api_keys.py +93 -0
  42. gpustack-0.1.0/gpustack/routes/auth.py +64 -0
  43. gpustack-0.1.0/gpustack/routes/dashboard.py +273 -0
  44. gpustack-0.1.0/gpustack/routes/debug.py +27 -0
  45. gpustack-0.1.0/gpustack/routes/gpu_devices.py +43 -0
  46. gpustack-0.1.0/gpustack/routes/model_instances.py +162 -0
  47. gpustack-0.1.0/gpustack/routes/models.py +116 -0
  48. gpustack-0.1.0/gpustack/routes/openai.py +124 -0
  49. gpustack-0.1.0/gpustack/routes/probes.py +19 -0
  50. gpustack-0.1.0/gpustack/routes/routes.py +62 -0
  51. gpustack-0.1.0/gpustack/routes/ui.py +21 -0
  52. gpustack-0.1.0/gpustack/routes/users.py +118 -0
  53. gpustack-0.1.0/gpustack/routes/workers.py +94 -0
  54. gpustack-0.1.0/gpustack/scheduler/calculator.py +173 -0
  55. gpustack-0.1.0/gpustack/scheduler/policy.py +201 -0
  56. gpustack-0.1.0/gpustack/scheduler/queue.py +34 -0
  57. gpustack-0.1.0/gpustack/scheduler/scheduler.py +240 -0
  58. gpustack-0.1.0/gpustack/schemas/__init__.py +76 -0
  59. gpustack-0.1.0/gpustack/schemas/api_keys.py +37 -0
  60. gpustack-0.1.0/gpustack/schemas/common.py +105 -0
  61. gpustack-0.1.0/gpustack/schemas/dashboard.py +71 -0
  62. gpustack-0.1.0/gpustack/schemas/gpu_devices.py +27 -0
  63. gpustack-0.1.0/gpustack/schemas/model_usage.py +25 -0
  64. gpustack-0.1.0/gpustack/schemas/models.py +148 -0
  65. gpustack-0.1.0/gpustack/schemas/stmt.py +21 -0
  66. gpustack-0.1.0/gpustack/schemas/system_load.py +24 -0
  67. gpustack-0.1.0/gpustack/schemas/users.py +67 -0
  68. gpustack-0.1.0/gpustack/schemas/workers.py +155 -0
  69. gpustack-0.1.0/gpustack/security.py +63 -0
  70. gpustack-0.1.0/gpustack/server/__init__.py +0 -0
  71. gpustack-0.1.0/gpustack/server/app.py +22 -0
  72. gpustack-0.1.0/gpustack/server/auth.py +178 -0
  73. gpustack-0.1.0/gpustack/server/bus.py +65 -0
  74. gpustack-0.1.0/gpustack/server/controllers.py +184 -0
  75. gpustack-0.1.0/gpustack/server/db.py +59 -0
  76. gpustack-0.1.0/gpustack/server/deps.py +12 -0
  77. gpustack-0.1.0/gpustack/server/server.py +194 -0
  78. gpustack-0.1.0/gpustack/server/system_load.py +71 -0
  79. gpustack-0.1.0/gpustack/server/worker_syncer.py +56 -0
  80. gpustack-0.1.0/gpustack/third_party/bin/fastfetch/fastfetch-linux-aarch64 +0 -0
  81. gpustack-0.1.0/gpustack/third_party/bin/fastfetch/fastfetch-linux-amd64 +0 -0
  82. gpustack-0.1.0/gpustack/third_party/bin/gguf-parser/gguf-parser-linux-amd64 +0 -0
  83. gpustack-0.1.0/gpustack/third_party/bin/gguf-parser/gguf-parser-linux-arm64 +0 -0
  84. gpustack-0.1.0/gpustack/third_party/bin/llama-box/llama-box-linux-amd64-cuda-12.5 +0 -0
  85. gpustack-0.1.0/gpustack/third_party/config/fastfetch/config.jsonc +17 -0
  86. gpustack-0.1.0/gpustack/ui/css/layouts__index.1721898348072.chunk.css +1 -0
  87. gpustack-0.1.0/gpustack/ui/css/p__api-keys__index.1721898348072.chunk.css +1 -0
  88. gpustack-0.1.0/gpustack/ui/css/p__dashboard__index.1721898348072.chunk.css +1 -0
  89. gpustack-0.1.0/gpustack/ui/css/p__llmodels__index.1721898348072.chunk.css +1 -0
  90. gpustack-0.1.0/gpustack/ui/css/p__login__index.1721898348072.chunk.css +1 -0
  91. gpustack-0.1.0/gpustack/ui/css/p__playground__index.1721898348072.chunk.css +1 -0
  92. gpustack-0.1.0/gpustack/ui/css/p__profile__index.1721898348072.chunk.css +1 -0
  93. gpustack-0.1.0/gpustack/ui/css/p__resources__index.1721898348072.chunk.css +1 -0
  94. gpustack-0.1.0/gpustack/ui/css/p__users__index.1721898348072.chunk.css +1 -0
  95. gpustack-0.1.0/gpustack/ui/css/umi.1721898348072.css +1 -0
  96. gpustack-0.1.0/gpustack/ui/css/umi.1721898348072.css.gz +0 -0
  97. gpustack-0.1.0/gpustack/ui/index.html +15 -0
  98. gpustack-0.1.0/gpustack/ui/js/107.1721898348072.chunk.js +1 -0
  99. gpustack-0.1.0/gpustack/ui/js/107.1721898348072.chunk.js.gz +0 -0
  100. gpustack-0.1.0/gpustack/ui/js/120.1721898348072.chunk.js +1 -0
  101. gpustack-0.1.0/gpustack/ui/js/120.1721898348072.chunk.js.gz +0 -0
  102. gpustack-0.1.0/gpustack/ui/js/127.1721898348072.chunk.js +1 -0
  103. gpustack-0.1.0/gpustack/ui/js/127.1721898348072.chunk.js.gz +0 -0
  104. gpustack-0.1.0/gpustack/ui/js/153.1721898348072.chunk.js +1 -0
  105. gpustack-0.1.0/gpustack/ui/js/153.1721898348072.chunk.js.gz +0 -0
  106. gpustack-0.1.0/gpustack/ui/js/158.1721898348072.chunk.js +1 -0
  107. gpustack-0.1.0/gpustack/ui/js/158.1721898348072.chunk.js.gz +0 -0
  108. gpustack-0.1.0/gpustack/ui/js/162.1721898348072.chunk.js +1 -0
  109. gpustack-0.1.0/gpustack/ui/js/259.1721898348072.chunk.js +1 -0
  110. gpustack-0.1.0/gpustack/ui/js/274.1721898348072.chunk.js +1 -0
  111. gpustack-0.1.0/gpustack/ui/js/274.1721898348072.chunk.js.gz +0 -0
  112. gpustack-0.1.0/gpustack/ui/js/284.1721898348072.chunk.js +1 -0
  113. gpustack-0.1.0/gpustack/ui/js/284.1721898348072.chunk.js.gz +0 -0
  114. gpustack-0.1.0/gpustack/ui/js/302.1721898348072.chunk.js +1 -0
  115. gpustack-0.1.0/gpustack/ui/js/341.1721898348072.chunk.js +1 -0
  116. gpustack-0.1.0/gpustack/ui/js/341.1721898348072.chunk.js.gz +0 -0
  117. gpustack-0.1.0/gpustack/ui/js/399.1721898348072.chunk.js +1 -0
  118. gpustack-0.1.0/gpustack/ui/js/399.1721898348072.chunk.js.gz +0 -0
  119. gpustack-0.1.0/gpustack/ui/js/433.1721898348072.chunk.js +1 -0
  120. gpustack-0.1.0/gpustack/ui/js/433.1721898348072.chunk.js.gz +0 -0
  121. gpustack-0.1.0/gpustack/ui/js/490.1721898348072.chunk.js +1 -0
  122. gpustack-0.1.0/gpustack/ui/js/490.1721898348072.chunk.js.gz +0 -0
  123. gpustack-0.1.0/gpustack/ui/js/494.1721898348072.chunk.js +1 -0
  124. gpustack-0.1.0/gpustack/ui/js/543.1721898348072.chunk.js +1 -0
  125. gpustack-0.1.0/gpustack/ui/js/543.1721898348072.chunk.js.gz +0 -0
  126. gpustack-0.1.0/gpustack/ui/js/582.1721898348072.chunk.js +1 -0
  127. gpustack-0.1.0/gpustack/ui/js/582.1721898348072.chunk.js.gz +0 -0
  128. gpustack-0.1.0/gpustack/ui/js/591.1721898348072.chunk.js +1 -0
  129. gpustack-0.1.0/gpustack/ui/js/591.1721898348072.chunk.js.gz +0 -0
  130. gpustack-0.1.0/gpustack/ui/js/60.1721898348072.chunk.js +1 -0
  131. gpustack-0.1.0/gpustack/ui/js/751.1721898348072.chunk.js +1 -0
  132. gpustack-0.1.0/gpustack/ui/js/751.1721898348072.chunk.js.gz +0 -0
  133. gpustack-0.1.0/gpustack/ui/js/772.1721898348072.chunk.js +1 -0
  134. gpustack-0.1.0/gpustack/ui/js/772.1721898348072.chunk.js.gz +0 -0
  135. gpustack-0.1.0/gpustack/ui/js/776.1721898348072.chunk.js +1 -0
  136. gpustack-0.1.0/gpustack/ui/js/776.1721898348072.chunk.js.gz +0 -0
  137. gpustack-0.1.0/gpustack/ui/js/791.1721898348072.chunk.js +1 -0
  138. gpustack-0.1.0/gpustack/ui/js/796.1721898348072.chunk.js +1 -0
  139. gpustack-0.1.0/gpustack/ui/js/860.1721898348072.chunk.js +1 -0
  140. gpustack-0.1.0/gpustack/ui/js/860.1721898348072.chunk.js.gz +0 -0
  141. gpustack-0.1.0/gpustack/ui/js/959.1721898348072.chunk.js +1 -0
  142. gpustack-0.1.0/gpustack/ui/js/959.1721898348072.chunk.js.gz +0 -0
  143. gpustack-0.1.0/gpustack/ui/js/layouts__index.1721898348072.chunk.js +1 -0
  144. gpustack-0.1.0/gpustack/ui/js/layouts__index.1721898348072.chunk.js.gz +0 -0
  145. gpustack-0.1.0/gpustack/ui/js/p__404.1721898348072.chunk.js +1 -0
  146. gpustack-0.1.0/gpustack/ui/js/p__api-keys__index.1721898348072.chunk.js +1 -0
  147. gpustack-0.1.0/gpustack/ui/js/p__api-keys__index.1721898348072.chunk.js.gz +0 -0
  148. gpustack-0.1.0/gpustack/ui/js/p__dashboard__index.1721898348072.chunk.js +1 -0
  149. gpustack-0.1.0/gpustack/ui/js/p__dashboard__index.1721898348072.chunk.js.gz +0 -0
  150. gpustack-0.1.0/gpustack/ui/js/p__llmodels__index.1721898348072.chunk.js +1 -0
  151. gpustack-0.1.0/gpustack/ui/js/p__llmodels__index.1721898348072.chunk.js.gz +0 -0
  152. gpustack-0.1.0/gpustack/ui/js/p__login__index.1721898348072.chunk.js +1 -0
  153. gpustack-0.1.0/gpustack/ui/js/p__login__index.1721898348072.chunk.js.gz +0 -0
  154. gpustack-0.1.0/gpustack/ui/js/p__playground__index.1721898348072.chunk.js +1 -0
  155. gpustack-0.1.0/gpustack/ui/js/p__playground__index.1721898348072.chunk.js.gz +0 -0
  156. gpustack-0.1.0/gpustack/ui/js/p__profile__index.1721898348072.chunk.js +1 -0
  157. gpustack-0.1.0/gpustack/ui/js/p__resources__index.1721898348072.chunk.js +1 -0
  158. gpustack-0.1.0/gpustack/ui/js/p__resources__index.1721898348072.chunk.js.gz +0 -0
  159. gpustack-0.1.0/gpustack/ui/js/p__users__index.1721898348072.chunk.js +1 -0
  160. gpustack-0.1.0/gpustack/ui/js/p__users__index.1721898348072.chunk.js.gz +0 -0
  161. gpustack-0.1.0/gpustack/ui/js/umi.1721898348072.js +1 -0
  162. gpustack-0.1.0/gpustack/ui/js/umi.1721898348072.js.gz +0 -0
  163. gpustack-0.1.0/gpustack/ui/static/avatar.d61efc48.png +0 -0
  164. gpustack-0.1.0/gpustack/ui/static/favicon.png +0 -0
  165. gpustack-0.1.0/gpustack/ui/static/gpustack-logo.58d53008.png +0 -0
  166. gpustack-0.1.0/gpustack/ui/static/small-logo-200x200.cf14a378.png +0 -0
  167. gpustack-0.1.0/gpustack/utils/command.py +49 -0
  168. gpustack-0.1.0/gpustack/utils/compat_importlib.py +8 -0
  169. gpustack-0.1.0/gpustack/utils/network.py +41 -0
  170. gpustack-0.1.0/gpustack/utils/task.py +73 -0
  171. gpustack-0.1.0/gpustack/worker/__init__.py +3 -0
  172. gpustack-0.1.0/gpustack/worker/collector.py +335 -0
  173. gpustack-0.1.0/gpustack/worker/downloaders.py +212 -0
  174. gpustack-0.1.0/gpustack/worker/exporter.py +265 -0
  175. gpustack-0.1.0/gpustack/worker/inference_server.py +261 -0
  176. gpustack-0.1.0/gpustack/worker/logs.py +65 -0
  177. gpustack-0.1.0/gpustack/worker/serve_manager.py +215 -0
  178. gpustack-0.1.0/gpustack/worker/worker.py +186 -0
  179. gpustack-0.1.0/gpustack/worker/worker_manager.py +117 -0
  180. gpustack-0.1.0/pyproject.toml +68 -0
gpustack-0.1.0/LICENSE ADDED
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright (c) 2024 The GPUStack authors
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
@@ -0,0 +1,245 @@
1
+ Metadata-Version: 2.1
2
+ Name: gpustack
3
+ Version: 0.1.0
4
+ Summary: GPUStack
5
+ Author: GPUStack Authors
6
+ Author-email: contact@gpustack.ai
7
+ Requires-Python: >=3.10,<4.0
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Requires-Dist: aiosqlite (>=0.20.0,<0.21.0)
13
+ Requires-Dist: alembic (>=1.13.2,<2.0.0)
14
+ Requires-Dist: apscheduler (>=3.10.4,<4.0.0)
15
+ Requires-Dist: argon2-cffi (>=23.1.0,<24.0.0)
16
+ Requires-Dist: asyncpg (>=0.29.0,<0.30.0)
17
+ Requires-Dist: attrs (>=23.2.0,<24.0.0)
18
+ Requires-Dist: colorama (>=0.4.6,<0.5.0)
19
+ Requires-Dist: dataclasses-json (>=0.6.7,<0.7.0)
20
+ Requires-Dist: fastapi (>=0.111.0,<0.112.0)
21
+ Requires-Dist: httpx[socks] (>=0.27.0,<0.28.0)
22
+ Requires-Dist: huggingface-hub (>=0.23.3,<0.24.0)
23
+ Requires-Dist: importlib-resources (>=6.4.0,<7.0.0)
24
+ Requires-Dist: inflection (>=0.5.1,<0.6.0)
25
+ Requires-Dist: openai (>=1.31.1,<2.0.0)
26
+ Requires-Dist: prometheus-client (>=0.20.0,<0.21.0)
27
+ Requires-Dist: psutil (>=5.9.8,<6.0.0)
28
+ Requires-Dist: pydantic-settings (>=2.2.1,<3.0.0)
29
+ Requires-Dist: pyjwt (>=2.8.0,<3.0.0)
30
+ Requires-Dist: pytest-asyncio (>=0.23.7,<0.24.0)
31
+ Requires-Dist: python-multipart (>=0.0.9,<0.0.10)
32
+ Requires-Dist: requests (>=2.32.3,<3.0.0)
33
+ Requires-Dist: setproctitle (>=1.3.3,<2.0.0)
34
+ Requires-Dist: shellcheck-py (>=0.10.0.1,<0.11.0.0)
35
+ Requires-Dist: sqlalchemy[asyncio] (>=2.0.30,<3.0.0)
36
+ Requires-Dist: sqlmodel (>=0.0.18,<0.0.19)
37
+ Requires-Dist: truststore (>=0.9.1,<0.10.0)
38
+ Requires-Dist: validators (>=0.31.0,<0.32.0)
39
+ Description-Content-Type: text/markdown
40
+
41
+ # GPUStack
42
+
43
+ ![demo](docs/assets/gpustack-demo.gif)
44
+
45
+ GPUStack is an open-source GPU cluster manager for running large language models(LLMs).
46
+
47
+ ### Key Features:
48
+
49
+ - **Supports a Wide Variety of Hardware:** Run with different brands of GPUs in Apple MacBooks, Windows PCs, and Linux servers.
50
+ - **Scales with Your GPU Inventory:** Easily add more GPUs or nodes to scale up your operations.
51
+ - **Lightweight Python Package:** Minimal dependencies and operational overhead.
52
+ - **OpenAI-compatible APIs:** Serve APIs that are compatible with OpenAI standards.
53
+ - **User and API key management:** Simplified management of users and API keys.
54
+ - **GPU metrics monitoring:** Monitor GPU performance and utilization in real-time.
55
+ - **Token usage and rate metrics:** Track token usage and manage rate limits effectively.
56
+
57
+ ## Installation
58
+
59
+ ### Linux or MacOS
60
+
61
+ GPUStack provides a script to install it as a service on systemd or launchd based systems. To install GPUStack using this method, just run:
62
+
63
+ ```bash
64
+ curl -sfL https://get.gpustack.ai | sh -s -
65
+ ```
66
+
67
+ Optionally, you can add extra workers to form a GPUStack cluster by running the following command on other nodes (replace `http://myserver` and `mytoken` with your actual server URL and token):
68
+
69
+ ```bash
70
+ curl -sfL https://get.gpustack.ai | sh -s - --server-url http://myserver --token mytoken
71
+ ```
72
+
73
+ In the default setup, you can run the following to get the token used for adding workers:
74
+
75
+ ```bash
76
+ cat /var/lib/gpustack/token
77
+ ```
78
+
79
+ ### Windows
80
+
81
+ Run PowerShell as administrator, then run the following command to install GPUStack:
82
+
83
+ ```powershell
84
+ Invoke-Expression (Invoke-WebRequest -Uri "https://get.gpustack.ai" -UseBasicParsing).Content
85
+ ```
86
+
87
+ Optionally, you can add extra workers to form a GPUStack cluster by running the following command on other nodes (replace `http://myserver` and `mytoken` with your actual server URL and token):
88
+
89
+ ```powershell
90
+ Invoke-Expression "& { $((Invoke-WebRequest -Uri 'https://get.gpustack.ai' -UseBasicParsing).Content) } -server-url http://myserver -token mytoken"
91
+ ```
92
+
93
+ In the default setup, you can run the following to get the token used for adding workers:
94
+
95
+ ```powershell
96
+ Get-Content -Path (Join-Path -Path $env:APPDATA -ChildPath "gpustack\token") -Raw
97
+ ```
98
+
99
+ ### Manual Installation
100
+
101
+ For manual installation or detailed configurations, refer to the [installation](./docs/installation/manual-installation.md) docs.
102
+
103
+ ## Gettting Started
104
+
105
+ 1. Run and chat with the llama3 model:
106
+
107
+ ```bash
108
+ gpustack chat llama3 "tell me a joke."
109
+ ```
110
+
111
+ 2. Open `http://myserver` in the browser to access the GPUStack UI. Log in to GPUStack with username `admin` and the default password. You can run the following command to get the password for the default setup:
112
+
113
+ ```bash
114
+ cat /var/lib/gpustack/initial_admin_password
115
+ ```
116
+
117
+ 3. Click `Playground` in the navigation menus. Now you can chat with the LLM in the UI playground.
118
+
119
+ ![Playground Screenshot](docs/assets/playground-screenshot.png)
120
+
121
+ 4. Click `API Keys` in the navigation menus, then click the `New API Key` button.
122
+
123
+ 5. Fill in the `Name` and click the `Save` button.
124
+
125
+ 6. Copy the generated API key and save it somewhere safe. Please note that you can only see it once on creation.
126
+
127
+ 7. Now you can use the API key to access the OpenAI-compatible API. For example, use curl as the following:
128
+
129
+ ```bash
130
+ export GPUSTACK_API_KEY=myapikey
131
+ curl http://myserver/v1-openai/chat/completions \
132
+ -H "Content-Type: application/json" \
133
+ -H "Authorization: Bearer $GPUSTACK_API_KEY" \
134
+ -d '{
135
+ "model": "llama3",
136
+ "messages": [
137
+ {
138
+ "role": "system",
139
+ "content": "You are a helpful assistant."
140
+ },
141
+ {
142
+ "role": "user",
143
+ "content": "Hello!"
144
+ }
145
+ ],
146
+ "stream": true
147
+ }'
148
+ ```
149
+
150
+ ## Supported Platforms
151
+
152
+ - [x] MacOS
153
+ - [x] Linux
154
+ - [x] Windows
155
+
156
+ ## Supported Accelerators
157
+
158
+ - [x] Apple Metal
159
+ - [x] NVIDIA CUDA
160
+
161
+ We plan to support the following accelerators in future releases.
162
+
163
+ - [ ] AMD ROCm
164
+ - [ ] Intel oneAPI
165
+ - [ ] Qualcomm AI Engine
166
+
167
+ ## Supported Models
168
+
169
+ GPUStack uses [llama.cpp](https://github.com/ggerganov/llama.cpp) as the backend and supports large language models in [GGUF format](https://github.com/ggerganov/ggml/blob/master/docs/gguf.md). Models from the following sources are supported:
170
+
171
+ 1. [Hugging Face](https://huggingface.co/)
172
+
173
+ 2. [Ollama Library](https://ollama.com/library)
174
+
175
+ Here are some example models:
176
+
177
+ - [x] [LLaMA](https://huggingface.co/meta-llama)
178
+ - [x] [Mistral 7B](https://huggingface.co/mistralai/Mistral-7B-v0.1)
179
+ - [x] [Mixtral MoE](https://huggingface.co/models?search=mistral-ai/Mixtral)
180
+ - [x] [DBRX](https://huggingface.co/databricks/dbrx-instruct)
181
+ - [x] [Falcon](https://huggingface.co/models?search=tiiuae/falcon)
182
+ - [x] [Baichuan](https://huggingface.co/models?search=baichuan-inc/Baichuan)
183
+ - [x] [Aquila](https://huggingface.co/models?search=BAAI/Aquila)
184
+ - [x] [Yi](https://huggingface.co/models?search=01-ai/Yi)
185
+ - [x] [StableLM](https://huggingface.co/stabilityai)
186
+ - [x] [Deepseek](https://huggingface.co/models?search=deepseek-ai/deepseek)
187
+ - [x] [Qwen](https://huggingface.co/models?search=Qwen/Qwen)
188
+ - [x] [Phi](https://huggingface.co/models?search=microsoft/phi)
189
+ - [x] [Gemma](https://huggingface.co/models?search=google/gemma)
190
+ - [x] [Mamba](https://huggingface.co/models?search=state-spaces/mamba)
191
+ - [x] [Grok-1](https://huggingface.co/xai-org/grok-1)
192
+
193
+ ## OpenAI-Compatible APIs
194
+
195
+ GPUStack serves the following OpenAI compatible APIs under the `/v1-openai` path:
196
+
197
+ 1. List models
198
+ 2. Chat completions
199
+
200
+ For example, you can use the official [OpenAI Python API library](https://github.com/openai/openai-python) to consume the APIs:
201
+
202
+ ```python
203
+ from openai import OpenAI
204
+ client = OpenAI(base_url="http://myserver/v1-openai", api_key="myapikey")
205
+
206
+ completion = client.chat.completions.create(
207
+ model="llama3",
208
+ messages=[
209
+ {"role": "system", "content": "You are a helpful assistant."},
210
+ {"role": "user", "content": "Hello!"}
211
+ ]
212
+ )
213
+
214
+ print(completion.choices[0].message)
215
+ ```
216
+
217
+ GPUStack users can generate their own API keys in the UI.
218
+
219
+ ## Build
220
+
221
+ 1. Install `python 3.10+`.
222
+
223
+ 2. Run `make build`.
224
+
225
+ You can find the built wheel package in `dist` directory.
226
+
227
+ ## Contributing
228
+
229
+ Please read the [Contributing Guide](./docs/contributing.md) if you're interested in contributing to GPUStack.
230
+
231
+ ## License
232
+
233
+ Copyright (c) 2024 The GPUStack authors
234
+
235
+ Licensed under the Apache License, Version 2.0 (the "License");
236
+ you may not use this file except in compliance with the License.
237
+ You may obtain a copy of the License at [LICENSE](./LICENSE) file for details.
238
+
239
+ Unless required by applicable law or agreed to in writing, software
240
+ distributed under the License is distributed on an "AS IS" BASIS,
241
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
242
+ See the License for the specific language governing permissions and
243
+ limitations under the License.
244
+
245
+
@@ -0,0 +1,204 @@
1
+ # GPUStack
2
+
3
+ ![demo](docs/assets/gpustack-demo.gif)
4
+
5
+ GPUStack is an open-source GPU cluster manager for running large language models(LLMs).
6
+
7
+ ### Key Features:
8
+
9
+ - **Supports a Wide Variety of Hardware:** Run with different brands of GPUs in Apple MacBooks, Windows PCs, and Linux servers.
10
+ - **Scales with Your GPU Inventory:** Easily add more GPUs or nodes to scale up your operations.
11
+ - **Lightweight Python Package:** Minimal dependencies and operational overhead.
12
+ - **OpenAI-compatible APIs:** Serve APIs that are compatible with OpenAI standards.
13
+ - **User and API key management:** Simplified management of users and API keys.
14
+ - **GPU metrics monitoring:** Monitor GPU performance and utilization in real-time.
15
+ - **Token usage and rate metrics:** Track token usage and manage rate limits effectively.
16
+
17
+ ## Installation
18
+
19
+ ### Linux or MacOS
20
+
21
+ GPUStack provides a script to install it as a service on systemd or launchd based systems. To install GPUStack using this method, just run:
22
+
23
+ ```bash
24
+ curl -sfL https://get.gpustack.ai | sh -s -
25
+ ```
26
+
27
+ Optionally, you can add extra workers to form a GPUStack cluster by running the following command on other nodes (replace `http://myserver` and `mytoken` with your actual server URL and token):
28
+
29
+ ```bash
30
+ curl -sfL https://get.gpustack.ai | sh -s - --server-url http://myserver --token mytoken
31
+ ```
32
+
33
+ In the default setup, you can run the following to get the token used for adding workers:
34
+
35
+ ```bash
36
+ cat /var/lib/gpustack/token
37
+ ```
38
+
39
+ ### Windows
40
+
41
+ Run PowerShell as administrator, then run the following command to install GPUStack:
42
+
43
+ ```powershell
44
+ Invoke-Expression (Invoke-WebRequest -Uri "https://get.gpustack.ai" -UseBasicParsing).Content
45
+ ```
46
+
47
+ Optionally, you can add extra workers to form a GPUStack cluster by running the following command on other nodes (replace `http://myserver` and `mytoken` with your actual server URL and token):
48
+
49
+ ```powershell
50
+ Invoke-Expression "& { $((Invoke-WebRequest -Uri 'https://get.gpustack.ai' -UseBasicParsing).Content) } -server-url http://myserver -token mytoken"
51
+ ```
52
+
53
+ In the default setup, you can run the following to get the token used for adding workers:
54
+
55
+ ```powershell
56
+ Get-Content -Path (Join-Path -Path $env:APPDATA -ChildPath "gpustack\token") -Raw
57
+ ```
58
+
59
+ ### Manual Installation
60
+
61
+ For manual installation or detailed configurations, refer to the [installation](./docs/installation/manual-installation.md) docs.
62
+
63
+ ## Gettting Started
64
+
65
+ 1. Run and chat with the llama3 model:
66
+
67
+ ```bash
68
+ gpustack chat llama3 "tell me a joke."
69
+ ```
70
+
71
+ 2. Open `http://myserver` in the browser to access the GPUStack UI. Log in to GPUStack with username `admin` and the default password. You can run the following command to get the password for the default setup:
72
+
73
+ ```bash
74
+ cat /var/lib/gpustack/initial_admin_password
75
+ ```
76
+
77
+ 3. Click `Playground` in the navigation menus. Now you can chat with the LLM in the UI playground.
78
+
79
+ ![Playground Screenshot](docs/assets/playground-screenshot.png)
80
+
81
+ 4. Click `API Keys` in the navigation menus, then click the `New API Key` button.
82
+
83
+ 5. Fill in the `Name` and click the `Save` button.
84
+
85
+ 6. Copy the generated API key and save it somewhere safe. Please note that you can only see it once on creation.
86
+
87
+ 7. Now you can use the API key to access the OpenAI-compatible API. For example, use curl as the following:
88
+
89
+ ```bash
90
+ export GPUSTACK_API_KEY=myapikey
91
+ curl http://myserver/v1-openai/chat/completions \
92
+ -H "Content-Type: application/json" \
93
+ -H "Authorization: Bearer $GPUSTACK_API_KEY" \
94
+ -d '{
95
+ "model": "llama3",
96
+ "messages": [
97
+ {
98
+ "role": "system",
99
+ "content": "You are a helpful assistant."
100
+ },
101
+ {
102
+ "role": "user",
103
+ "content": "Hello!"
104
+ }
105
+ ],
106
+ "stream": true
107
+ }'
108
+ ```
109
+
110
+ ## Supported Platforms
111
+
112
+ - [x] MacOS
113
+ - [x] Linux
114
+ - [x] Windows
115
+
116
+ ## Supported Accelerators
117
+
118
+ - [x] Apple Metal
119
+ - [x] NVIDIA CUDA
120
+
121
+ We plan to support the following accelerators in future releases.
122
+
123
+ - [ ] AMD ROCm
124
+ - [ ] Intel oneAPI
125
+ - [ ] Qualcomm AI Engine
126
+
127
+ ## Supported Models
128
+
129
+ GPUStack uses [llama.cpp](https://github.com/ggerganov/llama.cpp) as the backend and supports large language models in [GGUF format](https://github.com/ggerganov/ggml/blob/master/docs/gguf.md). Models from the following sources are supported:
130
+
131
+ 1. [Hugging Face](https://huggingface.co/)
132
+
133
+ 2. [Ollama Library](https://ollama.com/library)
134
+
135
+ Here are some example models:
136
+
137
+ - [x] [LLaMA](https://huggingface.co/meta-llama)
138
+ - [x] [Mistral 7B](https://huggingface.co/mistralai/Mistral-7B-v0.1)
139
+ - [x] [Mixtral MoE](https://huggingface.co/models?search=mistral-ai/Mixtral)
140
+ - [x] [DBRX](https://huggingface.co/databricks/dbrx-instruct)
141
+ - [x] [Falcon](https://huggingface.co/models?search=tiiuae/falcon)
142
+ - [x] [Baichuan](https://huggingface.co/models?search=baichuan-inc/Baichuan)
143
+ - [x] [Aquila](https://huggingface.co/models?search=BAAI/Aquila)
144
+ - [x] [Yi](https://huggingface.co/models?search=01-ai/Yi)
145
+ - [x] [StableLM](https://huggingface.co/stabilityai)
146
+ - [x] [Deepseek](https://huggingface.co/models?search=deepseek-ai/deepseek)
147
+ - [x] [Qwen](https://huggingface.co/models?search=Qwen/Qwen)
148
+ - [x] [Phi](https://huggingface.co/models?search=microsoft/phi)
149
+ - [x] [Gemma](https://huggingface.co/models?search=google/gemma)
150
+ - [x] [Mamba](https://huggingface.co/models?search=state-spaces/mamba)
151
+ - [x] [Grok-1](https://huggingface.co/xai-org/grok-1)
152
+
153
+ ## OpenAI-Compatible APIs
154
+
155
+ GPUStack serves the following OpenAI compatible APIs under the `/v1-openai` path:
156
+
157
+ 1. List models
158
+ 2. Chat completions
159
+
160
+ For example, you can use the official [OpenAI Python API library](https://github.com/openai/openai-python) to consume the APIs:
161
+
162
+ ```python
163
+ from openai import OpenAI
164
+ client = OpenAI(base_url="http://myserver/v1-openai", api_key="myapikey")
165
+
166
+ completion = client.chat.completions.create(
167
+ model="llama3",
168
+ messages=[
169
+ {"role": "system", "content": "You are a helpful assistant."},
170
+ {"role": "user", "content": "Hello!"}
171
+ ]
172
+ )
173
+
174
+ print(completion.choices[0].message)
175
+ ```
176
+
177
+ GPUStack users can generate their own API keys in the UI.
178
+
179
+ ## Build
180
+
181
+ 1. Install `python 3.10+`.
182
+
183
+ 2. Run `make build`.
184
+
185
+ You can find the built wheel package in `dist` directory.
186
+
187
+ ## Contributing
188
+
189
+ Please read the [Contributing Guide](./docs/contributing.md) if you're interested in contributing to GPUStack.
190
+
191
+ ## License
192
+
193
+ Copyright (c) 2024 The GPUStack authors
194
+
195
+ Licensed under the Apache License, Version 2.0 (the "License");
196
+ you may not use this file except in compliance with the License.
197
+ You may obtain a copy of the License at [LICENSE](./LICENSE) file for details.
198
+
199
+ Unless required by applicable law or agreed to in writing, software
200
+ distributed under the License is distributed on an "AS IS" BASIS,
201
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
202
+ See the License for the specific language governing permissions and
203
+ limitations under the License.
204
+
@@ -0,0 +1,2 @@
1
+ __version__ = '0.1.0'
2
+ __git_commit__ = '908a6c7'