Skip to main content

Notte LLM

LLM-based structured data extraction for Notte. It provides LlmExtractor, the default implementation of the notte_core.extraction.StructuredExtractor protocol that local sessions use for scrape(instructions=..., response_format=...). Cloud sessions run extraction server side and don't need it.

pip install 'notte[llm]'  # or: pip install notte-llm
from notte_browser.session import NotteSession
from notte_llm import LlmExtractor
from pydantic import BaseModel


class Title(BaseModel):
    title: str


with NotteSession(headless=True, extractor=LlmExtractor()) as session:
    _ = session.execute(type="goto", url="https://www.notte.cc")
    data = session.scrape(response_format=Title)

When notte-llm is installed and no extractor is passed, sessions use LlmExtractor() automatically.

Set OPENROUTER_API_KEY to use OpenRouter with google/gemini-3.5-flash-lite by default. For another OpenAI-compatible endpoint, set all three of NOTTE_LLM_BASE_URL, NOTTE_LLM_API_KEY, and NOTTE_LLM_MODEL (the endpoint's own model ID):

  • OpenAI: NOTTE_LLM_BASE_URL=https://api.openai.com/v1, NOTTE_LLM_MODEL=gpt-4o.
  • Gemini: NOTTE_LLM_BASE_URL=https://generativelanguage.googleapis.com/v1beta/openai, NOTTE_LLM_MODEL=gemini-3.5-flash-lite.
  • Ollama/custom: NOTTE_LLM_BASE_URL=http://localhost:11434/v1, your local model ID, and NOTTE_LLM_API_KEY=ollama for an unauthenticated local server. Ollama has not been live-tested.

NOTTE_LLM_API_KEY overrides OPENROUTER_API_KEY. The latter is used only at the default OpenRouter URL, so it is never sent to a custom endpoint. The per-call model= argument selects a model at the configured endpoint without translating its ID.

Variable Default
NOTTE_LLM_BASE_URL https://openrouter.ai/api/v1
NOTTE_LLM_API_KEY OPENROUTER_API_KEY at the default URL; required elsewhere
NOTTE_LLM_MODEL google/gemini-3.5-flash-lite at the default URL; required elsewhere
NOTTE_LLM_TEMPERATURE 0.0
NOTTE_LLM_NB_RETRIES_STRUCTURED_OUTPUT 2
NOTTE_LLM_CONTEXT_TOKENS 128000 (document clipping estimates four characters per token)

The async client posts Chat Completions through httpx with a 60-second timeout per attempt (LLMEngine(timeout=...)), retrying transient errors after 2 and 5 seconds. Typed extraction tries strict json_schema output; when a provider rejects it, the client retries with json_object and the schema in the prompt. If the endpoint also rejects json_object, it uses the schema in the prompt alone. Every answer is still validated with Pydantic, with JSON repair and parsing feedback on retries. Instructions-only extraction starts with json_object because it has no fixed data schema.

OpenRouter receives model fallbacks (google/gemini-3.8-flash, openai/gpt-4.1-mini). LLMEngine(provider_order=[...], reasoning={...}) can also pass OpenRouter routing and reasoning options. These extras are sent only when the configured hostname is openrouter.ai. A provider's content-policy refusal (an OpenRouter, OpenAI or Azure content-filter error, or a content_filter finish reason with no content) raises ContentFilterError naming the model, not InvalidAPIKeyError. For Vertex or other token-based endpoints, mint the access token outside the library and pass it as NOTTE_LLM_API_KEY; refresh it before it expires.

For endpoint-specific request options, pass extra_body to LlmExtractor.extract (or to LLMEngine's constructor). These explicit fields override request defaults for that call; None removes a default field. For example, pin Together without model or provider fallbacks and use its advertised output-token limit:

result = await LlmExtractor(model="meta-llama/llama-3.3-70b-instruct").extract(
    url="https://example.com",
    document="# Example page",
    response_format=Title,
    instructions="Extract the title",
    extra_body={
        "models": None,
        "provider": {"order": ["together"], "allow_fallbacks": False},
        "max_completion_tokens": 2048,
    },
)

Explicit extras are forwarded to any configured endpoint, so use only fields that endpoint supports. The library does not discover provider limits or automatically lower its default 8192 completion tokens. Set max_completion_tokens to your endpoint's limit when it is lower. Overrides do not persist to subsequent calls.

Metadata

Release files for notte-llm 1.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for notte-llm 1.10.0
File Size Uploaded Provenance
notte_llm-1.10.0.tar.gz 17.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for notte-llm 1.10.0
File Interpreter ABI Platform
notte_llm-1.10.0-py3-none-any.whl Python 3 none any Details

Total release size: 37.5 kB

Release files / notte_llm-1.10.0.tar.gz

Download URL notte_llm-1.10.0.tar.gz
Size 17.5 kB
Tags Source
SHA-256 checksum
How to use checksums
992401319e3567e88ed219fa24a8d81bd02a0f3f525aee5567e5b137ea78bbb1
BLAKE2b-256 checksum
How to use checksums
d45e6bcb460417da7d76f1fd133f5a5186b5c15d8d6af126b8c69fa83c1cb888
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / notte_llm-1.10.0-py3-none-any.whl

Download URL notte_llm-1.10.0-py3-none-any.whl
Size 20.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab0112e02235d30b895e2f1de90c6d36c637c76da548348f03398793ba4f138a
BLAKE2b-256 checksum
How to use checksums
d922d8e8cd6d5982d8a92b30a2abf378fe37a69f5feb382fb497c508b8c236dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for notte-llm 1.10.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.10.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page