Skip to content
Back to skills

2697 Llmnode 5292fdfb

ASecurity

The `LLMNode` is the "brain" of your agent. It is a resilient, state-aware node that calls a generative AI model (like Google's Gemini) to perform a reasoning task. It automatically formats your prompt with data from the `GraphState` and writes the model's text output back to the state.

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
ai-agentspythongonodeapi

Works with

  • api

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 2697-llmnode_5292fdfb --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 2697 Llmnode 5292fdfb?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 2697 Llmnode 5292fdfb
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-2697-llmnode-5292fdfb/badge)](https://www.skillsdirectory.com/skills/tools-only-2697-llmnode-5292fdfb)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md


# API Reference: `LLMNode`

The `LLMNode` is the "brain" of your agent. It is a resilient, state-aware node that calls a generative AI model (like Google's Gemini) to perform a reasoning task.

It automatically formats your prompt with data from the `GraphState` and writes the model's text output back to the state.

## Key Features

- Resilient: Automatically retries on `429` (rate-limit) errors with exponential backoff.

- Cost Auditing: Automatically logs `prompt_tokens`, `output_tokens`, and `total_tokens` to the `run_metadata` in the history log.

- Stateful: Uses Python's `format()` string method to dynamically populate your prompt with any value from the `GraphState`.

## Example Usage

```python
# The LLMNode reads `task` from the state
planner_node = LLMNode(
    model_name="gemini/gemini-2.5-pro",
    prompt_template="You are a planner. Your task is: {task}",
    output_key="plan", # Saves the result to state["plan"]
    next_node=...
)
```
`__init__`  Parameters

| Parameter | Type | Required | Description|
|-----------|------|----|---------------|
| `model_name` | `str` | Yes | The name of the model (e.g., `"gemini-2.5-pro"`). |
| `prompt_template` | `str` | Yes | An f-string compatible template. Keys in `{braces}` will be filled from the GraphState. |
| `output_key` | `str` | Yes | The key to save the LLM's text response to in the `GraphState` (e.g., `"draft_answer"`). |
| `next_node` | `BaseNode`| Yes | The next node to run after this one successfully completes. |
| `max_retries` | `int` | No | The number of times to retry on a 429 error. Default: 3. |

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.