chat-model-configuration
Skill0 starsChanged 6 months agoMITView on GitHub
Configures agent behaviour via @agent() parameters and AgentConfig. Use when adjusting max_turns, temperature, max_tokens_per_turn, max_cost_usd, tool_error_policy, memory window, or when the agent must stop after a fixed number of turns.
In this repository65 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/building-agents/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms-full.txtllms.txt
- llms.txtllms.txt
- adding-guardrailsSkill
- agent-health-timeoutSkill
- agent-permission-scopingSkill
- agent-session-isolationSkill
- agent-step-loggingSkill
- agent-supervisor-routerSkill
- agent-telemetrySkill
- async-agent-backgroundSkill
- building-agentsSkill
- building-teamsSkill
- building-toolsSkill
- calendar-scheduling-toolSkill
- callback-tracing-handlerSkill
- chain-of-thought-promptingSkill
- code-execution-sandboxSkill
- common-agent-patternsSkill
- context-window-managementSkill
- conversation-memorySkill
- conversation-state-dbSkill
- database-query-toolSkill
- document-loadersSkill
- document-rerankingSkill
- email-notification-toolSkill
- embedding-model-ingestionSkill
- fallback-model-chainSkill
- few-shot-injectionSkill
- filesystem-toolSkill
- human-in-the-loopSkill
- hybrid-searchSkill
- inspecting-streamsSkill
- integrating-with-laurenSkill
- json-schema-enforcementSkill
- llm-provider-connectionSkill
- llm-rate-limitingSkill
- long-term-vector-memorySkill
- managing-memorySkill
- migrating-to-lauren-aiSkill
- multi-agent-delegationSkill
- multi-tool-orchestrationSkill
- multi-turn-tool-stateSkill
- output-guardrailsSkill
- plan-and-execute-agentSkill
- prompt-injection-defenseSkill
- prompt-versioningSkill
- rag-pipelineSkill
- react-agent-loopSkill
- response-validation-retrySkill
- rest-api-toolSkill
- securing-agentsSkill
- semantic-cacheSkill
- streaming-response-handlerSkill
- structured-output-parsingSkill
- sub-agent-spawningSkill
- system-prompt-templatingSkill
- testing-agentsSkill
- The first 60 shown.
The file
Files
Use
codemap find "SymbolName"to locate any symbol before reading — it gives exact file + line range and is faster than grep across the whole repo.
Chat Model Configuration & Parameter Tuning
Quick start
# agent.py — from __future__ import annotations is safe here (no @tool)
from __future__ import annotations
from lauren_ai import agent
from lauren_ai._memory._stores import InMemoryConversationStore
@agent(
model="claude-opus-4-6",
system="You are a helpful assistant.",
max_turns=3,
temperature=0.7,
max_tokens_per_turn=2048,
memory_window_tokens=20_000,
tool_error_policy="return_error",
conversation_store=InMemoryConversationStore(),
)
class ConfiguredAgent: ...@agent() parameters
| Parameter | Type | Default | Description |
model | str | required | Model identifier, e.g. "claude-opus-4-6" |
system | str | "" | System prompt for every turn |
max_turns | int | 10 | Loop iteration cap; raises AgentMaxTurnsError |
max_tokens_per_turn | int | 4096 | Output token limit per LLM call |
temperature | float | 1.0 | Sampling temperature (0.0–2.0) |
memory_window_tokens | int | 40_000 | Sliding context window in tokens |
max_cost_usd | float | None | None | Cost cap; raises AgentBudgetExceededError |
parallel_tool_calls | bool | False | Run all tool calls in a turn concurrently |
tool_error_policy | str | "return_error" | "raise" | "return_error" | "skip" |
conversation_store | ConversationStore | None | None | Persistent conversation history |
memory | ShortTermMemory | None | None | Per-agent shared short-term memory |
max_turns enforcement
from lauren_ai import agent, AgentMaxTurnsError
from lauren_ai._agents._runner import AgentRunnerBase as AgentRunner
from lauren_ai._config import LLMConfig
from lauren_ai._transport._mock import MockTransport
@agent(model="claude-opus-4-6", max_turns=2)
class LimitedAgent: ...
cfg = LLMConfig(provider="anthropic", model="mock-model", api_key="mock")
mock = MockTransport()
runner = AgentRunner(transport=mock)
# Queue 5 tool-use completions — runner stops at max_turns
# AgentMaxTurnsError is raised once the cap is hitLifecycle-doc class (using a docstring as system prompt)
@agent(model="claude-opus-4-6", max_turns=5)
class DocAgent:
"""You are an expert Python programmer.
Always respond with working code.
"""The class docstring becomes the system prompt when no system= kwarg is given.
Reference files
| File | Contents |
src/lauren_ai/_config.py | AgentConfig frozen dataclass — all defaults |
src/lauren_ai/_agents/__init__.py | @agent() decorator, AgentMeta |
src/lauren_ai/_agents/_runner.py | AgentRunnerBase loop with max_turns check |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

