Skip to main content

Crate everruns_llmsim

Crate everruns_llmsim 

Source
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§

LlmSimConfig
Configuration for the LlmSim driver.
LlmSimDriver
Deterministic LLM simulator driver.
SimToolCall
A single tool call inside a scripted turn.
ToolCallPattern
Pattern for conditional tool calls

Enums§

OnExhausted
Behavior when a scripted config has consumed all turns.
ResponseConfig
Response generation configuration.
SimError
Error to inject for a scripted turn.
SimTurn
A single scripted assistant turn.
ToolCallConfig
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_aws capability’s tools. Useful for the user_hooks end-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_use block path. The scripted agent first issues a destructive bash call (rm -rf /) followed by a benign one (ls -la). When combined with a pre_tool_use hook bundle that denies rm -rf patterns, 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 monitor task. Used by LLMSIM_DEMO=monitor for 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_hooks audit-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 a background_tool session task), then inspects the registry with list_tasks.