yomo
yomo copied to clipboard
π¦ Stateful Serverless Framework for Geo-distributed Edge AI Infra. with function calling support, write once, run on any model.
YoMo

YoMo is an open-source Streaming Serverless Framework for building Low-latency Edge Computing applications. Built atop QUIC Transport Protocol and Functional Reactive Programming interface, it makes real-time data processing reliable, secure, and easy.
Official Website: π¦https://yomo.run
π We care about: The Demand For Real-Time Digital User Experiences
Itβs no secret that todayβs users want instant gratification, every productivity application is more powerful when it's collaborative. But, currently, when we talk about distribution
, it represents distribution in data center. API is far away from their users from all over the world.
If an application can be deployed anywhere close to their end users, solve the problem, this is Geo-distributed System Architecture:

πΆ Features
Features | |
---|---|
β‘οΈ | Low-latency Guaranteed by implementing atop QUIC QUIC |
π | Security TLS v1.3 on every data packet by design |
π± | 5G/WiFi-6 Reliable networking in Celluar/Wireless |
π | Geo-Distributed Edge Mesh Edge-Mesh Native architecture makes your services close to end users |
πΈ | Event-First Architecture leverages serverless service to be event driven and elastic |
π¦ | Streaming Serverless Write only a few lines of code to build applications and microservices |
π | Y3 a faster than real-time codec |
π¨ | Reactive stream processing based on Rx |
π Getting Started
Prerequisite
1. Install CLI
curl -fsSL https://get.yomo.run | sh
Verify if the CLI was installed successfully
$ yomo version
YoMo CLI Version: v1.1.1
Runtime Version: v1.8.1
2. Create your stream function
$ yomo init yomo-app-demo
β Initializing the Stream Function...
β
Congratulations! You have initialized the stream function successfully.
βΉοΈ You can enjoy the YoMo Stream Function via the command:
βΉοΈ DEV: yomo dev -n Noise yomo-app-demo/app.go
βΉοΈ PROD: First run source application, eg: go run example/source/main.go
Second: yomo run -n yomo-app-demo yomo-app-demo/app.go
$ cd yomo-app-demo
CLI will automatically create the app.go
:
package main
import (
"context"
"encoding/json"
"fmt"
"time"
"github.com/yomorun/yomo/rx"
)
// NoiseData represents the structure of data
type NoiseData struct {
Noise float32 `json:"noise"` // Noise value
Time int64 `json:"time"` // Timestamp (ms)
From string `json:"from"` // Source IP
}
var echo = func(_ context.Context, i interface{}) (interface{}, error) {
value := i.(*NoiseData)
value.Noise = value.Noise / 10
rightNow := time.Now().UnixNano() / int64(time.Millisecond)
fmt.Println(fmt.Sprintf("[%s] %d > value: %f β‘οΈ=%dms", value.From, value.Time, value.Noise, rightNow-value.Time))
return value.Noise, nil
}
// Handler will handle data in Rx way
func Handler(rxstream rx.Stream) rx.Stream {
stream := rxstream.
Unmarshal(json.Unmarshal, func() interface{} { return &NoiseData{} }).
Debounce(50).
Map(echo).
StdOut()
return stream
}
func DataTags() []byte {
return []byte{0x33}
}
3. Build and run
- Run
yomo dev
from the terminal. you will see the following message:
$ yomo dev
βΉοΈ YoMo Stream Function file: app.go
β Create YoMo Stream Function instance...
β YoMo Stream Function building...
β
Success! YoMo Stream Function build.
βΉοΈ YoMo Stream Function is running...
2021/11/16 10:02:43 [core:client] has connected to yomo-app-demo (dev.yomo.run:9140)
[localhost] 1637028164050 > value: 6.575044 β‘οΈ=9ms
[StdOut]: 6.5750437
[localhost] 1637028164151 > value: 10.076103 β‘οΈ=5ms
[StdOut]: 10.076103
[localhost] 1637028164251 > value: 15.560066 β‘οΈ=8ms
[StdOut]: 15.560066
[localhost] 1637028164352 > value: 15.330824 β‘οΈ=2ms
[StdOut]: 15.330824
[localhost] 1637028164453 > value: 10.859857 β‘οΈ=7ms
[StdOut]: 10.859857
Congratulations! You have done your first YoMo Stream Function.
𧩠Interop
Metaverse Workplace (Virtual Office) with YoMo
Sources
Stream Functions
Output Connectors
- Connect to FaunaDB to store post-processed result the serverless way
- Connect to InfluxDB to store post-processed result
- Connect to TDEngine to store post-processed result
πΊ Location Insensitive Deployment
π Documentation
-
YoMo-Source
: docs.yomo.run/source -
YoMo-Stream-Function
: docs.yomo.run/stream-function -
YoMo-Zipper
: docs.yomo.run/zipper -
Stream Processing in Rx way
: Rx -
Faster than real-time codec
: Y3
YoMo β€οΈ Vercel, our documentation website is
π― Focuses on computings out of data center
- IoT/IIoT/AIoT
- Latency-sensitive applications.
- Networking situation with packet loss or high latency.
- Handling continuous high frequency generated data with stream-processing.
- Building Complex systems with Streaming-Serverless architecture.
π Why YoMo
- Based on QUIC (Quick UDP Internet Connection) protocol for data transmission, which uses the User Datagram Protocol (UDP) as its basis instead of the Transmission Control Protocol (TCP); significantly improves the stability and throughput of data transmission. Especially for cellular networks like 5G.
- A self-developed
y3-codec
optimizes decoding performance. For more information, visit its own repository on GitHub. - Based on stream computing, which improves speed and accuracy when dealing with data handling and analysis; simplifies the complexity of stream-oriented programming.
- Secure-by-default from transport protocol.
π¦Έ Contributing
First off, thank you for considering making contributions. It's people like you that make YoMo better. There are many ways in which you can participate in the project, for example:
- File a bug report. Be sure to include information like what version of YoMo you are using, what your operating system is, and steps to recreate the bug.
- Suggest a new feature.
- Read our contributing guidelines to learn about what types of contributions we are looking for.
- We have also adopted a code of conduct that we expect project participants to adhere to.
π€Ήπ»ββοΈ Feedback
Any questions or good ideas, please feel free to come to our Discussion. Any feedback would be greatly appreciated!
πββοΈ Best Practice in Production
Discussion #314 Tips: YoMo/QUIC Server Performance Tuning