MCPcopy
hub / github.com/Lightning-AI/LitServe / TestDefaultBatchedAPI

Class TestDefaultBatchedAPI

tests/unit/test_litapi.py:27–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25
26
27class TestDefaultBatchedAPI(ls.LitAPI):
28 def setup(self, device) -> None:
29 self.model = lambda x: len(x)
30
31 def decode_request(self, request):
32 return request["input"]
33
34 def predict(self, x):
35 return self.model(x)
36
37 def encode_response(self, output):
38 return {"output": output}
39
40
41class TestCustomBatchedAPI(TestDefaultBatchedAPI):

Calls

no outgoing calls

Tested by 2

Used in the wild real call sites across dependent graphs

searching dependent graphs…