<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Marie Aurore</title>
    <description>The latest articles on Forem by Marie Aurore (@marie_aurore).</description>
    <link>https://forem.com/marie_aurore</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2114098%2F66075f02-b1d5-421d-afdd-30e275ae7bca.png</url>
      <title>Forem: Marie Aurore</title>
      <link>https://forem.com/marie_aurore</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/marie_aurore"/>
    <language>en</language>
    <item>
      <title>⚡🦀 Deploy a blazing-fast &amp; Lightweight LLM app with Rust-Rig-LanceDB</title>
      <dc:creator>Marie Aurore</dc:creator>
      <pubDate>Fri, 22 Nov 2024 16:00:35 +0000</pubDate>
      <link>https://forem.com/marie_aurore/deploy-a-blazing-fast-lightweight-llm-app-with-rust-rig-lancedb-139l</link>
      <guid>https://forem.com/marie_aurore/deploy-a-blazing-fast-lightweight-llm-app-with-rust-rig-lancedb-139l</guid>
      <description>&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A step-by-step walkthrough on deploying a LLM app using &lt;a href="https://github.com/0xPlaygrounds/rig" rel="noopener noreferrer"&gt;&lt;code&gt;Rig&lt;/code&gt;&lt;/a&gt; &amp;amp; &lt;a href="https://lancedb.com" rel="noopener noreferrer"&gt;&lt;code&gt;LanceDB&lt;/code&gt;&lt;/a&gt; on AWS Lambda. You'll learn how to prepare your app, choose the right storage backend (like S3 or EFS), and optimize performance by efficiently using cloud metrics. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stats: Rig RAG Agent using LanceDB on AWS :&lt;/strong&gt;

&lt;ol&gt;
&lt;li&gt;Low memory usage (96MB - 113MB)&lt;/li&gt;
&lt;li&gt;Fast cold starts (consistently 160ms)&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stats: LangChain RAG Agent using LanceDB on AWS:&lt;/strong&gt;

&lt;ol&gt;
&lt;li&gt;Higher memory usage (246MB - 360MB)&lt;/li&gt;
&lt;li&gt;Slower cold starts (1,900ms - 2,700ms)&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Jump to Metrics&lt;/strong&gt; ⏬ &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
How to Deploy Your Rig App with LanceDB: A Step-by-Step Guide

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;Prerequisites&lt;/li&gt;
&lt;li&gt;Our use case: Montreal 🌇&lt;/li&gt;
&lt;li&gt;LanceDB Quick Overview 💾&lt;/li&gt;
&lt;li&gt;
LanceDB Storage Backends

&lt;ul&gt;
&lt;li&gt;S3 - Object Store&lt;/li&gt;
&lt;li&gt;Lambda ephemeral storage - Local file system&lt;/li&gt;
&lt;li&gt;EFS - Virtual file system&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Metrics on the cloud ☁️

&lt;ul&gt;
&lt;li&gt;Memory, CPU, and runtime&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Langchain Montreal Agent App 🐍

&lt;ul&gt;
&lt;li&gt;Deployment package&lt;/li&gt;
&lt;li&gt;Memory, CPU, and runtime&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Final Comparison between Rig and LangChain&lt;/li&gt;

&lt;li&gt;Resources&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Welcome back to &lt;strong&gt;Deploy Your Rig Application&lt;/strong&gt;! Apps built with Rig vary in complexity based on LLM usage, vector databases for RAG, and infrastructure deployment. This series explores various configurations for production use.&lt;/p&gt;

&lt;p&gt;⭐ &lt;strong&gt;Today's Highlight&lt;/strong&gt;: Rig's &lt;strong&gt;LanceDB integration&lt;/strong&gt;! ⭐&lt;/p&gt;

&lt;p&gt;We'll deploy a Rig agent using OpenAI's &lt;code&gt;text-embedding-ada-002&lt;/code&gt; and &lt;code&gt;GPT-4o&lt;/code&gt;, relying on the &lt;a href="https://lancedb.com" rel="noopener noreferrer"&gt;LanceDB vector store&lt;/a&gt; and deployed on &lt;a href="https://aws.amazon.com/lambda/" rel="noopener noreferrer"&gt;AWS Lambda&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;💡 If you're new to Rig and want to start from the beginning or are looking for additional tutorials, check out our &lt;a href="https://rig.rs/build-with-rig-guide.html" rel="noopener noreferrer"&gt;blog series&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let’s dive in!&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before we begin building, ensure you have the following:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;❗ We will &lt;em&gt;not&lt;/em&gt; be covering how to write your RAG app with Rig, only how to deploy it. So make sure you read &lt;a href="https://dev.to/0thtachi/build-a-fast-and-lightweight-rust-vector-search-app-with-rig-lancedb-57h2"&gt;this tutorial&lt;/a&gt; first to help you code your application.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A clone of the &lt;a href="https://github.com/garance-buricatu/rig-aws/tree/master/rig-montreal-lancedb" rel="noopener noreferrer"&gt;&lt;code&gt;rig-montreal-lancedb&lt;/code&gt;&lt;/a&gt; crate  which includes two separate binaries: a &lt;a href="https://github.com/garance-buricatu/rig-aws/blob/master/rig-montreal-lancedb/src/bin/loader.rs" rel="noopener noreferrer"&gt;&lt;code&gt;loader&lt;/code&gt;&lt;/a&gt; (writes data to LanceDB) and an &lt;a href="https://github.com/garance-buricatu/rig-aws/blob/master/rig-montreal-lancedb/src/bin/app.rs" rel="noopener noreferrer"&gt;&lt;code&gt;app&lt;/code&gt;&lt;/a&gt; (performs RAG on LanceDB).
&lt;/li&gt;
&lt;li&gt;An AWS account and some background knowledge on deployments on AWS, including Cloudformation templates &lt;/li&gt;
&lt;li&gt;An OpenAI api key&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Our use case: Montreal 🌇
&lt;/h2&gt;

&lt;p&gt;The app in &lt;a href="https://github.com/garance-buricatu/rig-aws/tree/master/rig-montreal-lancedb" rel="noopener noreferrer"&gt;&lt;code&gt;rig-montreal-lancedb&lt;/code&gt;&lt;/a&gt; RAGs data from &lt;a href="https://donnees.montreal.ca" rel="noopener noreferrer"&gt;montreal open data&lt;/a&gt;. The Montréal municipality generates and manages large quantities of data through its activities, such as data about agriculture, politics, transportation, health and much more. The open data app publishes all these datasets and make them freely accessible to all citizens! Our app will index the metadata of all the public datasets so that a user can ask questions pertaining to the open data.&lt;br&gt;
The &lt;code&gt;loader&lt;/code&gt; binary indexes all dataset metadata (name, description, tags, ...) into LanceDB and the &lt;code&gt;app&lt;/code&gt; binary performs vector search on the data based on a prompt. For example: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Prompt:&lt;/strong&gt; Give me information on gaseous pollutants in Montreal. How are the concentrations measured?&lt;br&gt;
&lt;strong&gt;App answer:&lt;/strong&gt; The concentrations of gaseous pollutants in Montreal are measured through the Réseau de surveillance de la qualité de l'air (RSQA), which is a network of measurement stations located on the Island of Montreal. These stations continuously determine the atmospheric concentration of various pollutants. The data is transmitted via telemetry, ...&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  LanceDB Quick Overview 💾
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/lancedb/lance" rel="noopener noreferrer"&gt;&lt;strong&gt;Lance&lt;/strong&gt;&lt;/a&gt; is an &lt;strong&gt;open-source columnar data format&lt;/strong&gt; designed for performant ML workloads.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Written in Rust 🦀.&lt;/li&gt;
&lt;li&gt;Native support for storing, querying and filtering vectors, deeply nested data and multi-modal data (text, images, videos, point clouds, and more).&lt;/li&gt;
&lt;li&gt;Support for vector similarity search, full-text search and SQL.
&lt;/li&gt;
&lt;li&gt;Interoperable with other columnar formats (such as Parquet) via &lt;a href="https://arrow.apache.org/overview/" rel="noopener noreferrer"&gt;Arrow&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Disk-based indexes and storage.&lt;/li&gt;
&lt;li&gt;Built to scale to hundreds of terabytes of data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://lancedb.github.io/lancedb/" rel="noopener noreferrer"&gt;&lt;strong&gt;LanceDB&lt;/strong&gt;&lt;/a&gt; is an &lt;strong&gt;open-source vector database&lt;/strong&gt;.    &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Written in Rust 🦀.&lt;/li&gt;
&lt;li&gt;Built on top of Lance.&lt;/li&gt;
&lt;li&gt;Support for Python, JavaScript, and Rust client libraries to interact with the database.&lt;/li&gt;
&lt;li&gt;Allows storage of raw data, metadata, and embeddings all at once.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  LanceDB Storage Options
&lt;/h2&gt;

&lt;p&gt;LanceDB's underlying optimized storage format, &lt;code&gt;lance&lt;/code&gt;, is flexible enough to be supported by various storage backends, such as  local NVMe, &lt;a href="https://aws.amazon.com/ebs/" rel="noopener noreferrer"&gt;EBS&lt;/a&gt;, &lt;a href="https://aws.amazon.com/efs/" rel="noopener noreferrer"&gt;EFS&lt;/a&gt;, &lt;a href="https://aws.amazon.com/s3/" rel="noopener noreferrer"&gt;S3&lt;/a&gt; and other third-party APIs that connect to the cloud. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 All you need to do to use a specific storage backend is define its connection string in the LanceDB client!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let's go through some storage options that are compatible with AWS Lambda!&lt;/p&gt;
&lt;h2&gt;
  
  
  S3 - Object Store
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;❕Data is stored as individual objects &lt;em&gt;all at the same level&lt;/em&gt;.&lt;br&gt;
❕Objects are kept track of by a distributed hash table (DHT), where each object is identified by a unique ID.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Pros of Object Stores&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Cons of Object Stores&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Unlimited scaling&lt;/strong&gt; ♾️: Objects can be stored across distributed systems, eliminating single-node limitations. This is ideal for ML and AI applications handling large data volumes.&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Higher latency&lt;/strong&gt; 🚚: Accessing a remote object store over a network via HTTP/HTTPS adds overhead compared to file system protocols like NFS. Additionally, storing metadata separately from objects introduces some retrieval latency.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Cheap&lt;/strong&gt; 💸: The simple storage design makes it more affordable than traditional file systems.&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Highly available&lt;/strong&gt; and &lt;strong&gt;resilient&lt;/strong&gt; 💪: Affordable storage allows for redundant data storage within and across data centers.&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;h3&gt;
  
  
  S3 + LanceDB setup on AWS lambda
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;⚠️ Important&lt;/strong&gt;: S3 does &lt;strong&gt;not support concurrent writes&lt;/strong&gt;. If multiple processes attempt to write to the same table simultaneously, it could lead to data corruption. But there's a solution! Use the &lt;a href="https://lancedb.github.io/lancedb/guides/storage/#dynamodb-commit-store-for-concurrent-writes" rel="noopener noreferrer"&gt;DynamoDB commit store feature in LanceDB&lt;/a&gt; to prevent this.&lt;/p&gt;


&lt;h4&gt;
  
  
  Part I - Write lambda function code
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Create an &lt;a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket-overview.html" rel="noopener noreferrer"&gt;S3 Bucket&lt;/a&gt; where your Lance database will be stored. Ours is called: &lt;code&gt;rig-montreal-lancedb&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;In the lambda code, connect to the store via the &lt;a href="https://docs.rs/lancedb/latest/lancedb/connection/struct.Connection.html" rel="noopener noreferrer"&gt;&lt;code&gt;LanceBD client&lt;/code&gt;&lt;/a&gt; as so:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Note: Create s3://rig-montreal-lancedb bucket beforehand&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;lancedb&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"s3://rig-montreal-lancedb"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;.execute&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="k"&gt;.await&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// OR&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;lancedb&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"s3+ddb://rig-montreal-lancedb?ddbTableName=my-dynamodb-table"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;.execute&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="k"&gt;.await&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h4&gt;
  
  
  Part II - Deploy lambdas
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 Need a refresher on Lambda deployments? Check out our &lt;a href="https://dev.to/garance_buricatu_a6864136/how-to-deploy-your-rig-app-on-aws-lambda-a-step-by-step-guide-2ge5"&gt;previous blog&lt;/a&gt; for a full walkthrough.&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Lambda that writes to the store&lt;/span&gt;
cargo lambda build &lt;span class="nt"&gt;--release&lt;/span&gt; &lt;span class="nt"&gt;--bin&lt;/span&gt; loader
cargo lambda deploy &lt;span class="nt"&gt;--binary-name&lt;/span&gt; loader &amp;lt;your_loader_function_name&amp;gt;

&lt;span class="c"&gt;# Lambda that reads to the store&lt;/span&gt;
cargo lambda build &lt;span class="nt"&gt;--release&lt;/span&gt; &lt;span class="nt"&gt;--bin&lt;/span&gt; app
cargo lambda deploy &lt;span class="nt"&gt;--binary-name&lt;/span&gt; app &amp;lt;your_app_function_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;💡 Don’t forget to set the necessary &lt;a href="https://lancedb.github.io/lancedb/guides/storage/#aws-iam-permissions" rel="noopener noreferrer"&gt;IAM permissions&lt;/a&gt;! Your lambda functions need appropriate access to the S3 bucket — whether it’s read, write, or both.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Lambda ephemeral storage - Local file system
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-ephemeral-storage.html" rel="noopener noreferrer"&gt;Lambda ephemeral storage&lt;/a&gt; is &lt;strong&gt;temporary and unique&lt;/strong&gt; to each execution environment, it is not intended for persistent storage. In other words, any LanceDB store created during the lambda execution on ephemeral storage will be wiped when the function cold starts.&lt;br&gt;
This option can be used for very specific use cases (mostly for testing) where writing to the store needs to be done in the same process as reading, and data is only read by a single lambda execution.&lt;/p&gt;

&lt;p&gt;Ephemeral storage in a lambda is found in the &lt;code&gt;/tmp&lt;/code&gt; directory. All you need to do is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;lancedb&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/tmp"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;.execute&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="k"&gt;.await&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  EFS - Virtual file system
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;❕A &lt;strong&gt;serverless&lt;/strong&gt;, &lt;strong&gt;elastic&lt;/strong&gt;, &lt;strong&gt;shared file system&lt;/strong&gt; designed to be consumed by AWS services like EC2 and Lambda.&lt;br&gt;
❕Data is &lt;strong&gt;persisted&lt;/strong&gt; and can be shared across lambda invocations (unlike the S3 without commit store and ephemeral storage options above).&lt;br&gt;
❕Supports up to 25,000 &lt;strong&gt;concurrent connections&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Pros of EFS&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Cons of EFS&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Stateful lambda&lt;/strong&gt;: Mounting an EFS instance on a lambda function provides knowledge of previous and concurrent executions.&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Development time&lt;/strong&gt;: More involved cloud setup&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Low latency&lt;/strong&gt; ⚡: A lambda function resides in the same &lt;strong&gt;VPC&lt;/strong&gt; as the EFS instance, allowing low-latency network calls via the &lt;strong&gt;NFS&lt;/strong&gt; protocol.&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Cost&lt;/strong&gt; 💲: More expensive than S3&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  EFS + LanceDB setup on AWS Lambda
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 Setting up EFS in the cloud can be intricate, so you can use our &lt;a href="https://github.com/garance-buricatu/rig-aws/blob/master/rig-montreal-lancedb/template.yaml" rel="noopener noreferrer"&gt;CloudFormation template&lt;/a&gt; to streamline the deployment process.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Part I - Build Rust code and upload zip files to S3
&lt;/h4&gt;

&lt;p&gt;In the lambda code, connect to the store via the &lt;a href="https://docs.rs/lancedb/latest/lancedb/connection/struct.Connection.html" rel="noopener noreferrer"&gt;LanceBD client&lt;/a&gt; as so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;lancedb&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/mnt/efs"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;.execute&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="k"&gt;.await&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, compile your code, zip the binaries, and upload them to S3:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Can also do this directly on the AWS console&lt;/span&gt;
aws s3api create-bucket &lt;span class="nt"&gt;--bucket&lt;/span&gt; &amp;lt;your_bucket_name&amp;gt;

cargo lambda build &lt;span class="nt"&gt;--release&lt;/span&gt; &lt;span class="nt"&gt;--bin&lt;/span&gt; loader
cargo lambda build &lt;span class="nt"&gt;--release&lt;/span&gt; &lt;span class="nt"&gt;--bin&lt;/span&gt; app

&lt;span class="nb"&gt;cd &lt;/span&gt;target/lambda/loader
zip &lt;span class="nt"&gt;-r&lt;/span&gt; bootstrap.zip bootstrap
&lt;span class="c"&gt;# Can also do this directly on the AWS console&lt;/span&gt;
aws s3 &lt;span class="nb"&gt;cp &lt;/span&gt;bootstrap.zip s3://&amp;lt;your_bucket_name&amp;gt;/rig/loader/

&lt;span class="nb"&gt;cd&lt;/span&gt; ..
zip &lt;span class="nt"&gt;-r&lt;/span&gt; bootstrap.zip bootstrap
&lt;span class="c"&gt;# Can also do this directly on the AWS console&lt;/span&gt;
aws s3 &lt;span class="nb"&gt;cp &lt;/span&gt;bootstrap.zip s3://&amp;lt;your_bucket_name&amp;gt;/rig/app/

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Part II - Understand Cloudformation template
&lt;/h4&gt;

&lt;p&gt;The &lt;a href="https://github.com/garance-buricatu/rig-aws/blob/master/rig-montreal-lancedb/template.yaml" rel="noopener noreferrer"&gt;template&lt;/a&gt; assumes that your AWS account already has the following resources:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A &lt;strong&gt;VPC&lt;/strong&gt; with at least two private subnets in separate availability zones, each with public internet access.&lt;/li&gt;
&lt;li&gt;An &lt;strong&gt;S3 bucket&lt;/strong&gt; (as created in Part I) for storing Lambda code.
&amp;gt; 💡 If you’re missing these resources, follow this AWS &lt;a href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-example-private-subnets-nat.html" rel="noopener noreferrer"&gt;tutorial&lt;/a&gt; to set up a basic VPC and subnets.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;EFS setup&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Mount Targets:&lt;/strong&gt; Create two mount targets for your EFS instance — one in each subnet (specified in &lt;code&gt;Parameters&lt;/code&gt; section of CFT template).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security Groups:&lt;/strong&gt; Set up an EFS security group with rules to allow &lt;strong&gt;NFS traffic&lt;/strong&gt; from your Lambda functions’ security group.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Lambda functions setup&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Loader and App Lambdas:&lt;/strong&gt; Deploy both Lambda functions (&lt;code&gt;loader&lt;/code&gt; and &lt;code&gt;app&lt;/code&gt;) in the same subnets as your EFS mount targets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security Groups:&lt;/strong&gt; Assign a security group that enables access to the EFS security group and public internet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;EFS Mounting:&lt;/strong&gt; Configure the Lambdas to mount the EFS targets at &lt;code&gt;/mnt/efs&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;h2&gt;
  
  
  💡 Once everything’s ready, deploy the CloudFormation template to launch your environment with just one click!
&lt;/h2&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Metrics on the cloud ☁️
&lt;/h3&gt;

&lt;p&gt;If you've made it to here, you have the Montreal rig app with EFS as the LanceDbB storage backend deployed on AWS Lambda! 🎉 Now we want to look at some metrics when the app is run in the cloud.&lt;/p&gt;

&lt;p&gt;For reference, we replicated the Montreal agent using &lt;a href="https://python.langchain.com/" rel="noopener noreferrer"&gt;langchain 🐍&lt;/a&gt; in this &lt;a href="https://github.com/garance-buricatu/rig-aws/tree/master/langchain-montreal-lancedb" rel="noopener noreferrer"&gt;python project&lt;/a&gt; which contains the source code for the &lt;a href="https://github.com/garance-buricatu/rig-aws/blob/master/langchain-montreal-lancedb/loader.py" rel="noopener noreferrer"&gt;&lt;code&gt;loader&lt;/code&gt;&lt;/a&gt; and &lt;a href="https://github.com/garance-buricatu/rig-aws/blob/master/langchain-montreal-lancedb/app.py" rel="noopener noreferrer"&gt;&lt;code&gt;app&lt;/code&gt;&lt;/a&gt; lambdas. The python app uses the same LanceDB vector store on the same EFS instance as the Rig app. To see how the python app was configured in the cloud, take a look at the &lt;a href="https://github.com/garance-buricatu/rig-aws/blob/master/rig-montreal-lancedb/template.yaml" rel="noopener noreferrer"&gt;CloudFormation template&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Let's compare them!&lt;/p&gt;

&lt;h3&gt;
  
  
  Rig - Memory, runtime, and coldstarts
&lt;/h3&gt;

&lt;p&gt;We invoked the &lt;code&gt;app&lt;/code&gt; function 50 times for each memory configuration of 128MB, 256MB, 512MB, 1024MB using the &lt;a href="https://github.com/alexcasalboni/aws-lambda-power-tuning" rel="noopener noreferrer"&gt;power tuner tool&lt;/a&gt;.&lt;br&gt;
The Cloudwatch query below gathers averages about runtime, memory usage, and cold starts of the lambda over the 50 invocations.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;filter @type = "REPORT"
| stats 
      avg(@maxMemoryUsed) / 1000000 as MemoryUsageMB,
      avg(@duration) / 1000 as AvgDurationSec,
      max(@duration) / 1000 as MaxDurationSec, 
      min(@duration) / 1000 as MinDurationSec, 
      avg(@initDuration) / 1000 as AvgColdStartTimeSec, 
      count(*) as NumberOfInvocations,
      sum(@initDuration &amp;gt; 0) as ColdStartInvocations
by bin(1d) as TimeRange, @memorySize / 1000000 as MemoryConfigurationMB
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fob4cls9cdynuhxs1yi2s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fob4cls9cdynuhxs1yi2s.png" alt="Rig metrics" width="800" height="172"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Memory and runtime analysis&lt;/strong&gt;&lt;br&gt;
At the memory configuration of &lt;strong&gt;128MB&lt;/strong&gt;, the lambda has the lowest average memory usage of &lt;strong&gt;96.1 MB&lt;/strong&gt; and the highest runtime of &lt;strong&gt;5.1s&lt;/strong&gt;. At a memory configuration of &lt;strong&gt;1GB&lt;/strong&gt;, the lambda has the highest average memory usage of &lt;strong&gt;113.1 MB&lt;/strong&gt; and the lowest runtime of &lt;strong&gt;4.4s&lt;/strong&gt;. In other words, with an extra ~7MB of memory usage, the lambda function was 700ms faster.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cold starts analysis&lt;/strong&gt; ❄️&lt;br&gt;
The average initialization time remains steady around &lt;strong&gt;0.16s&lt;/strong&gt;. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The chart below shows the power tuner results after running the app 50 times with each of the 4 memory configurations.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fczdy8596b2d8i1np9swh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fczdy8596b2d8i1np9swh.png" alt="Rig power tuner" width="800" height="351"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We see that adding memory to the function (and therefore adding computational power) &lt;strong&gt;does in fact affect the performance of the lambda by less than a second&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  LangChain - Memory, runtime, and coldstarts
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Deployment package
&lt;/h4&gt;

&lt;p&gt;We are not able to use zip files for the deployment package of the lambda functions as the zip size exceeds the maximum size allowed by AWS. The &lt;a href="https://github.com/garance-buricatu/rig-aws/blob/master/langchain-montreal-lancedb/loader_requirements.txt" rel="noopener noreferrer"&gt;loader dependencies&lt;/a&gt; and &lt;a href="https://github.com/garance-buricatu/rig-aws/blob/master/langchain-montreal-lancedb/app_requirements.txt" rel="noopener noreferrer"&gt;app dependencies&lt;/a&gt; create zip files of size around 150 MB.&lt;/p&gt;

&lt;p&gt;Instead, we must use container images. The &lt;a href="https://github.com/garance-buricatu/rig-aws/blob/master/langchain-montreal-lancedb/Dockerfile" rel="noopener noreferrer"&gt;docker image&lt;/a&gt; has size 471.45MB using the base python lambda image.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0z48s2eqw6c92hnxv79y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0z48s2eqw6c92hnxv79y.png" alt="LangChain deployment package" width="800" height="105"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We did the same experiment as with the Rig app above and got the following metrics:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ekgng4g7iu4pxeokhap.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ekgng4g7iu4pxeokhap.png" alt="LangChain metrics" width="800" height="159"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First of all, the function is &lt;strong&gt;unable to run with a memory allocation of 128MB&lt;/strong&gt;. It gets killed at this allocation size due to lack of memory. So we will compare the three following memory configurations: 256MB, 512MB, 1GB. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Memory and runtime analysis&lt;/strong&gt;&lt;br&gt;
At the memory configuration of &lt;strong&gt;256MB&lt;/strong&gt;, the lambda has the lowest average memory usage of &lt;strong&gt;245.8 MB&lt;/strong&gt; and the highest runtime of &lt;strong&gt;4.9s&lt;/strong&gt;. At a memory configuration of &lt;strong&gt;1GB&lt;/strong&gt;, the lambda has the highest average memory usage of &lt;strong&gt;359.6 MB&lt;/strong&gt; and the lowest runtime of &lt;strong&gt;4.0s&lt;/strong&gt;. In other words, with an extra &lt;strong&gt;~113MB&lt;/strong&gt; of memory usage, the lambda function was 1s faster.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cold starts analysis&lt;/strong&gt; ❄️&lt;br&gt;
The average initialization time increases as the memory configuration increases with the lowest being &lt;strong&gt;1.9s&lt;/strong&gt; and the highest being &lt;strong&gt;2.7s&lt;/strong&gt;. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The chart below shows the power tuner results after running the app 50 times with each of the 4 memory configurations.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjvck75kamnxfvuv3p8vi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjvck75kamnxfvuv3p8vi.png" alt="LangChain power tuner" width="800" height="351"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We see that adding memory to the function (and therefore adding computational power) also affects the performance of the lambda by about a second.&lt;/p&gt;

&lt;h3&gt;
  
  
  Final Comparison between Rig and LangChain
&lt;/h3&gt;

&lt;p&gt;Based on the Cloudwatch logs produced by both the Rig and Langchain lambdas, we were able to produce the following graphics:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftzxvnb5fjycxe0au3fpq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftzxvnb5fjycxe0au3fpq.png" alt="Memory" width="800" height="299"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjptcfd6sqslrgclttd2c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjptcfd6sqslrgclttd2c.png" alt="Cold starts" width="800" height="299"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;p&gt;Rig is an emerging project in the open-source community, and we're continuously expanding its ecosystem with new integrations and tools. We believe in the power of community-driven development and welcome contributions from developers of all skill levels.&lt;/p&gt;

&lt;p&gt;Stay connected and contribute to Rig's growth:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📚 &lt;a href="https://docs.rs/rig-core/latest/rig/" rel="noopener noreferrer"&gt;Documentation&lt;/a&gt;: Comprehensive guides and API references&lt;/li&gt;
&lt;li&gt;💻 &lt;a href="https://github.com/0xPlaygrounds/rig" rel="noopener noreferrer"&gt;GitHub Repository&lt;/a&gt;: Contribute, report issues, or star the project&lt;/li&gt;
&lt;li&gt;🌐 &lt;a href="https://rig.rs/" rel="noopener noreferrer"&gt;Official Website&lt;/a&gt;: Latest news, tutorials, and resources&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Join our &lt;a href="https://discord.com/invite/playgrounds" rel="noopener noreferrer"&gt;community&lt;/a&gt; channel to discuss ideas, seek help, and collaborate with other Rig developers.&lt;/p&gt;

&lt;p&gt;Thanks for reading,&lt;br&gt;&lt;br&gt;
&lt;a href="https://github.com/marieaurore123" rel="noopener noreferrer"&gt;Marie&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Full-stack developer @ &lt;a href="https://playgrounds.network/" rel="noopener noreferrer"&gt;Playgrounds Analytics&lt;/a&gt;&lt;/p&gt;

</description>
      <category>rust</category>
      <category>ai</category>
      <category>devops</category>
      <category>aws</category>
    </item>
    <item>
      <title>How to Deploy Your Rig App on AWS Lambda: A Step-by-Step Guide</title>
      <dc:creator>Marie Aurore</dc:creator>
      <pubDate>Fri, 01 Nov 2024 21:13:44 +0000</pubDate>
      <link>https://forem.com/marie_aurore/how-to-deploy-your-rig-app-on-aws-lambda-a-step-by-step-guide-2ge5</link>
      <guid>https://forem.com/marie_aurore/how-to-deploy-your-rig-app-on-aws-lambda-a-step-by-step-guide-2ge5</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A step-by-step walkthrough on deploying a simple AI Agent built with &lt;a href="https://github.com/0xPlaygrounds/rig" rel="noopener noreferrer"&gt;Rig&lt;/a&gt;, a fullstack agent framework, on AWS Lambda using the cargo lambda CLI. &lt;/li&gt;
&lt;li&gt;Comparison of performance metrics (memory usage, execution time, and cold starts) with a similar deployed Agent built with &lt;a href="https://www.langchain.com" rel="noopener noreferrer"&gt;LangChain&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stats: Rig Agent on AWS Lmabda :&lt;/strong&gt;

&lt;ol&gt;
&lt;li&gt;Low memory usage (26MB average)&lt;/li&gt;
&lt;li&gt;Fast cold starts (90.9ms)&lt;/li&gt;
&lt;li&gt;Consistent performance across memory configurations&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stats: LangChain Agent on AWS Lmabda:&lt;/strong&gt;

&lt;ol&gt;
&lt;li&gt;Higher memory usage (112-130MB)&lt;/li&gt;
&lt;li&gt;Slower cold starts (1,898.52ms)&lt;/li&gt;
&lt;li&gt;Performance improves with more memory allocation&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
How to Deploy Your Rig App on AWS Lambda: A Step-by-Step Guide

&lt;ul&gt;
&lt;li&gt;Table of Contents&lt;/li&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;Prerequisites&lt;/li&gt;
&lt;li&gt;
AWS Lambda Quick Overview

&lt;ul&gt;
&lt;li&gt;
AWS and Rust

&lt;ul&gt;
&lt;li&gt;REST API backend&lt;/li&gt;
&lt;li&gt;Event based task&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;

Rig Entertainer Agent App

&lt;ul&gt;
&lt;li&gt;Now let's deploy it!&lt;/li&gt;
&lt;li&gt;
Metrics on the cloud

&lt;ul&gt;
&lt;li&gt;Deployment package&lt;/li&gt;
&lt;li&gt;Memory, CPU, and runtime&lt;/li&gt;
&lt;li&gt;Cold starts&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;

Langchain Entertainer Agent App

&lt;ul&gt;
&lt;li&gt;Deployment package&lt;/li&gt;
&lt;li&gt;Memory, CPU, and runtime&lt;/li&gt;
&lt;li&gt;Cold starts&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Community and Ecosystem&lt;/li&gt;

&lt;li&gt;The Road Ahead: Rig's Future&lt;/li&gt;

&lt;li&gt;Conclusion and Call to Action&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Welcome to the series &lt;strong&gt;Deploy Your Rig Application&lt;/strong&gt;!&lt;br&gt;
Apps built with Rig can vary in complexity across three core dimensions: LLM usage, knowledge bases for RAG, and the compute infrastructure where the application is deployed. In this series, we’ll explore how different combinations of these dimensions can be configured for production use.   &lt;/p&gt;

&lt;p&gt;Today, we’ll start with a simple Rig agent that uses the &lt;a href="https://platform.openai.com/docs/models/gpt-4o" rel="noopener noreferrer"&gt;OpenAI model GPT-4-turbo&lt;/a&gt;, does not rely on a vector store (ie.: no RAGing), and will be deployed on AWS Lambda. &lt;/p&gt;

&lt;p&gt;This blog will provide a step-by-step deployment guide for the simple Rig app, showcase performance metrics of the Rig app running on AWS Lambda, and compare these metrics with those of a &lt;a href="(https://www.langchain.com)"&gt;LangChain&lt;/a&gt; app on the same platform.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;💡 If you're new to Rig and want to start from the beginning or are looking for additional tutorials, check out our &lt;a href="https://rig.rs/build-with-rig-guide.html" rel="noopener noreferrer"&gt;blog series&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let’s dive in!&lt;/p&gt;
&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before we begin building, ensure you have the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A clone of the &lt;a href="https://github.com/garance-buricatu/rig-aws/tree/master/rig-entertainer-lambda" rel="noopener noreferrer"&gt;&lt;code&gt;rig-entertainer-lambda&lt;/code&gt;&lt;/a&gt; crate (or your own Rig application).
&lt;/li&gt;
&lt;li&gt;An AWS account
&lt;/li&gt;
&lt;li&gt;An Open AI api key&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  AWS Lambda Quick Overview
&lt;/h2&gt;

&lt;p&gt;You might deploy your Rust application on AWS lambda if it’s a task that can execute in under 15 mins or if your app is a REST API backend.&lt;/p&gt;
&lt;h3&gt;
  
  
  AWS 🤝 Rust
&lt;/h3&gt;

&lt;p&gt;AWS Lambda supports Rust through the use of the &lt;a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html" rel="noopener noreferrer"&gt;OS-only runtime Amazon Linux 2023&lt;/a&gt; (a lambda runtime) in conjunction with the &lt;a href="https://github.com/awslabs/aws-lambda-rust-runtime" rel="noopener noreferrer"&gt;Rust runtime client&lt;/a&gt;, a rust crate. &lt;/p&gt;
&lt;h4&gt;
  
  
  REST API backend
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Use the &lt;a href="https://github.com/awslabs/aws-lambda-rust-runtime/tree/main/lambda-http" rel="noopener noreferrer"&gt;&lt;code&gt;lambda-http&lt;/code&gt;&lt;/a&gt; crate (from the runtime client) to write your function’s entrypoint. &lt;/li&gt;
&lt;li&gt;Then, route traffic to your lambda via AWS API services like &lt;a href="https://aws.amazon.com/api-gateway/" rel="noopener noreferrer"&gt;Api Gateway&lt;/a&gt;, &lt;a href="https://aws.amazon.com/pm/appsync" rel="noopener noreferrer"&gt;App Sync&lt;/a&gt;, &lt;a href="https://aws.amazon.com/vpc/lattice/" rel="noopener noreferrer"&gt;VPC lattice&lt;/a&gt;, etc ... &lt;/li&gt;
&lt;li&gt;If your lambda handles multiple endpoints of your API, the crate &lt;a href="https://github.com/tokio-rs/axum" rel="noopener noreferrer"&gt;axum&lt;/a&gt; facilitates the routing within the lambda.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
  
  
  Event based task (15 mins max.)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Your lambda function is invoked by some event with the event passed as the payload. For example, configure your S3 bucket to trigger the lambda function when a new object is added to the bucket. The function will receive the new object in the payload and can further process it.&lt;/li&gt;
&lt;li&gt;Use the &lt;a href="https://github.com/awslabs/aws-lambda-rust-runtime/tree/main/lambda-runtime" rel="noopener noreferrer"&gt;&lt;code&gt;lambda_runtime&lt;/code&gt;&lt;/a&gt; crate with &lt;a href="https://github.com/awslabs/aws-lambda-rust-runtime/tree/main/lambda-events" rel="noopener noreferrer"&gt;&lt;code&gt;lambda_events&lt;/code&gt;&lt;/a&gt; (from the runtime client) to write your function’s entrypoint.&lt;/li&gt;
&lt;li&gt;Then, invoke your function either via &lt;a href="https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html" rel="noopener noreferrer"&gt;&lt;code&gt;lambda invoke&lt;/code&gt; command&lt;/a&gt; or with integrated AWS triggers (ie. S3 UploadObject trigger). &lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;For both cases, the crate &lt;a href="https://docs.rs/tokio/latest/tokio/" rel="noopener noreferrer"&gt;&lt;code&gt;tokio&lt;/code&gt;&lt;/a&gt; must also be added to your project as the lambda runtime client uses &lt;code&gt;tokio&lt;/code&gt; to handle asynchronous calls.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  Rig Entertainer Agent App 🤡
&lt;/h2&gt;

&lt;p&gt;The crate &lt;a href="https://github.com/garance-buricatu/rig-aws-lambda/tree/master/rig-entertainer-lambda" rel="noopener noreferrer"&gt;&lt;code&gt;rig-entertainer-lambda&lt;/code&gt;&lt;/a&gt; implements a simple Rust program that is executed via the &lt;code&gt;lambda_runtime&lt;/code&gt;. It invokes a &lt;code&gt;Rig&lt;/code&gt; agent using the OpenAI API, to entertain users with jokes. It is an event-based task that I will execute with the &lt;code&gt;lambda invoke&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;The main takeaway here is that the app's &lt;code&gt;Cargo.toml&lt;/code&gt; file must include the following dependencies:   &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;rig-core&lt;/code&gt; (our rig crate)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;lambda_runtime&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tokio&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Now let's deploy it!
&lt;/h3&gt;

&lt;p&gt;There are &lt;em&gt;many&lt;/em&gt; ways to deploy Rust lambdas to AWS. Some out of the box options include the AWS CLI, the &lt;a href="https://www.cargo-lambda.info/guide/getting-started.html" rel="noopener noreferrer"&gt;cargo lambda&lt;/a&gt; CLI, the AWS SAM CLI, the AWS CDK, and more. You can also decide to create a Dockerfile for your app and use that container image in your Lambda function instead. See some useful examples &lt;a href="https://docs.aws.amazon.com/lambda/latest/dg/rust-package.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In this blog, we'll use the cargo lambda CLI option to deploy the code in &lt;code&gt;rig-entertainer-rust&lt;/code&gt; from your local machine to an AWS lambda:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Add your AWS credentials to my terminal&lt;/span&gt;
&lt;span class="c"&gt;# Create an AWS Lambda function named ‘rig-entertainer’ with architecture x86_64.&lt;/span&gt;

&lt;span class="nv"&gt;function_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'rig-entertainer'&lt;/span&gt;

&lt;span class="nb"&gt;cd &lt;/span&gt;rig-entertainer-lambda
cargo lambda build &lt;span class="nt"&gt;--release&lt;/span&gt; &lt;span class="c"&gt;# Can define different architectures here with --arm64 for example&lt;/span&gt;
cargo lambda deploy &lt;span class="nv"&gt;$function_name&lt;/span&gt; &lt;span class="c"&gt;# Since the name of the crate is the same as the the lambda function name, no need to specify a binary file&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Metrics on the cloud ☁️
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Deployment package
&lt;/h4&gt;

&lt;p&gt;This is the code configuration of the &lt;code&gt;rig-entertainer&lt;/code&gt; function in AWS. The function’s code package (bundled code and dependencies required for lambda to run) includes the single rust binary called &lt;code&gt;bootstrap&lt;/code&gt;, which is 3.2 MB.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjh72nanr3um3c8mpb8fh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjh72nanr3um3c8mpb8fh.png" alt="Deployment Package Rust" width="800" height="186"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Memory, CPU, and runtime
&lt;/h4&gt;

&lt;p&gt;The image below gives metrics on memory usage and execution time of the function. Each row represents a single execution of the function. In &lt;strong&gt;yellow&lt;/strong&gt; is the &lt;strong&gt;total memory used&lt;/strong&gt;, in &lt;strong&gt;red&lt;/strong&gt; is the amount of &lt;strong&gt;memory allocated&lt;/strong&gt;, and in &lt;strong&gt;blue&lt;/strong&gt; is the &lt;strong&gt;runtime&lt;/strong&gt;.&lt;br&gt;
Although the lambda has many configuration options for the memory ranging from 128MB to 1024MB, we can see that the average memory used by our app is &lt;strong&gt;26MB&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqonxpllzxwtyfhgdrmy0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqonxpllzxwtyfhgdrmy0.png" alt="Rig Cloudwatch logs" width="800" height="410"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's get more information on the metrics above by spamming the function and calculating averages. I invoked &lt;code&gt;rig-entertainer&lt;/code&gt; 50 times for each memory configuration of 128MB, 256MB, 512MB, 1024MB using the &lt;a href="https://github.com/alexcasalboni/aws-lambda-power-tuning" rel="noopener noreferrer"&gt;power tuner tool&lt;/a&gt; and the result of those invocations are displayed in the chart below. &lt;/p&gt;

&lt;p&gt;The x-axis is the memory allocation, and the y-axis is the average runtime over the 50 executions of &lt;code&gt;rig-entertainer&lt;/code&gt;. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Q.&lt;/strong&gt; We know that the function uses on average only 26MB per execution (which is less than the minimum memory allocation of 128MB) so why should we test higher memory configurations?&lt;br&gt;&lt;br&gt;
&lt;strong&gt;A.&lt;/strong&gt; &lt;a href="https://docs.aws.amazon.com/lambda/latest/operatorguide/computing-power.html" rel="noopener noreferrer"&gt;vCPUs are added to the lambda in proportion to memory&lt;/a&gt; so adding memory could still affect the performance.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;However, we can see that adding memory to the function (and therefore adding computational power) does not affect its performance at all. Since the &lt;a href="https://aws.amazon.com/lambda/pricing/" rel="noopener noreferrer"&gt;cost of a lambda execution&lt;/a&gt; is calculated in GB-seconds, we get the most efficient lambda for the lowest price! &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftr352m59k0vk7manl4jx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftr352m59k0vk7manl4jx.png" alt="Power Tuner Rust" width="800" height="354"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Cold starts ❄️
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/lambda/latest/operatorguide/execution-environments.html" rel="noopener noreferrer"&gt;Cold starts&lt;/a&gt; occur when the lambda function's execution environment needs to be booted up from scratch. This includes setting up the actual compute that the lambda function is running on, and downloading the lambda function code and dependencies in that environment.&lt;br&gt;&lt;br&gt;
Cold start latency doesn't affect all function executions because once the lambda environment has been setup, it will be reused by subsequent executions of the same lambda.   &lt;/p&gt;

&lt;p&gt;In the lambda cloudwatch logs, if a function execution requires a cold start, we see the &lt;code&gt;Init Duration&lt;/code&gt; metric at the end of the execution. &lt;/p&gt;

&lt;p&gt;For &lt;code&gt;rig-entertainer&lt;/code&gt;, we can see that the average cold start time is &lt;strong&gt;90.9ms&lt;/strong&gt;:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhcfgcrm0kipt5ruorior.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhcfgcrm0kipt5ruorior.png" alt="Rig cold starts" width="800" height="148"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note that the function was affected by cold starts 9 times out of the 245 times it was executed, so &lt;strong&gt;0.036%&lt;/strong&gt; of the time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Langchain Entertainer Agent App 🐍
&lt;/h2&gt;

&lt;p&gt;I replicated the OpenAI entertainer agent using the &lt;a href="https://python.langchain.com/" rel="noopener noreferrer"&gt;langchain&lt;/a&gt; python library in this &lt;a href="https://github.com/garance-buricatu/rig-aws-lambda/tree/master/langchain-entertainer-lambda" rel="noopener noreferrer"&gt;mini python app&lt;/a&gt; which I also deployed to AWS Lambda in a function called &lt;code&gt;langchain-entertainer&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Let's compare the metrics outlined above.&lt;/p&gt;

&lt;h4&gt;
  
  
  Deployment package
&lt;/h4&gt;

&lt;p&gt;This is the code configuration of the &lt;code&gt;langchain-entertainer&lt;/code&gt; function in AWS. The function’s code package is a zip file including the lambda function code and all dependencies required for the lambda program to run.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9x0w4arsxrvfdvjbkubm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9x0w4arsxrvfdvjbkubm.png" alt="Deployment Package LangChain" width="800" height="189"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Memory, CPU, and runtime
&lt;/h4&gt;

&lt;p&gt;There are varying memory configurations from 128MB, 256MB, 512MB, to 1024MB for the lambda shown in the table below. When 128MB of memory is allocated, on average about &lt;strong&gt;112MB&lt;/strong&gt; of memory is used, and when more more than 128MB is allocated, about &lt;strong&gt;130MB&lt;/strong&gt; of memory is used and the &lt;strong&gt;runtime is lower&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv6f4m4skc2ndcz3913bo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv6f4m4skc2ndcz3913bo.png" alt="Cloudwatch Logs LangChain" width="800" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's get some more averages for these metrics: I invoked &lt;code&gt;langchain-entertainer&lt;/code&gt; 50 times for each memory configuration of 128MB, 256MB, 512MB, 1024MB using the &lt;a href="https://github.com/alexcasalboni/aws-lambda-power-tuning" rel="noopener noreferrer"&gt;power tuner tool&lt;/a&gt; and the result of those invocations were plotted in the graph below. &lt;/p&gt;

&lt;p&gt;We can see that by increasing the memory allocation (and therefore computation power) of &lt;code&gt;langchain-entertainer&lt;/code&gt;, the function becomes more performant (lower runtime). However, note that since you pay per GB-seconds, a more performant function is more expensive. &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm1mswjjhzfum2fn8v7dx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm1mswjjhzfum2fn8v7dx.png" alt="Power Tuner Langchain" width="800" height="322"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Cold starts ❄️
&lt;/h4&gt;

&lt;p&gt;For &lt;code&gt;langchain-entertainer&lt;/code&gt;, the average cold start time is: &lt;strong&gt;1,898.52ms&lt;/strong&gt;, ie. 20x as much as the rig app coldstart.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzysyfn6hyy3li0aw36bj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzysyfn6hyy3li0aw36bj.png" alt="Cold Starts LangChain" width="800" height="123"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note that the function was affected by cold starts 6 times out of the 202 times it was executed, so &lt;strong&gt;0.029%&lt;/strong&gt; of the time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;p&gt;Rig is an emerging project in the open-source community, and we're continuously expanding its ecosystem with new integrations and tools. We believe in the power of community-driven development and welcome contributions from developers of all skill levels.&lt;/p&gt;

&lt;p&gt;Stay connected and contribute to Rig's growth:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📚 &lt;a href="https://docs.rs/rig-core/latest/rig/" rel="noopener noreferrer"&gt;Documentation&lt;/a&gt;: Comprehensive guides and API references&lt;/li&gt;
&lt;li&gt;💻 &lt;a href="https://github.com/0xPlaygrounds/rig" rel="noopener noreferrer"&gt;GitHub Repository&lt;/a&gt;: Contribute, report issues, or star the project&lt;/li&gt;
&lt;li&gt;🌐 &lt;a href="https://rig.rs/" rel="noopener noreferrer"&gt;Official Website&lt;/a&gt;: Latest news, tutorials, and resources&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Join our &lt;a href="https://discord.com/invite/playgrounds" rel="noopener noreferrer"&gt;community&lt;/a&gt; channel to discuss ideas, seek help, and collaborate with other Rig developers.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Road Ahead: Rig's Future
&lt;/h2&gt;

&lt;p&gt;As we continue to develop Rig, we're excited about the possibilities. Our roadmap includes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Expanding LLM Provider Support&lt;/strong&gt;: Adding integrations for more LLM providers to give developers even more choices.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enhanced Performance Optimizations&lt;/strong&gt;: Continuously improving Rig's performance to handle larger-scale applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Advanced AI Workflow Templates&lt;/strong&gt;: Providing pre-built templates for common AI workflows to accelerate development further.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ecosystem Growth&lt;/strong&gt;: Developing additional tools and libraries that complement Rig's core functionality.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We're committed to making Rig the go-to library for LLM application development in Rust, and your feedback is crucial in shaping this journey.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion and Call to Action
&lt;/h2&gt;

&lt;p&gt;Rig is transforming LLM-powered application development in Rust by providing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A unified, intuitive API for multiple LLM providers&lt;/li&gt;
&lt;li&gt;High-level abstractions for complex AI workflows&lt;/li&gt;
&lt;li&gt;Type-safe development leveraging Rust's powerful features&lt;/li&gt;
&lt;li&gt;Extensibility and seamless ecosystem integration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We believe Rig has the potential to significantly enhance developers' building of AI applications, and we want you to be part of this journey.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Your Feedback Matters!&lt;/strong&gt; We're offering a unique opportunity to shape the future of Rig:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Build an AI-powered application using Rig.&lt;/li&gt;
&lt;li&gt;Share your experience and insights via this &lt;a href="https://bit.ly/Rig-Review" rel="noopener noreferrer"&gt;feedback form&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Get a chance to win $100 and have your project featured in our showcase!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Your insights will directly influence Rig's development, helping us create a tool that truly meets the needs of AI developers. 🦀✨&lt;/p&gt;

&lt;p&gt;Thanks for reading,&lt;br&gt;&lt;br&gt;
&lt;a href="https://github.com/marieaurore123" rel="noopener noreferrer"&gt;Marie&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Full-stack developer @ &lt;a href="https://playgrounds.network/" rel="noopener noreferrer"&gt;Playgrounds Analytics&lt;/a&gt;&lt;/p&gt;

</description>
      <category>rust</category>
      <category>aws</category>
      <category>llm</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
