|
205 | 205 | "oneOf": [ |
206 | 206 | { |
207 | 207 | "type": "string", |
208 | | - "description":"The string that will be turned into an embedding." |
| 208 | + "description": "The string that will be turned into an embedding." |
209 | 209 | }, |
210 | 210 | { |
211 | 211 | "type": "array", |
212 | | - "description" : "The array of strings that will be turned into an embedding.", |
| 212 | + "description": "The array of strings that will be turned into an embedding.", |
213 | 213 | "items": { |
214 | 214 | "type": "string" |
215 | 215 | } |
|
219 | 219 | "description": "The array of integers that will be turned into an embedding.", |
220 | 220 | "items": { |
221 | 221 | "type": "integer" |
222 | | - |
223 | 222 | } |
224 | 223 | }, |
225 | 224 | { |
226 | 225 | "type": "array", |
227 | | - "description" : "The array of arrays containing integers that will be turned into an embedding.", |
| 226 | + "description": "The array of arrays containing integers that will be turned into an embedding.", |
228 | 227 | "items": { |
229 | 228 | "type": "array", |
230 | 229 | "items": { |
|
1764 | 1763 | ] |
1765 | 1764 | } |
1766 | 1765 | }, |
| 1766 | + "/v1/hardware": { |
| 1767 | + "get": { |
| 1768 | + "summary": "Get hardware information", |
| 1769 | + "description": "Retrieves detailed information about the system's hardware configuration, including CPU, GPU(s), operating system, power status, RAM, and storage.", |
| 1770 | + "responses": { |
| 1771 | + "200": { |
| 1772 | + "description": "Hardware information retrieved successfully", |
| 1773 | + "content": { |
| 1774 | + "application/json": { |
| 1775 | + "schema": { |
| 1776 | + "type": "object", |
| 1777 | + "properties": { |
| 1778 | + "cpu": { |
| 1779 | + "$ref": "#/components/schemas/CPUDto" |
| 1780 | + }, |
| 1781 | + "gpus": { |
| 1782 | + "type": "array", |
| 1783 | + "items": { |
| 1784 | + "$ref": "#/components/schemas/GPUDto" |
| 1785 | + } |
| 1786 | + }, |
| 1787 | + "os": { |
| 1788 | + "$ref": "#/components/schemas/OperatingSystemDto" |
| 1789 | + }, |
| 1790 | + "power": { |
| 1791 | + "$ref": "#/components/schemas/PowerDto" |
| 1792 | + }, |
| 1793 | + "ram": { |
| 1794 | + "$ref": "#/components/schemas/RAMDto" |
| 1795 | + }, |
| 1796 | + "storage": { |
| 1797 | + "$ref": "#/components/schemas/StorageDto" |
| 1798 | + } |
| 1799 | + } |
| 1800 | + } |
| 1801 | + } |
| 1802 | + } |
| 1803 | + } |
| 1804 | + }, |
| 1805 | + "tags": [ |
| 1806 | + "Hardware" |
| 1807 | + ] |
| 1808 | + } |
| 1809 | + }, |
| 1810 | + "/v1/hardware/activate": { |
| 1811 | + "post": { |
| 1812 | + "summary": "Activate GPUs", |
| 1813 | + "description": "Activates the specified GPUs based on their indices provided in the request body.", |
| 1814 | + "requestBody": { |
| 1815 | + "required": true, |
| 1816 | + "content": { |
| 1817 | + "application/json": { |
| 1818 | + "schema": { |
| 1819 | + "type": "object", |
| 1820 | + "properties": { |
| 1821 | + "gpus": { |
| 1822 | + "type": "array", |
| 1823 | + "items": { |
| 1824 | + "type": "integer" |
| 1825 | + }, |
| 1826 | + "example": [ |
| 1827 | + 0, |
| 1828 | + 1, |
| 1829 | + 2 |
| 1830 | + ], |
| 1831 | + "description": "An array of GPU indices to activate." |
| 1832 | + } |
| 1833 | + }, |
| 1834 | + "required": [ |
| 1835 | + "gpus" |
| 1836 | + ] |
| 1837 | + } |
| 1838 | + } |
| 1839 | + } |
| 1840 | + }, |
| 1841 | + "responses": { |
| 1842 | + "200": { |
| 1843 | + "description": "The hardware configuration has been activated.", |
| 1844 | + "content": { |
| 1845 | + "application/json": { |
| 1846 | + "schema": { |
| 1847 | + "type": "object", |
| 1848 | + "properties": { |
| 1849 | + "message": { |
| 1850 | + "type": "string", |
| 1851 | + "example": "The hardware configuration has been activated.", |
| 1852 | + "description": "Confirmation message indicating successful activation." |
| 1853 | + }, |
| 1854 | + "activated_gpus": { |
| 1855 | + "type": "array", |
| 1856 | + "items": { |
| 1857 | + "type": "integer" |
| 1858 | + }, |
| 1859 | + "example": [ |
| 1860 | + 0, |
| 1861 | + 1, |
| 1862 | + 2 |
| 1863 | + ], |
| 1864 | + "description": "List of GPU indices that were activated." |
| 1865 | + } |
| 1866 | + } |
| 1867 | + } |
| 1868 | + } |
| 1869 | + } |
| 1870 | + }, |
| 1871 | + "400": { |
| 1872 | + "description": "Bad Request", |
| 1873 | + "content": { |
| 1874 | + "application/json": { |
| 1875 | + "schema": { |
| 1876 | + "type": "object", |
| 1877 | + "properties": { |
| 1878 | + "message": { |
| 1879 | + "type": "string", |
| 1880 | + "example": "Invalid GPU index provided", |
| 1881 | + "description": "Error message indicating what went wrong." |
| 1882 | + } |
| 1883 | + } |
| 1884 | + } |
| 1885 | + } |
| 1886 | + } |
| 1887 | + } |
| 1888 | + }, |
| 1889 | + "tags": [ |
| 1890 | + "Hardware" |
| 1891 | + ] |
| 1892 | + } |
| 1893 | + }, |
1767 | 1894 | "/v1/configs": { |
1768 | 1895 | "get": { |
1769 | 1896 | "summary": "Get Configurations", |
|
1927 | 2054 | "name": "Engines", |
1928 | 2055 | "description": "Endpoints for managing the available engines within Cortex." |
1929 | 2056 | }, |
| 2057 | + { |
| 2058 | + "name": "Hardware", |
| 2059 | + "description": "Endpoints for managing the available hardware within Cortex." |
| 2060 | + }, |
1930 | 2061 | { |
1931 | 2062 | "name": "System", |
1932 | 2063 | "description": "Endpoints for stopping the Cortex API server, checking its status, and fetching system events." |
|
1939 | 2070 | "Chat", |
1940 | 2071 | "Embeddings", |
1941 | 2072 | "Engines", |
| 2073 | + "Hardware", |
1942 | 2074 | "Events", |
1943 | 2075 | "Pulling Models", |
1944 | 2076 | "Running Models", |
|
4773 | 4905 | "object", |
4774 | 4906 | "deleted" |
4775 | 4907 | ] |
| 4908 | + }, |
| 4909 | + "CPUDto": { |
| 4910 | + "type": "object", |
| 4911 | + "properties": { |
| 4912 | + "arch": { |
| 4913 | + "type": "string", |
| 4914 | + "example": "amd64", |
| 4915 | + "description": "The architecture of the CPU." |
| 4916 | + }, |
| 4917 | + "cores": { |
| 4918 | + "type": "integer", |
| 4919 | + "example": 8, |
| 4920 | + "description": "The number of CPU cores available." |
| 4921 | + }, |
| 4922 | + "instructions": { |
| 4923 | + "type": "array", |
| 4924 | + "items": { |
| 4925 | + "type": "string" |
| 4926 | + }, |
| 4927 | + "example": [ |
| 4928 | + "fpu", |
| 4929 | + "mmx", |
| 4930 | + "sse", |
| 4931 | + "sse2", |
| 4932 | + "sse3", |
| 4933 | + "ssse3", |
| 4934 | + "sse4_1", |
| 4935 | + "sse4_2", |
| 4936 | + "pclmulqdq", |
| 4937 | + "avx", |
| 4938 | + "avx2", |
| 4939 | + "aes", |
| 4940 | + "f16c" |
| 4941 | + ], |
| 4942 | + "description": "A list of supported CPU instruction sets." |
| 4943 | + }, |
| 4944 | + "model": { |
| 4945 | + "type": "string", |
| 4946 | + "example": "AMD Ryzen Threadripper PRO 5955WX 16-Cores", |
| 4947 | + "description": "The model name of the CPU." |
| 4948 | + } |
| 4949 | + }, |
| 4950 | + "required": [ |
| 4951 | + "arch", |
| 4952 | + "cores", |
| 4953 | + "instructions", |
| 4954 | + "model" |
| 4955 | + ] |
| 4956 | + }, |
| 4957 | + "GPUDto": { |
| 4958 | + "type": "object", |
| 4959 | + "properties": { |
| 4960 | + "activated": { |
| 4961 | + "type": "boolean", |
| 4962 | + "example": true, |
| 4963 | + "description": "Indicates if the GPU is currently activated." |
| 4964 | + }, |
| 4965 | + "additional_information": { |
| 4966 | + "type": "object", |
| 4967 | + "properties": { |
| 4968 | + "compute_cap": { |
| 4969 | + "type": "string", |
| 4970 | + "example": "8.6", |
| 4971 | + "description": "The compute capability of the GPU." |
| 4972 | + }, |
| 4973 | + "driver_version": { |
| 4974 | + "type": "string", |
| 4975 | + "example": "535.183", |
| 4976 | + "description": "The version of the installed driver." |
| 4977 | + } |
| 4978 | + }, |
| 4979 | + "required": [ |
| 4980 | + "compute_cap", |
| 4981 | + "driver_version" |
| 4982 | + ] |
| 4983 | + }, |
| 4984 | + "free_vram": { |
| 4985 | + "type": "integer", |
| 4986 | + "example": 23983, |
| 4987 | + "description": "The amount of free VRAM in MB." |
| 4988 | + }, |
| 4989 | + "id": { |
| 4990 | + "type": "string", |
| 4991 | + "example": "0", |
| 4992 | + "description": "Unique identifier for the GPU." |
| 4993 | + }, |
| 4994 | + "name": { |
| 4995 | + "type": "string", |
| 4996 | + "example": "NVIDIA GeForce RTX 3090", |
| 4997 | + "description": "The name of the GPU model." |
| 4998 | + }, |
| 4999 | + "total_vram": { |
| 5000 | + "type": "integer", |
| 5001 | + "example": 24576, |
| 5002 | + "description": "The total VRAM available in MB." |
| 5003 | + }, |
| 5004 | + "uuid": { |
| 5005 | + "type": "string", |
| 5006 | + "example": "GPU-5206045b-2a1c-1e7d-6c60-d7c367d02376", |
| 5007 | + "description": "The universally unique identifier for the GPU." |
| 5008 | + }, |
| 5009 | + "version": { |
| 5010 | + "type": "string", |
| 5011 | + "example": "12.2", |
| 5012 | + "description": "The version of the GPU." |
| 5013 | + } |
| 5014 | + }, |
| 5015 | + "required": [ |
| 5016 | + "activated", |
| 5017 | + "additional_information", |
| 5018 | + "free_vram", |
| 5019 | + "id", |
| 5020 | + "name", |
| 5021 | + "total_vram", |
| 5022 | + "uuid", |
| 5023 | + "version" |
| 5024 | + ] |
| 5025 | + }, |
| 5026 | + "OperatingSystemDto": { |
| 5027 | + "type": "object", |
| 5028 | + "properties": { |
| 5029 | + "name": { |
| 5030 | + "type": "string", |
| 5031 | + "example": "Ubuntu 24.04.1 LTS", |
| 5032 | + "description": "The name of the operating system." |
| 5033 | + }, |
| 5034 | + "version": { |
| 5035 | + "type": "string", |
| 5036 | + "example": "24.04.1 LTS (Noble Numbat)", |
| 5037 | + "description": "The version of the operating system." |
| 5038 | + } |
| 5039 | + }, |
| 5040 | + "required": [ |
| 5041 | + "name", |
| 5042 | + "version" |
| 5043 | + ] |
| 5044 | + }, |
| 5045 | + "PowerDto": { |
| 5046 | + "type": "object", |
| 5047 | + "properties": { |
| 5048 | + "battery_life": { |
| 5049 | + "type": "integer", |
| 5050 | + "example": 0, |
| 5051 | + "description": "The percentage of battery life remaining." |
| 5052 | + }, |
| 5053 | + "charging_status": { |
| 5054 | + "type": "string", |
| 5055 | + "example": "", |
| 5056 | + "description": "The charging status of the device." |
| 5057 | + }, |
| 5058 | + "is_power_saving": { |
| 5059 | + "type": "boolean", |
| 5060 | + "example": false, |
| 5061 | + "description": "Indicates if the power-saving mode is enabled." |
| 5062 | + } |
| 5063 | + }, |
| 5064 | + "required": [ |
| 5065 | + "battery_life", |
| 5066 | + "charging_status", |
| 5067 | + "is_power_saving" |
| 5068 | + ] |
| 5069 | + }, |
| 5070 | + "RAMDto": { |
| 5071 | + "type": "object", |
| 5072 | + "properties": { |
| 5073 | + "available": { |
| 5074 | + "type": "integer", |
| 5075 | + "example": 11100, |
| 5076 | + "description": "The amount of available RAM in MB." |
| 5077 | + }, |
| 5078 | + "total": { |
| 5079 | + "type": "integer", |
| 5080 | + "example": 15991, |
| 5081 | + "description": "The total RAM in MB." |
| 5082 | + }, |
| 5083 | + "type": { |
| 5084 | + "type": "string", |
| 5085 | + "example": "", |
| 5086 | + "description": "The type of RAM." |
| 5087 | + } |
| 5088 | + }, |
| 5089 | + "required": [ |
| 5090 | + "available", |
| 5091 | + "total", |
| 5092 | + "type" |
| 5093 | + ] |
| 5094 | + }, |
| 5095 | + "Storage": { |
| 5096 | + "type": "object", |
| 5097 | + "properties": { |
| 5098 | + "available": { |
| 5099 | + "type": "integer", |
| 5100 | + "example": 0, |
| 5101 | + "description": "The amount of available storage in MB." |
| 5102 | + }, |
| 5103 | + "total": { |
| 5104 | + "type": "integer", |
| 5105 | + "example": 0, |
| 5106 | + "description": "The total storage in MB." |
| 5107 | + }, |
| 5108 | + "type": { |
| 5109 | + "type": "string", |
| 5110 | + "example": "", |
| 5111 | + "description": "The type of storage." |
| 5112 | + } |
| 5113 | + }, |
| 5114 | + "required": [ |
| 5115 | + "available", |
| 5116 | + "total", |
| 5117 | + "type" |
| 5118 | + ] |
4776 | 5119 | } |
4777 | 5120 | } |
4778 | 5121 | } |
|
0 commit comments