YoMo: An Overview
YoMo is an open-source framework designed to facilitate the creation of Geo-distributed AI applications. It leverages advanced technologies like the QUIC Transport Protocol and Stateful Serverless architecture, bringing robust features such as low-latency, security, and ease of use to the forefront for AI developers. YoMo is particularly focused on enhancing customer experience in the AI era, ensuring applications perform reliably and efficiently close to users.
Features of YoMo
- Low-latency: YoMo is built on the QUIC protocol, which guarantees reduced delay in data transmission.
- Security: Every data packet is secured with TLS v1.3 by design, ensuring robust protection against unauthorized access.
- Stateful Serverless: The serverless architecture provides significant speed improvements, making GPU operations ten times faster.
- Geo-Distributed Architecture: This feature enhances AI application performance by bringing inference processes closer to end users.
- Y3 Codec: YoMo includes Y3, a codec that is touted to be faster than real time, enhancing data processing efficiency.
Getting Started with YoMo
To dive into using YoMo, here’s a straightforward guide to implement a function called sfn-currency-converter
.
Step 1: Install CLI
Begin by installing the YoMo CLI with the following command:
curl -fsSL https://get.yomo.run | sh
Verify the installation:
yomo version
Step 2: Start the Server
Prepare a configuration file named my-agent.yaml
with the necessary settings for authentication and AI service provider:
name: ai-zipper
host: 0.0.0.0
port: 9000
auth:
type: token
token: SECRET_TOKEN
bridge:
ai:
server:
addr: 0.0.0.0:8000
provider: openai
...
Start the server:
YOMO_LOG_LEVEL=debug yomo serve -c my-agent.yaml
Step 3: Write the Function
Define a function to retrieve IP and latency data for a domain using Go:
type Parameter struct {
Domain string `json:"domain" jsonschema:"description=Domain of the website,example=example.com"`
}
func Description() string {
return `if user asks ip or network latency of a domain, return the result of the given domain.`
}
func InputSchema() any {
return &Parameter{}
}
// Handle the domain information and return result
func Handler(ctx serverless.Context) {
var msg Parameter
ctx.ReadLLMArguments(&msg)
ips, _ := net.LookupIP(msg.Domain)
pinger, _ := ping.NewPinger(ips[0].String())
pinger.Count = 3
pinger.Run()
stats := pinger.Statistics()
val := fmt.Sprintf("domain %s has ip %s with average latency %s", msg.Domain, ips[0], stats.AvgRtt)
ctx.WriteLLMResult(val)
}
Run the function with:
$ yomo run app.go
Testing
Test the setup by simulating a domain speed comparison:
curl -i http://127.0.0.1:9000/v1/chat/completions -H "Content-Type: application/json" -d '{
"messages": [
{
"role": "system",
"content": "You are a test assistant."
},
{
"role": "user",
"content": "Compare website speed between Nike and Puma"
}
],
"stream": false
}'
Documentation and Community
For further exploration of YoMo, visit yomo.run/docs. The project also welcomes contributions from the community, inviting enthusiasts to file bug reports, suggest features, or read the contributing guidelines.
License
YoMo is released under the Apache License 2.0, ensuring it remains open and freely available for modification and distribution.