Academy → Developer guideOfficial documentation · clear explanation

Plugin LLM Access

الإضافات LLM Access

Developer17 minutes3 questions2026-08-09
The idea in one minute

Start with meaning, then move to detail.

This lesson explains Plugin LLM Access as part of Hermes internals and extension points. You will learn what it does, when it matters, and the smallest safe test that proves it works.

If you are new

If you are new, do not memorize names. Focus on three questions: what problem does this solve, what access does it need, and how can you verify the result?

For hands-on use

For practice, inspect the first example, identify its effects, run it on test data, and compare the result with the source claim.

For specialists

For advanced readers, inspect The smallest possible call, A more complete chat example, Structured output, then verify failure modes and version compatibility.

What do you need first?

Know Python, Git, and basic project structure before changing code.

What will you know?

A clear outcome before you read.

  • Understand Plugin LLM Access without assumed prior knowledge.
  • Separate the source description from what still needs testing in your environment.
  • Read the first command and identify its inputs and outputs before copying it.
Official page description

Run any LLM call from inside a plugin via ctx.llm — chat or structured, sync or async. Host-owned auth, fail-closed trust gate, optional JSON Schema validation.

Topic map

What does the source say, and in what order?

  1. 01
    The smallest possible call

    Start here to understand the core idea or structure.

  2. 02
    A more complete chat example

    Read this after the foundation, then connect it to the previous step.

  3. 03
    Structured output

    Read this after the foundation, then connect it to the previous step.

  4. 04
    What this lane gives you

    Read this after the foundation, then connect it to the previous step.

  5. 05
    Quick start

    Read this after the foundation, then connect it to the previous step.

  6. 06
    Chat completion — /tldr

    Read this after the foundation, then connect it to the previous step.

  7. 07
    Structured extraction — /paste-to-tasks

    Read this after the foundation, then connect it to the previous step.

  8. 08
    When to use which

    Read this after the foundation, then connect it to the previous step.

  9. 09
    API surface

    Read this after the foundation, then connect it to the previous step.

  10. 10
    complete()

    Finish here to verify the result and special cases.

Examples from the official page

Copy only after you understand the effect.

That's the whole API in one line. No keys, no provider config, no SDK initialisation. The plugin runs against whatever provider and model the user is currently using — when they switch providers, the plugin follows them automatically. ## A more complete chat example
`purpose` is a free-form audit string — it shows up in `agent.log` and in `result.audit` so operators can see which plugin made which call. Optional but recommended for anything that fires often. ## Structured output When the plugin needs a typed answer, switch to the structured lane:
The host requests JSON output from the provider, parses it locally as a fallback, validates against your schema if `jsonschema` is installed, and hands back a Python object on `result.parsed`. If the model couldn't produce valid JSON, `result.parsed` is `None` and `result.text` carries the raw response. ## What this lane gives you * **One call, four shapes.** `complete()` for chat, `complete_structured()` for typed JSON, `acomplete()` and `acomplete_structured()` for asyncio. Same arguments, same result objects. * **Host-owned credentials.** OAuth tokens, refresh flows, the credentia
Try it now

Read the first command and identify its inputs and outputs before copying it.

Match every command to your installed Hermes version, review the files and accounts it can reach, and use non-sensitive data for the first test. If this explanation differs from the source, the official source wins.

Knowledge check

Three decisions before completion.

1. What is the source of truth when “Plugin LLM Access” changes?
2. What is the best way to apply this lesson?
3. What should happen before a step can modify files or an external account?