Skip to content

Quick Start

Steven Enamakel edited this page Oct 22, 2026 · 7 revisions

Quick Start

TinyAgents crates are published from the canonical tinyhumansai/tinyagents repository. Add the packages your host needs:

[dependencies]
tinyagents-harness = { git = "https://github.com/tinyhumansai/tinyagents", package = "tinyagents-harness" }
tinyinference-llm = { git = "https://github.com/tinyhumansai/tinyinference", package = "tinyinference-llm" }

A host can build an AgentHarness, install a model resolver, and invoke it with a user message:

use std::sync::Arc;
use tinyagents_harness::runtime::AgentHarness;
use tinyinference_llm::message::Message;
use tinyinference_llm::providers::openai::OpenAiModel;

let model = OpenAiModel::from_env()?;
let mut harness: AgentHarness<()> = AgentHarness::new();
harness.with_model_resolver(Arc::new(
    tinyagents_harness::host::FixedModelResolver::named("openai", Arc::new(model)),
));
let run = harness
    .invoke_default(&(), vec![Message::user("What is a Rust trait?")])
    .await?;
println!("{}", run.text().unwrap_or_default());

Set OPENAI_API_KEY before running the example. For local development, clone with recursive submodules and start with Development.

TinyAgents

Provider-neutral agent harness and tools for Rust.

Getting started

Concepts

Modules

Providers

Contributing


Clone this wiki locally