unum-cloud / ucall

Web Serving and Remote Procedure Calls at 50x lower latency and 70x higher bandwidth than FastAPI, implementing JSON-RPC & REST over io_uring ☎️
https://unum-cloud.github.io/ucall/
Apache License 2.0
1.15k stars 43 forks source link

Feature: Add Command Line Interface #52

Closed ashvardanian closed 1 year ago

ashvardanian commented 1 year ago

Describe what you are looking for

It would be nice, if, with a running server, we could do the following from the command line:

ujrpc encode_text 'some text'

... for position single-argument text. Or for multi-modal UForm calls:

ujrpc encode_multimodal --text 'some text' --image ./local/image.png

The tricky part is inferring the expected type of payload so that the images are fetched from the disk and sent as binary. Is there a good way to do that?


Potentially related, we may want to have "system" calls in our JSON-RPC flavor, as the official documentation suggests.

A String containing the name of the method to be invoked. Method names that begin with the word rpc followed by a period character (U+002E or ASCII 46) are reserved for rpc-internal methods and extensions and MUST NOT be used for anything else.

If seconded, the rpc.list method can list available methods with the JSON Schema of allowed argument types. Still, that may be implemented in a separate fork under a different issue.


Returning to simple things, if we don't do any complex argument introspection, implementing this is pretty straightforward in Python, even with colored output.

Can you contribute to the implementation?

Is your feature request specific to a certain interface?

Official Python bindings

Contact Details

No response

Is there an existing issue for this?

Code of Conduct