File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
src/ai/backend/manager/api Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,8 @@ async def get_resource_slots(request: web.Request) -> web.Response:
9090 log .info ("ETCD.GET_RESOURCE_SLOTS ()" )
9191 root_ctx : RootContext = request .app ["_root.context" ]
9292 known_slots = await root_ctx .config_provider .legacy_etcd_config_loader .get_resource_slots ()
93- return web .json_response (known_slots , status = HTTPStatus .OK )
93+ serializable_known_slots = {str (k ): v .value for k , v in known_slots .items ()}
94+ return web .json_response (serializable_known_slots , status = HTTPStatus .OK )
9495
9596
9697@check_api_params (
Original file line number Diff line number Diff line change 33from collections .abc import Iterable , Sequence
44from dataclasses import dataclass
55from datetime import datetime
6- from decimal import Decimal
76from http import HTTPStatus
87from typing import TYPE_CHECKING , Any , Optional , Self
98
3029from ai .backend .common .types import (
3130 MODEL_SERVICE_RUNTIME_PROFILES ,
3231 AccessKey ,
33- BinarySize ,
3432 ClusterMode ,
3533 ResourceSlot ,
3634 RuntimeVariant ,
@@ -375,11 +373,11 @@ class ServiceConfigModel(LegacyBaseRequestModel):
375373 )
376374 resources : ResourceSlot = Field (
377375 examples = [
378- ResourceSlot ( {
379- "cpu" : Decimal ( 4 ) ,
380- "mem" : Decimal ( BinarySize . from_str ( "32g" )) ,
381- "cuda.shares" : Decimal ( "2.5" ) ,
382- })
376+ {
377+ "cpu" : 4 ,
378+ "mem" : "32g" ,
379+ "cuda.shares" : "2.5" ,
380+ }
383381 ]
384382 )
385383 resource_opts : dict [str , str | int | bool ] = Field (examples = [{"shmem" : "2g" }], default = {})
You can’t perform that action at this time.
0 commit comments