Giter VIP home page Giter VIP logo

unum-cloud / ucall Goto Github PK

View Code? Open in Web Editor NEW
992.0 15.0 35.0 3.99 MB

Remote Procedure Calls - 50x lower latency and 70x higher bandwidth than FastAPI, implementing JSON-RPC & ๐Ÿ”œ REST over io_uring and SIMDJSON โ˜Ž๏ธ

Home Page: https://unum-cloud.github.io/ucall/

License: Apache License 2.0

Python 5.75% C 57.62% C++ 33.69% CMake 2.64% Dockerfile 0.29%
cpython epoll fast-api flask io-uring json json-rpc liburing python simdjson

ucall's Introduction

UCall

JSON Remote Procedure Calls Library
Up to 100x Faster than FastAPI


Discord ย ย ย  LinkedIn ย ย ย  Twitter ย ย ย  Blog ย ย ย  GitHub


Most modern networking is built either on slow and ambiguous REST APIs or unnecessarily complex gRPC. FastAPI, for example, looks very approachable. We aim to be equally or even simpler to use.

FastAPIUCall
pip install fastapi uvicorn
pip install ucall
from fastapi import FastAPI
import uvicorn

server = FastAPI()

@server.get('/sum')
def sum(a: int, b: int):
    return a + b

uvicorn.run(...)    
from ucall.posix import Server
# from ucall.uring import Server on 5.19+

server = Server()

@server
def sum(a: int, b: int):
    return a + b

server.run()    

It takes over a millisecond to handle a trivial FastAPI call on a recent 8-core CPU. In that time, light could have traveled 300 km through optics to the neighboring city or country, in my case. How does UCall compare to FastAPI and gRPC?

Setup ๐Ÿ” Server Latency w 1 client Throughput w 32 clients
Fast API over REST โŒ ๐Ÿ 1'203 ฮผs 3'184 rps
Fast API over WebSocket โœ… ๐Ÿ 86 ฮผs 11'356 rps ยน
gRPC ยฒ โœ… ๐Ÿ 164 ฮผs 9'849 rps
UCall with POSIX โŒ C 62 ฮผs 79'000 rps
UCall with io_uring โœ… ๐Ÿ 40 ฮผs 210'000 rps
UCall with io_uring โœ… C 22 ฮผs 231'000 rps
Table legend

All benchmarks were conducted on AWS on general purpose instances with Ubuntu 22.10 AMI. It is the first major AMI to come with Linux Kernel 5.19, featuring much wider io_uring support for networking operations. These specific numbers were obtained on c7g.metal beefy instances with Graviton 3 chips.

  • The ๐Ÿ” column marks, if the TCP/IP connection is being reused during subsequent requests.
  • The "server" column defines the programming language, in which the server was implemented.
  • The "latency" column report the amount of time between sending a request and receiving a response. ฮผ stands for micro, ฮผs subsequently means microseconds.
  • The "throughput" column reports the number of Requests Per Second when querying the same server application from multiple client processes running on the same machine.

ยน FastAPI couldn't process concurrent requests with WebSockets.

ยฒ We tried generating C++ backends with gRPC, but its numbers, suspiciously, weren't better. There is also an async gRPC option, that wasn't tried.

How is that possible?!

How can a tiny pet-project with just a couple thousand lines of code compete with two of the most established networking libraries? UCall stands on the shoulders of Giants:

  • io_uring for interrupt-less IO.

    • io_uring_prep_read_fixed on 5.1+.
    • io_uring_prep_accept_direct on 5.19+.
    • io_uring_register_files_sparse on 5.19+.
    • IORING_SETUP_COOP_TASKRUN optional on 5.19+.
    • IORING_SETUP_SINGLE_ISSUER optional on 6.0+.
  • SIMD-accelerated parsers with manual memory control.

You have already seen the latency of the round trip..., the throughput in requests per second..., want to see the bandwidth? Try yourself!

@server
def echo(data: bytes):
    return data

More Functionality than FastAPI

FastAPI supports native type, while UCall supports numpy.ndarray, PIL.Image and other custom types. This comes handy when you build real applications or want to deploy Multi-Modal AI, like we do with UForm.

from ucall.rich_posix import Server
import ufrom

server = Server()
model = uform.get_model('unum-cloud/uform-vl-multilingual')

@server
def vectorize(description: str, photo: PIL.Image.Image) -> numpy.ndarray:
    image = model.preprocess_image(photo)
    tokens = model.preprocess_text(description)
    joint_embedding = model.encode_multimodal(image=image, text=tokens)

    return joint_embedding.cpu().detach().numpy()

We also have our own optional Client class that helps with those custom types.

from ucall.client import Client

client = Client()
# Explicit JSON-RPC call:
response = client({
    'method': 'vectorize',
    'params': {
        'description': description,
        'image': image,
    },
    'jsonrpc': '2.0',
    'id': 100,
})
# Or the same with syntactic sugar:
response = client.vectorize(description=description, image=image) 

CLI like cURL

Aside from the Python Client, we provide an easy-to-use Command Line Interface, which comes with pip install ucall. It allow you to call a remote server, upload files, with direct support for images and NumPy arrays. Translating previous example into a Bash script, to call the server on the same machine:

ucall vectorize description='Product description' -i image=./local/path.png

To address a remote server:

ucall vectorize description='Product description' -i image=./local/path.png --uri 0.0.0.0 -p 8545

To print the docs, use ucall -h:

usage: ucall [-h] [--uri URI] [--port PORT] [-f [FILE ...]] [-i [IMAGE ...]] [--positional [POSITIONAL ...]] method [kwargs ...]

UCall Client CLI

positional arguments:
  method                method name
  kwargs                method arguments

options:
  -h, --help            show this help message and exit
  --uri URI             server uri
  --port PORT           server port
  -f [FILE ...], --file [FILE ...]
                        method positional arguments
  -i [IMAGE ...], --image [IMAGE ...]
                        method positional arguments
  --positional [POSITIONAL ...]
                        method positional arguments

You can also explicitly annotate types, to distinguish integers, floats, and strings, to avoid ambiguity.

ucall auth id=256
ucall auth id:int=256
ucall auth id:str=256

Free Tier Throughput

We will leave bandwidth measurements to enthusiasts, but will share some more numbers. The general logic is that you can't squeeze high performance from Free-Tier machines. Currently AWS provides following options: t2.micro and t4g.small, on older Intel and newer Graviton 2 chips. This library is so fast, that it doesn't need more than 1 core, so you can run a fast server even on a tiny Free-Tier server!

Setup ๐Ÿ” Server Clients t2.micro t4g.small
Fast API over REST โŒ ๐Ÿ 1 328 rps 424 rps
Fast API over WebSocket โœ… ๐Ÿ 1 1'504 rps 3'051 rps
gRPC โœ… ๐Ÿ 1 1'169 rps 1'974 rps
UCall with POSIX โŒ C 1 1'082 rps 2'438 rps
UCall with io_uring โœ… C 1 - 5'864 rps
UCall with POSIX โŒ C 32 3'399 rps 39'877 rps
UCall with io_uring โœ… C 32 - 88'455 rps

In this case, every server was bombarded by requests from 1 or a fleet of 32 other instances in the same availability zone. If you want to reproduce those benchmarks, check out the sum examples on GitHub.

Quick Start

For Python:

pip install ucall

For CMake projects:

include(FetchContent)
FetchContent_Declare(
    ucall
    GIT_REPOSITORY https://github.com/unum-cloud/ucall
    GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(ucall)
include_directories(${ucall_SOURCE_DIR}/include)

The C usage example is mouthful compared to Python. We wanted to make it as lightweight as possible and to allow optional arguments without dynamic allocations and named lookups. So unlike the Python layer, we expect the user to manually extract the arguments from the call context with ucall_param_named_i64(), and its siblings.

#include <cstdio.h>
#include <ucall/ucall.h>

static void sum(ucall_call_t call, ucall_callback_tag_t) {
    int64_t a{}, b{};
    char printed_sum[256]{};
    bool got_a = ucall_param_named_i64(call, "a", 0, &a);
    bool got_b = ucall_param_named_i64(call, "b", 0, &b);
    if (!got_a || !got_b)
        return ucall_call_reply_error_invalid_params(call);

    int len = snprintf(printed_sum, 256, "%ll", a + b);
    ucall_call_reply_content(call, printed_sum, len);
}

int main(int argc, char** argv) {

    ucall_server_t server{};
    ucall_config_t config{};

    ucall_init(&config, &server);
    ucall_add_procedure(server, "sum", &sum, NULL);
    ucall_take_calls(server, 0);
    ucall_free(server);
    return 0;
}

Roadmap

  • Batch Requests
  • JSON-RPC over raw TCP sockets
  • JSON-RPC over TCP with HTTP
  • Concurrent sessions
  • NumPy array and Pillow serialization
  • HTTPS support
  • Batch-capable endpoints for ML
  • Zero-ETL relay calls
  • Integrating with UKV
  • WebSockets for web interfaces
  • AF_XDP and UDP-based analogs on Linux

Want to affect the roadmap and request a feature? Join the discussions on Discord.

Why JSON-RPC?

  • Transport independent: UDP, TCP, bring what you want.
  • Application layer is optional: use HTTP or not.
  • Unlike REST APIs, there is just one way to pass arguments.

ucall's People

Contributors

1lumin avatar arman-ghazaryan avatar ashvardanian avatar darvinharutyunyan avatar gurgenyegoryan avatar ishkhan42 avatar markreedz avatar ngalstyan4 avatar semantic-release-bot avatar vovor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ucall's Issues

Feature: Add a C++ client version in the examples

Describe what you are looking for

Feature: Add a C++ client version in the examples

Can you contribute to the implementation?

  • I can contribute

Is your feature request specific to a certain interface?

It applies to everything

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Bug: Some strings are interpreted as binary

Describe the bug

In python Client string can be wrongly decoded with base64 and return a corrupted result.

Steps to reproduce

Try this string: Hello==.

Expected behavior

Obvious.

UJRPC version

v0.1.1

Operating System

Any

Hardware architecture

x86

Which interface are you using?

Official Python bindings

Which implementation are you using?

POSIX

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Feature: Semantic Versioning

Describe what you are looking for

Semantic versioning automates the whole package release workflow including: determining the next version number, generating the release notes, and publishing the package.

Can you contribute to the implementation?

  • I can contribute

Is your feature request specific to a certain interface?

It applies to everything

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Feature: Benchmark With heavier payloads

Describe what you are looking for

Benchmark with heavier payloads, like 1kb or 3kb consisting partly from string and binary.

Can you contribute to the implementation?

  • I can contribute

Is your feature request specific to a certain interface?

It applies to everything

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Feature: FastAPI call-compatible replacement

Describe what you are looking for

I am a bit confused by your comparison to FastAPI. FastAPI can rapidly build REST APIs atop relational databases, with a flexible middleware component for customizing responses. Does your system do anything like this? Why compare the two if you can't quickly replace FastAPI with your system, i.e. you would have to rewrite a great deal of code. If you can replace it, please explain a bit.

From the existing README, it seems like you are focused only on lower-level protocol replacement for increased speed using JSON-RPC but then the comparison between the systems doesn't make much sense to me.

Can you contribute to the implementation?

  • I can contribute

Is your feature request specific to a certain interface?

It applies to everything

Contact Details

[email protected]

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Feature: Add Command Line Interface

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?

  • I can contribute

Is your feature request specific to a certain interface?

Official Python bindings

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Rewriting the Python `Client` with HTTPX

Describe what you are looking for

Given the performance issues highlighted in #80, we need to rewrite the Python client side to use a more efficient library, that reuses the connections. HTTPX seems like the go-to option.

Can you contribute to the implementation?

  • I can contribute

Is your feature request specific to a certain interface?

It applies to everything

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Bug: Cannot call the server

Describe the bug

After creating a custom server in python using ujrpc and starting the server, on sending a request server terminates.

This also happens while using examples/sum/ujrpc_server.py directly from inside the codebase.

SERVER:
ujrpc-server

CLIENT (cURL):
ujrpc-curl

Tried sending request using cURL, Postman with & without any data.

However, running the benchmarks run successfully.
ujrpc-benchmark

Steps to reproduce

System: W11, WSL2
Python 3.10.6
pip 23.0.1
virtualenv 20.20.0

  1. Clone the project
  2. Create a virtual environment & source it
  3. install all required packages pip install uvicorn fastapi websocket-client requests tqdm fire
  4. run the server python examples/sum/ujrpc_server.py
  5. request using cURL or Postman

Expected behavior

  1. Calling with / without data should not terminate the server
  2. Calling with proper data & method should return valid data

UJRPC version

0.0.9

Operating System

W11-WSL2-Ubuntu22.04

Hardware architecture

x86

Which interface are you using?

Official Python bindings

Which implementation are you using?

POSIX

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Bug: Core dump with the uring example

Describe the bug

On Ubuntu 22 with kernel 6.0.19 with the uring example the go client hangs and wrk causes a core dump.

On Ubuntu 23.10 with the base 6.5 kernel both cases hang.

Steps to reproduce

  cmake -DCMAKE_BUILD_TYPE=Release -B ./build_release  && make -C ./build_release
  ./build_release/build/bin/ucall_example_login_uring

  go run ./examples/login/jsonrpc_client.go
    hangs
  wrk -t1 -c1 -d2s http://localhost:8545/ -s examples/login/json.lua
    core dump

Expected behavior

Curl does work fine:

curl --header "Content-Type: application/json" --request POST --data '{"jsonrpc":"2.0","method":"validate_session","params":{"user_id":55,"session_id":21},"id":0}' http://localhost:8545/

{"jsonrpc":"2.0","id":0,"result":false}

UCall version

main branch

Operating System

Ubuntu 22.04

Hardware architecture

x86

Which interface are you using?

Native C interface

Which implementation are you using?

io_uring

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Feature: Move Python dependencies into extras

Describe what you are looking for

Pillow and NumPy aren't as heavy as PyTorch, but it would be nice to move those into a list of optional dependencies.

Can you contribute to the implementation?

  • I can contribute

Is your feature request specific to a certain interface?

It applies to everything

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Bug: `uring` uknown content-length for raw `tcp` connections

Describe the bug

When using uring backend and doing a simple TCP query, it is not clear how much to read on the client side as socket is not closed, and there is no information about the length of the content.

Steps to reproduce

python3 examples/login/ujrpc_server.py &
python3 examples/bench.py "login.jsonrpc_client.CaseTCP" --progress

the second process will hang.

Expected behavior

Return empty response just like posix does, without hanging.

UJRPC version

0.2.8

Operating System

Ubuntu

Hardware architecture

x86

Which interface are you using?

Official Python bindings

Which implementation are you using?

io_uring

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Bug: Not stopping the server on `SIGINT`

Describe the bug

The server doesn't stop.

Steps to reproduce

Start a Python server and press Ctrl + C.

Expected behavior

Stopping the server and gracefully closing the connections before that.

UJRPC version

v0.2.2

Operating System

Ubuntu 22.04

Hardware architecture

x86

Which interface are you using?

Official Python bindings

Which implementation are you using?

POSIX

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Bug: Segmentation Fault when accessing server via client

Describe the bug

Using ucall client to call a ucall server is causing the server to seg fault.

Attaching coredump info
ucall-segfault-coredump.log

Steps to reproduce

Server:

# https://ashvardanian.com/posts/abusing-vector-search/#multi-index-lookups
from usearch import Index
from uform import get_model
from ucall.rich_posix import Server
from PIL import Image
import numpy as np

server = Server()

index_images = Index(ndim=256)
index_texts = Index(ndim=256)
index_coordinates = Index(metric='haversine')

model = get_model('unum-cloud/uform-vl-english')

@server
def recommend(text: str, image: Image, latitude: float, longitude: float) -> list[int]:
    vector_image = model.encode_image(model.preprocess_image(image)).numpy()
    vector_text = model.encode_text(model.preprocess_text(text)).numpy()
    vector_coordinate = np.array([latitude, longitude], dtype=np.float32)

    similar_images, _, _ = index_images.search(vector_image, 30)
    similar_texts, _, _ = index_texts.search(vector_text, 30)
    similar_coordinates, _, _ = index_coordinates.search(vector_coordinate, 100)

    # If a listing is physically close and matches text or image, it must be first.
    similar_contents = set(similar_images) + set(similar_texts)
    return [label for label in similar_coordinates if label in similar_contents]

server.run()

Client:

from ucall.client import Client
from PIL import Image
import geocoder
import json

client = Client()

text = "mountain top"
image = Image.open("/mnt/900/input/landscapes/processed-2/0f9wmnta7ik91+768x768.jpg")

[lat, long] = geocoder.ip('me').latlng

response = client.recommend(text=text, image=image, latitude=lat, longitude=long) 

print(response.json)

Expected behavior

Expected to get a response back from the server, or an error to try to isolate the problem. Maybe my code is not accurate?

Thank you

UCall version

0.4.0

Operating System

archlinux

Hardware architecture

x86

Which interface are you using?

Official Python bindings

Which implementation are you using?

POSIX

Contact Details

[email protected]

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Bug: raise `jsonrpc` exceptions in python

Describe what you are looking for

Return actual errors from python server, and raise them in Client

Can you contribute to the implementation?

  • I can contribute

Is your feature request specific to a certain interface?

Official Python bindings

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Feature: Windows

Describe what you are looking for

Hi, How can I use it in Windows?

Could you give me an example in python?

from ucall.posix import Server

from ucall.uring import Server on 5.19+

server = Server()

@server
def sum(a: int, b: int):
return a + b

server.run()

but it's not wirking.

Can you contribute to the implementation?

  • I can contribute

Is your feature request specific to a certain interface?

Official Python bindings

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Bug: reponse error: Out of memory

Describe the bug

ucall server code:
from ucall.posix import Server

from ucall.uring import Server on 5.19+

server = Server(
port=8845,
# ssl_pk='./examples/login/certs/main.key',
# ssl_certs=[
# './examples/login/certs/srv.crt',
# './examples/login/certs/cas.pem']
)

class People:
name: str
gender: str
age: int
addr: str
height: int
weight: int
hobbies: []

def __init__(self, name, gender, age, addr, height, weight, hobbies):
    self.name = name
    self.gender = gender
    self.addr = addr
    self.age = age
    self.height = height
    self.weight = weight
    self.hobbies = hobbies

people = People('zhangsan', 'F', 18, 'cn', 185, 70, ['a', 'b', 'c'])

@server
def sum(a: int, b: int):
return a + b

@server
def test_json():
return people

server.run()

when i request the test_json method , response error message is Out of memory.

Steps to reproduce

error

Expected behavior

success data response

UCall version

v0.5.1

Operating System

4.19.90-25.5.v2101.ky10.aarch64

Hardware architecture

Arm

Which interface are you using?

Official Python bindings

Which implementation are you using?

POSIX

Contact Details

[email protected]

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Feature: Python 3.12 support

Describe what you are looking for

Python 3.11 support is working great but, ecosystem moves to Python 3.12. Can you support Python 3.12 and publish new version?

Can you contribute to the implementation?

  • I can contribute

Is your feature request specific to a certain interface?

It applies to everything

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Feature: Positional arguments in Python

Describe what you are looking for

At this point, our C layer is pretty generic, it allows both named and positional arguments, but the Python part is more opinionated. It only assembles and forwards named arguments. Let's add support for positional "params" in JSON-RPC calls both on the client and server sides.

Can you contribute to the implementation?

  • I can contribute

Is your feature request specific to a certain interface?

Official Python bindings

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Feature: Auto-selecting the right native implementation

Describe what you are looking for

It's quite easy and cheap to pick the right underlying engine on startup. Much more reasonable for the user to replace rich_posix with rich_uring and understand the difference between POSIX and io_uring backends. I suggest:

  1. Deprecating the rich vs. native distinction.
  2. Auto-selecting between POSIX and io_uring.

It poses a question. If a function is only using built-in Python types, can we avoid the costly 2-layer decorator, and just pass it to the native implementation?

Can you contribute to the implementation?

  • I can contribute

Is your feature request specific to a certain interface?

Official Python bindings

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Feature: Allow `Union` types

Describe what you are looking for

Sometimes you may want to allow Union types in callbacks like this:

def update_user_age(id: Union[int, str], age: Union[float, int]):
    pass

We don't support that yet, but we should.

Related Reddit request.

Can you contribute to the implementation?

  • I can contribute

Is your feature request specific to a certain interface?

Official Python bindings

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Feature: NumPy `array` serialization

Describe what you are looking for

We need to make the following Python server a reality to empower the next X-illion of Machine Learning applications.

import numpy as np

def sum(a: np.array, b: np.array):
    return a + b

This can be done by serializing into a custom format binary string or encoding each array into a dictionary that mentions the internal scalar type.

Can you contribute to the implementation?

  • I can contribute

Is your feature request specific to a certain interface?

Official Python bindings

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Bug: bool type error in `ucall.cli:cast`

Describe the bug

hello. I came here after looking at usearch on langchain and browsing the repository.

While looking at the code, I noticed a potential type error and wrote this issue.

ucall/src/ucall/cli.py

Lines 31 to 32 in bca04ed

if value in ['True', 'False']:
return bool(value)

In Python, when you call bool on a non-empty string, its value is True, so the above function will always return True.

Steps to reproduce

>>> from ucall.cli import cast

>>> cast("True", None) is True
True
>>> cast("False", None) is True
True

Expected behavior

cast("False", None) should be False.

        if value in ['True', 'False']:
            return value == 'True'

UCall version

v0.5.1

Operating System

Ubuntu 22.04

Hardware architecture

x86

Which interface are you using?

Official Python bindings

Which implementation are you using?

posix

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Feature: TLS integration for HTTPS support

Describe what you are looking for

Secure internet connections are a must for broad internet applications. We need to implement the handshake as an optional feature. It will make the POSIX server much slower, but the io_uring won't change much in performance. Only the complexity of the automata will increase.

Can you contribute to the implementation?

  • I can contribute

Is your feature request specific to a certain interface?

It applies to everything

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Generalize logging mechanism across POSIX and io_uring

The current logging mechanism from engine_uring should be moved into one of the headers and reused in engine_posix to simplify reporting. Furthermore, input configuration may allow passing a pre-opened file descriptor. The logs would be written in either a current free-form human-readable format or a JSON machine-readable format. With a file descriptor pointing to a socket, this would allow reporting the statistics to a remote server.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.