| Crates.io | flame-rs |
| lib.rs | flame-rs |
| version | 0.5.0 |
| created_at | 2025-02-09 11:30:43.394278+00 |
| updated_at | 2025-11-19 06:13:53.492372+00 |
| description | The Rust SDK of Flame |
| homepage | |
| repository | https://github.com/xflops/flame |
| max_upload_size | |
| id | 1548898 |
| size | 113,901 |
Flame is a distributed system designed for Agentic AI, providing a comprehensive suite of mechanisms commonly required by various classes of Agentic AI workloads, including tools, Agent, and more. Built upon over a decade and a half of experience running diverse high-performance workloads at scale across multiple systems and platforms, Flame incorporates best-of-breed ideas and practices from the open source community.
As Agentic AI become increasingly adopted for innovation, a common workload runtime is essential to accelerate these elastic workloads through the following key aspects:

Session: A Session represents a group of related tasks. The Session Scheduler allocates resources to each session based on scheduling configurations by requesting the resource manager (e.g., Kubernetes) to launch executors. Clients can continuously create tasks until the session is closed.
Task: A task within a Session contains the main algorithm defined by the task's metadata and input/output information (e.g., volume paths).
Executor: The Executor manages the lifecycle of Applications/Services, which contain the user's code for executing tasks. Applications are typically not reused between sessions, though images may be reused to avoid repeated downloads.
Shim: The protocol implementation used by the Executor to manage applications, supporting various protocols such as gRPC, RESTful APIs, stdio, and more.
Flame accepts connections from user clients and creates Sessions for jobs. Clients can continuously submit tasks to a session until it's closed, with no predefined replica requirements.
The Session Scheduler allocates resources to each session based on scheduling configurations by requesting the resource manager (e.g., Kubernetes) to launch executors.
Executors connect back to Flame via gRPC to pull tasks from their related Session and reuse the executor. Executors are released/deleted when no more tasks remain in the related session.
Services receive notifications when they're bound or unbound to related sessions, allowing them to take appropriate actions (e.g., connecting to databases). Services can then pull tasks from the Session and reuse data to accelerate execution.
Future enhancements to the Session Scheduler will include features to improve performance and usage, such as proportional allocation, delayed release, and min/max constraints.
This guide uses Docker Compose to start a local Flame cluster. After installing docker compose, you can start a local Flame cluster with the following steps:
$ docker compose up -d
After the Flame cluster is launched, use the following steps to log into the flame-console pod, which serves as a debug tool for both developers and SREs:
$ docker compose exec flame-console /bin/bash
Then, verify the installation with flmping in the pod. Additionally, you can explore more meaningful examples here:
root@560624b037c9:/# flmping
Session <1> was created in <3 ms>, start to run <10> tasks in the session:
Session Task State Output
1 5 Succeed b"Task <1/5> is executed on <\"97b4fe83409e\">"
1 3 Succeed b"Task <1/3> is executed on <\"97b4fe83409e\">"
1 10 Succeed b"Task <1/10> is executed on <\"97b4fe83409e\">"
1 1 Succeed b"Task <1/1> is executed on <\"97b4fe83409e\">"
1 2 Succeed b"Task <1/2> is executed on <\"97b4fe83409e\">"
1 6 Succeed b"Task <1/6> is executed on <\"97b4fe83409e\">"
1 7 Succeed b"Task <1/7> is executed on <\"97b4fe83409e\">"
1 4 Succeed b"Task <1/4> is executed on <\"97b4fe83409e\">"
1 8 Succeed b"Task <1/8> is executed on <\"97b4fe83409e\">"
1 9 Succeed b"Task <1/9> is executed on <\"97b4fe83409e\">"
<10> tasks was completed in <473 ms>.
You can check session status using flmctl as follows. It also includes several sub-commands, such as list:
root@560624b037c9:/# flmctl list -s
ID State App Slots Pending Running Succeed Failed Created
1 Closed flmping 1 0 0 10 0 01:07:16
We welcome contributions! Please see our contributing guidelines for more information.
This project is licensed under the terms specified in the LICENSE file.