golem-add-llm-rust

Integrates LLM, embeddings, search, and speech capabilities into Rust Golem agents.

1.5k|212|Updated Nov 24, 2023
One-click install
npx skills add https://github.com/golemcloud/golem --skill golem-add-llm-rust
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golem-add-llm-rust
Source: https://github.com/golemcloud/golem/tree/main/golem-skills/skills/rust/golem-add-llm-rust
Command: npx skills add https://github.com/golemcloud/golem --skill golem-add-llm-rust

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Adding AI capabilities like LLM chat, embeddings, or web search to a Golem agent normally requires learning each provider's API. This Skill provides unified, provider-agnostic Rust crates so you can integrate AI features with a single consistent API and swap providers by changing one dependency.

Core Features & Use Cases

  • Unified AI APIs: Core crates for LLM chat, embeddings, web search, document search, graph/vector databases, video generation, speech-to-text, and text-to-speech, each with multiple provider backends (OpenAI, Anthropic, Bedrock, Qdrant, Neo4j, ElevenLabs, and more).
  • Durable Execution: Durable* provider types record responses in Golem's oplog and replay them on recovery, making AI calls fault-tolerant.
  • Multi-turn Conversations: Maintain event history as agent state for chat sessions with tool calling and streaming support.
  • Use Case: Build a chat agent mounted at /chats/{chat_name} that answers questions via OpenAI, then switch to Anthropic later by changing only the type alias and Cargo dependency.

Quick Start

Add LLM chat to my Rust Golem agent using the golem-ai-llm crate with OpenAI as the provider.

Frequently Asked Questions about golem-add-llm-rust

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add LLM chat to a Rust Golem agent?

Add the golem-ai-llm core crate plus a provider crate like golem-ai-llm-openai to Cargo.toml, then call Provider::send with events and a Config. Store the API key as a Golem secret using the typed config system.

How do I switch LLM providers in golem-ai?

Replace the provider crate in Cargo.toml (e.g., golem-ai-llm-openai with golem-ai-llm-anthropic) and change the type alias in code. The core API stays identical, so no other code changes are needed.

Which AI providers does golem-ai support?

LLM providers include OpenAI, Anthropic, Bedrock, Grok, Ollama, and OpenRouter. It also supports embedding, web search, document search, graph, vector, video, STT, and TTS providers such as Qdrant, Neo4j, ElevenLabs, and Deepgram.

Are golem-ai crates available on crates.io?

The documentation notes the crates were not on crates.io initially and recommends git dependencies pinned to the v0.5.1 tag, while the constraints section references version 0.5.1. Use version 0.5.1 consistently for all golem-ai crates.

How do I store API keys for AI providers in Golem?

Define a config struct with the ConfigSchema derive and mark the key field as secret, then create it with the golem secret create CLI command. This keeps credentials out of source code using Golem's typed config system.

Do golem-ai calls survive agent failures and restarts?

Yes, the Durable* provider types integrate with Golem's durable execution. Responses are recorded in the oplog and replayed on recovery, so completed AI calls are not repeated after a crash.