Expand description
Deterministic, offline LLM simulation for Everruns agents and runtimes.
everruns-llmsim implements the provider contracts from
everruns-contracts with configurable
fixed, echo, sequence, and scripted responses. It runs in process without
credentials or network access and supports deterministic tool calls,
injected failures, latency controls, and request capture.
Framework applications can use everruns::Model::simulated without naming
this crate. Advanced hosts and tests can configure the driver directly:
use everruns_llmsim::{LlmSimConfig, LlmSimDriver};
let driver = LlmSimDriver::new(LlmSimConfig::fixed("Hello."));Modules§
- realtime
- Simulated speech-to-speech provider for tests and offline demos.
- speech
- Simulated speech-to-text and text-to-speech for cascaded voice tests and offline demos.
Structs§
- LlmSim
Config - Configuration for the LlmSim driver.
- LlmSim
Driver - Deterministic LLM simulator driver.
- SimTool
Call - A single tool call inside a scripted turn.
- Tool
Call Pattern - Pattern for conditional tool calls
Enums§
- OnExhausted
- Behavior when a scripted config has consumed all turns.
- Response
Config - Response generation configuration.
- SimError
- Error to inject for a scripted turn.
- SimTurn
- A single scripted assistant turn.
- Tool
Call Config - Tool call configuration.
Constants§
- LLMSIM_
REASONING_ TEXT - Readable reasoning text llmsim emits when a turn requests reasoning.
- LLMSIM_
RECOMMENDED - Curated model recommendations for this provider. Refresh when the vendor
rotates flagships; keep every role default inside
recommended_models.
Functions§
- auditor_
demo_ script - Scripted multi-turn config that drives the Cloud Cost & Security Auditor
example agent through a small, deterministic AWS audit using only the
fake_awscapability’s tools. Useful for theuser_hooksend-to-end demo (and any operator who wants to exercise the auditor without an LLM API key). - builtin_
scenario_ names - Names of the built-in scenarios a marker can select.
- create_
chat_ driver - Create a LlmSim driver with custom configuration
- guarded_
bash_ demo_ script - Scripted scenario that exercises the
pre_tool_useblock path. The scripted agent first issues a destructivebashcall (rm -rf /) followed by a benign one (ls -la). When combined with apre_tool_usehook bundle that deniesrm -rfpatterns, the first tool call gets blocked (the tool is not invoked) and the second succeeds — the agent observes the difference in tool results. - monitor_
demo_ script - Scripted scenario for the monitor task kind: spawns a recurring scheduled
monitor (cron fires at second 0 every minute) so the session scheduler
creates the schedule and a linked
monitortask. Used byLLMSIM_DEMO=monitorfor end-to-end verification without an LLM API key. - register_
driver - Register the LlmSim driver with the driver registry
- register_
driver_ with_ config - Register the LlmSim driver with a custom configuration. Useful for
servers/workers that want to opt into a scripted scenario (e.g. the
user_hooksaudit-log demo) without changing the default behaviour for callers that don’t. - session_
tasks_ demo_ script - Scripted scenario that exercises the session task registry end-to-end
without an LLM API key. The scripted agent starts a background bash run
via
spawn_background(which creates abackground_toolsession task), then inspects the registry withlist_tasks.