Skip to main content

Start here · 2 of 3

Getting started

Everything on this page runs offline, sends no request to a provider and reads no credential you already have.

crates/*/examples, crates/llm-docs/examples, Cargo.toml, .github/workflows/gate.yml

Getting started

Prerequisites​

ToolVersionNeeded for
Rust1.98, edition 2024The workspace
Taskv3task check and task rust
ESS (GitHub)0.56.0 in CIThe specification and conformance stages of task check
AEP (GitHub)0.68.0 in CIThe planning stage of task check

Rust alone is enough to build, test and run the examples.

Get the source​

git clone https://github.com/beyond10x/llm.git
cd llm
cargo test --workspace --locked

The workspace forbids unsafe, and Clippy runs all plus pedantic at deny.

Run a model turn with no network and no credential​

cargo run --locked -p llm-core --example embedded
An embedded model turn. (EndTurn; usage None)

The example implements Model in-process and calls it through the same port a real client implements. usage None is not a mistake: the example reports no counters, so none are shown. Run a local turn walks through it.

Force one tool call​

cargo run --locked -p llm-docs --example forced_tool_call
{"component":"importer","severity":"high"}

call_tool forced one tool on a recorded model and returned the call's arguments. Call a model with one forced tool shows the program and how to point it at a Codex login instead.

Explain a route without resolving a secret​

cargo run --locked -p llm-routing --example explain

It reads examples/catalog.toml and prints the selected target, each candidate's provenance and capabilities, and why each other candidate was rejected. Explain a route shows the output.

Price recorded usage​

cargo run --locked -p llm-cost --example quote

It prices fixture observations against a fictional price book and prints an llm.cost/2 report whose metered estimate is 0.00022 USD. Price recorded usage explains the report.

Depend on a crate from your own project​

Nothing is published to crates.io; every package is publish = false. Depend on a crate from Git at a release tag, as Loom does:

[dependencies]
llm-core = { git = "https://github.com/beyond10x/llm", tag = "<release>" }
llm-responses = { git = "https://github.com/beyond10x/llm", tag = "<release>" }

A package name is its directory name; its library name uses underscores, so the code says use llm_core::…. Crates lists every package, its library name and its features. The source is licensed under Apache-2.0 from 0.1.2 on; see LICENSE.

Next​