<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/rust-ai-building-llm-applications-with-rig-o80ojzkue" -->

---
title: Rust AI: Building LLM Applications With Rig | daily.dev
description: Rig is an open-source Rust library that provides a unified interface for building LLM applications across providers like OpenAI, Anthropic, and Gemini. Drawing...
canonical: https://daily.dev/posts/rust-ai-building-llm-applications-with-rig-o80ojzkue
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Rust AI: Building LLM Applications With Rig | daily.dev
og:description: Rig is an open-source Rust library that provides a unified interface for building LLM applications across providers like OpenAI, Anthropic, and Gemini. Drawing...
og:url: https://daily.dev/posts/rust-ai-building-llm-applications-with-rig-o80ojzkue
og:image: https://api.daily.dev/og/posts/O80OJzKuE.png
og:image:alt: Rust AI: Building LLM Applications With Rig
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Rust AI: Building LLM Applications With Rig

**[JetBrains](https://daily.dev/sources/jetbrains)** · 8 min read · 1 upvotes · 0 comments

## Summary

Rig is an open-source Rust library that provides a unified interface for building LLM applications across providers like OpenAI, Anthropic, and Gemini. Drawing on a JetBrains and Rust Foundation livestream featuring Rig's lead maintainer Stephen Korzeniewski, the piece covers how Rig structures agents, tools, RAG, and local model inference (via Ollama, llama.cpp, and Candle), demonstrated through a small terminal coding agent called Rat Code built with Rig and Ratatui. It also explains Rig's cassette-based testing approach, which replays around 1,700 recorded provider interactions in CI to test integrations separately from live model output quality.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.jetbrains.com/rust/2026/09/09/rust-ai-in-practice>

## Questions this post answers

### What is Rig used for in Rust AI applications?

Rig is an open-source Rust library that provides a single common interface for working with large language model providers such as OpenAI, Anthropic, and Gemini, so developers can switch providers without rewriting application logic. It supports AI agents, tool calling via Rust's Tool trait, retrieval-augmented generation with vector store abstractions, streaming responses, and local model inference through Ollama, llama.cpp, and Candle.

_Developers weighing Rust for LLM app development can track library comparisons like this on daily.dev._

### How does Rig test integrations with LLM providers given that model outputs are nondeterministic?

Rig separates testing the provider integration from evaluating output quality. It uses a cassette system where maintainers record HTTP traffic against live providers as YAML files, then replay those recordings through a mock server in CI for every pull request, covering around 1,700 recorded provider interactions in just a few seconds, while live model quality is checked separately through scheduled tests.

_Teams building reliable LLM integrations can follow testing patterns like this via daily.dev._

### How can I run local LLM inference directly inside a Rust application without a separate server?

Use the rig-candle integration, which runs inference through Candle, a Rust machine learning framework developed by Hugging Face, directly inside the application rather than through a locally running server like Ollama or llama.cpp. This lets developers embed model weights directly into the application, run inference locally, and even run supported models through WebAssembly without depending on a hosted model API.

_Developers shipping self-contained AI apps can keep up with local inference options on daily.dev._

## Similar posts on daily.dev

- [JetBrains Partners with the Rust Foundation for an AI Livestream Series](https://daily.dev/posts/jetbrains-partners-with-the-rust-foundation-for-an-ai-livestream-series-wgfsn0wdx) · Rust Foundation · 0 upvotes · 0 comments
- [Build a Rust AI Agent Gateway with Tokio and Axum](https://daily.dev/posts/build-a-rust-ai-agent-gateway-with-tokio-and-axum-4xfsvkj3f) · SitePoint · 2 upvotes · 0 comments
- [GitHub - r-uby-dev/llm: Ruby's capable AI runtime](https://daily.dev/posts/github---r-uby-dev-llm-ruby-s-capable-ai-runtime-6cxgavkfi) · Ruby Flow · 0 upvotes · 0 comments

---

Tags: [#llm](https://daily.dev/tags/llm), [#ai-agents](https://daily.dev/tags/ai-agents), [#rust](https://daily.dev/tags/rust), [#rag](https://daily.dev/tags/rag)

[View this post on daily.dev](https://daily.dev/posts/rust-ai-building-llm-applications-with-rig-o80ojzkue)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Rust AI: Building LLM Applications With Rig","url":"https://daily.dev/posts/rust-ai-building-llm-applications-with-rig-o80ojzkue","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/rust-ai-building-llm-applications-with-rig-o80ojzkue"},"datePublished":"2026-09-09T13:12:32.842Z","dateModified":"2026-09-13T20:49:48.150Z","description":"Rig is an open-source Rust library that provides a unified interface for building LLM applications across providers like OpenAI, Anthropic, and Gemini. Drawing...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f29d0c85030d0d812d5b8c5382b8b2de?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f29d0c85030d0d812d5b8c5382b8b2de?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"JetBrains","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"JetBrains","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/53ecf0c676f34b3896ee109609d91efa","url":"https://daily.dev/sources/jetbrains"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/rust-ai-building-llm-applications-with-rig-o80ojzkue","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"llm,ai-agents,rust,rag","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"JetBrains","item":"https://daily.dev/sources/jetbrains"},{"@type":"ListItem","position":3,"name":"Rust AI: Building LLM Applications With Rig"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/rust-ai-building-llm-applications-with-rig-o80ojzkue#faq","mainEntity":[{"@type":"Question","name":"What is Rig used for in Rust AI applications?","acceptedAnswer":{"@type":"Answer","text":"Rig is an open-source Rust library that provides a single common interface for working with large language model providers such as OpenAI, Anthropic, and Gemini, so developers can switch providers without rewriting application logic. It supports AI agents, tool calling via Rust's Tool trait, retrieval-augmented generation with vector store abstractions, streaming responses, and local model inference through Ollama, llama.cpp, and Candle. Developers weighing Rust for LLM app development can track library comparisons like this on daily.dev."}},{"@type":"Question","name":"How does Rig test integrations with LLM providers given that model outputs are nondeterministic?","acceptedAnswer":{"@type":"Answer","text":"Rig separates testing the provider integration from evaluating output quality. It uses a cassette system where maintainers record HTTP traffic against live providers as YAML files, then replay those recordings through a mock server in CI for every pull request, covering around 1,700 recorded provider interactions in just a few seconds, while live model quality is checked separately through scheduled tests. Teams building reliable LLM integrations can follow testing patterns like this via daily.dev."}},{"@type":"Question","name":"How can I run local LLM inference directly inside a Rust application without a separate server?","acceptedAnswer":{"@type":"Answer","text":"Use the rig-candle integration, which runs inference through Candle, a Rust machine learning framework developed by Hugging Face, directly inside the application rather than through a locally running server like Ollama or llama.cpp. This lets developers embed model weights directly into the application, run inference locally, and even run supported models through WebAssembly without depending on a hosted model API. Developers shipping self-contained AI apps can keep up with local inference options on daily.dev."}}]}
```

