golemcloud/golem/golem-add-llm-rust

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Adds provider-backed AI capabilities to a Rust Golem agent. Use for LLMs, embeddings, search, vector or graph databases, speech, video, or code execution.

Install

npx vskill@latest install golemcloud/golem/golem-add-llm-rust

SKILL.md

Add AI capabilities to a Rust agent

The golemcloud/golem-ai project provides provider-neutral core crates and provider crates. Golem agents now target wasm32-wasip2 and WASI HTTP 0.3, so dependency selection matters.

Select matching dependencies

Create a Rust application with golem new --yes --template rust ai-agent. Add the core and provider dependencies to the component's Cargo.toml. This example uses the v0.5.4 source with its matching SDK:

toml
[dependencies]
golem-rust = { version = "=3.0.0-rc5", features = ["export_golem_agentic"] }
golem-ai-llm = { git = "https://github.com/golemcloud/golem-ai", rev = "9243c29395a4cd85f81f9c7c635d8b0e3fe49216" }
golem-ai-llm-openai = { git = "https://github.com/golemcloud/golem-ai", rev = "9243c29395a4cd85f81f9c7c635d8b0e3fe49216" }

Keep the default golem features enabled. The application and provider must use the same SDK; check cargo tree -d for duplicate SDK versions. For a local SDK build, use the source-checkout instructions below instead. Build from the application directory with golem build --yes and keep the resulting lockfile.

Configure and call OpenAI

The provider exports OpenAiHostConfig (a ConfigSchema) and OpenAiConfig (the runtime config). Inject Config<OpenAiHostConfig> through the constructor. Converting the loaded host config keeps the secret handle; the provider reveals it immediately before each request. Do not cache plaintext.

rust
use golem_rust::{agent_definition, agent_implementation};
use golem_rust::agentic::Config as AgentConfig;
use golem_ai_llm::{LlmProvider, model::{Config, ContentPart, Event, Message, Role}};
use golem_ai_llm_openai::{OpenAI, OpenAiConfig, OpenAiHostConfig};
#[agent_definition]
pub trait ChatAgent {
fn new(name: String, #[agent_config] config: AgentConfig<OpenAiHostConfig>) -> Self;
async fn chat(&self, prompt: String, model: String) -> Result<String, String>;
}
struct ChatAgentImpl {
config: AgentConfig<OpenAiHostConfig>,
}
#[agent_implementation]
impl ChatAgent for ChatAgentImpl {
fn new(_name: String, #[agent_config] config: AgentConfig<OpenAiHostConfig>) -> Self {
Self { config }
}
async fn chat(&self, prompt: String, model: String) -> Result<String, String> {
let host = self.config.get().map_err(|_| "Provider configuration unavailable".to_string())?;
let response = OpenAI::send(
OpenAiConfig::from(host),
vec![Event::Message(Message {
role: Role::User,
name: None,
content: vec![ContentPart::Text(prompt)],
})],
Config {
model,
temperature: None,
max_tokens: Some(256),
stop_sequences: None,
tools: None,
tool_choice: None,
provider_options: None,
},
).await.map_err(|_| "Provider request failed".to_string())?;
Ok(response.content.into_iter().filter_map(|part| match part {
ContentPart::Text(text) => Some(text),
_ => None,
}).collect::<Vec<_>>().join(""))
}
}

Provision the apiKey secret in the deployment environment, using the hidden prompt rather than putting a credential in the manifest or shell history:

shell
golem secret create apiKey --type String

Set the optional provider URL config explicitly in golem.yaml:

yaml
agents:
ChatAgent:
config:
base_url: "https://openai-proxy.example.com/v1"

Regular config uses the Rust field name base_url; the secret path is apiKey. Replace the example proxy URL with a reachable OpenAI-compatible endpoint.

Build, deploy, and call chat with a model available to the provider account. Check the returned domain error separately from invocation failure. For streaming, use LlmProvider::stream and the upstream chat-stream interface. Before production use, verify provider requests, secret rotation, and recovery.

Authoritative API references at the pinned revision: provider config, provider implementation, request model.

Available crate families

Choose one core crate and the provider crate needed by the application:

CapabilityCore crateProviders
LLM chatgolem-ai-llmAnthropic, Bedrock, Grok, Ollama, OpenAI, OpenRouter
Embeddings/rerankinggolem-ai-embedCohere, Hugging Face, OpenAI, VoyageAI
Web searchgolem-ai-web-searchBrave, Google, Serper, Tavily
Document searchgolem-ai-searchAlgolia, Elasticsearch, Meilisearch, OpenSearch, Typesense
Graph databasegolem-ai-graphArangoDB, JanusGraph, Neo4j
Vector databasegolem-ai-vectorMilvus, pgvector, Pinecone, Qdrant
Videogolem-ai-videoKling, Runway, Stability, Veo
Speech-to-textgolem-ai-sttAWS, Azure, Deepgram, Google, Whisper
Text-to-speechgolem-ai-ttsAWS, Deepgram, ElevenLabs, Google
Code executiongolem-ai-execJavaScript and Python execution

The repository also contains golem-ai-http, the shared WASI HTTP transport. Provider crate names follow golem-ai-<capability>-<provider>.

Direct HTTP alternative

For a provider without a suitable adapter, call its HTTPS API with golem_rust::http as described by golem-make-http-request-rust. Store credentials with Golem secrets; load golem-add-secret-rust for provisioning.

Use a local SDK checkout

When targeting Golem's development SDK, clone golemcloud/golem-ai at the revision above. In the provider workspace's [workspace.dependencies], replace golem-rust with { path = "/absolute/path/to/golem/sdks/rust/golem-rust" }. Point the application at the same SDK and provider checkout:

toml
[dependencies]
golem-rust = { path = "/absolute/path/to/golem/sdks/rust/golem-rust", features = ["export_golem_agentic"] }
golem-ai-llm = { path = "/absolute/path/to/golem-ai/llm/llm" }
golem-ai-llm-openai = { path = "/absolute/path/to/golem-ai/llm/openai" }

Change the provider workspace dependency directly: a crates.io patch to the development SDK's 0.0.0 version does not satisfy the provider's =3.0.0-rc5 requirement.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
1,521
Repository forks
210
7-day trend score
0

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/golemcloud/golem/golem-add-llm-rust/badge)](https://verified-skill.com/skills/golemcloud/golem/golem-add-llm-rust)

Something wrong with this skill or its page? Tell us.