n8n-nodes-ciaacc-tokenless
v0.2.1
Published
Provider-neutral n8n nodes that reduce real AI Agent token usage with plug-and-play savings profiles.
Maintainers
Readme
CIAACC TokenLess
Provider-neutral n8n nodes that reduce real input tokens sent by AI Agents. No second LLM, proxy, or provider-specific SDK required.
Install
In Settings → Community Nodes → Install, enter:
n8n-nodes-ciaacc-tokenlessStart with TokenLess Model
Place it on the model connection:
Gemini / OpenAI / Anthropic / OpenRouter / Ollama / other Chat Model
↓
TokenLess Model
↓
AI AgentChoose a profile. TokenLess intercepts the final AiLanguageModel request built by the Agent, including system messages, memory, available tool schemas, and prior tool results. This is the primary plug-and-play node.
| Profile | Behavior | Eligible target* | |---|---|---:| | Quality | Reversible structural compression only | 5–25% | | Safe | Reversible JSON packing and exact deduplication | 20–40% | | Balanced | Safe packing plus task-aware prompt modules | 30–55% | | Savings | Progressive prompts, selective memory, lazy tools, packing | 50–75% | | Maximum Savings | Strongest eligible reduction with quality fallback | 65–80% |
*Targets are not guarantees. Savings depend on repetition, prompt modularity, tool count, history, and result size. Unsafe or negative optimizations fall back to the original payload.
Nodes
TokenLess Router
Optional. Place it in the main flow immediately before an AI Agent. It reads only a small recent window from any connected AI Memory and chooses an economy or main model without an LLM call for clear cases.
Chat Trigger → TokenLess Router → AI Agent
↑
Redis Chat MemorySet the provider Chat Model's model field to:
={{ $json.selectedModel }}The Router can optionally use a connected Routing Model only for ambiguous cases. Invalid, missing, or low-confidence routing results use the main model. This first version switches model IDs inside the same provider and credential.
TokenLess Model
Use in almost every AI Agent. It reduces the final provider input and reads provider-reported usage when available.
TokenLess Tools
Optional. Place between an individual AI Tool and AI Agent when that tool returns large JSON/logs or receives repeated safe read calls.
AI Tool → TokenLess Tools → AI AgentResult caching is disabled by default. Enable Static Reference Reads only for stable policy, catalog, schema, documentation, or configuration tools. All Read-Only Calls is explicit and still blocks volatile balance, rate, price, stock, status, and availability tools.
TokenLess Content
Optional. Place before an Agent or Chain when a large JSON, API response, document, prompt, HTML page, or log is already present in the main workflow data.
What TokenLess Model reduces
- Loads only high-confidence relevant tool schemas; active tool-call sequences remain available.
- Packs repeated and nested JSON reversibly, including n8n tool response envelopes.
- Loads relevant prompt modules in stronger profiles while preserving mandatory rules.
- Keeps recent, corrected, pending, error, and task-relevant memory; omits eligible stale context.
- Refuses negative savings and restores original input when protected facts fail validation.
Protected facts include IDs, money, dates, times, URLs, emails, phone numbers, percentages, negations, and configured JSON paths.
Provider compatibility
TokenLess wraps n8n's generic AiLanguageModel interface. Optimization is independent from Gemini, OpenAI, Anthropic, OpenRouter, Ollama, or another compatible chat model.
TokenLess Router outputs a model ID and therefore works with any provider node whose model field accepts an n8n expression. Economy and main IDs must belong to that provider. It does not convert a Gemini node into an Anthropic or OpenAI node.
Actual token reporting supports common usage, usage_metadata, usageMetadata, tokenUsage, response_metadata, and LangChain metadata shapes. When provider usage is unavailable, the report is explicitly labeled estimated.
Real local validation
The included [LAB] TokenLess - Gemini Profile Matrix workflow compares the complete stack:
TokenLess Content + Gemini → TokenLess Model → AI Agent ← TokenLess ToolsUse your own Gemini credential when importing outside the local lab. No API key is stored in the repository.
In a fictitious 30K-context, seven-tool, two-call test, Gemini reported:
| Branch | Real input tokens | Reduction | Expected facts preserved | |---|---:|---:|---| | Baseline | 61,494 | — | Yes | | Quality | 49,883 | 18.88% | Yes | | Safe | 49,899 | 18.86% | Yes | | Balanced | 30,005 | 51.21% | Yes | | Savings | 15,123 | 75.41% | Yes | | Maximum Savings | 15,135 | 75.39% | Yes |
These numbers prove the provider received a smaller payload in this fixture. They are not universal promises.
Development
npm ci
npm run check
powershell -ExecutionPolicy Bypass -File scripts/start-local.ps1Open http://localhost:5678. Local runtime lives at %LOCALAPPDATA%\CIAACC-TokenLess\n8n.
Current limits
- Provider billing and prompt caching policies vary; measure both cost and
input_tokenswith representative A/B evals. - Strong profiles need modular prompt headings and specific tool names/descriptions for best selection.
- Process-local caches are not shared across queue-mode workers in
0.2.0. - Model routing reduces price per token; TokenLess Model, Tools, and Content reduce the number of tokens. Use both effects together for maximum net savings.
- No compressor can guarantee a fixed percentage or eliminate model hallucination.
