Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

TubeBrain

TubeBrain is a local AI nervous-system laboratory for researchers, students, developers, writers, and anyone trying to understand how different AI model brains actually operate during real work.

A user manually defines a local brain profile, connects it through their own OpenRouter API key, selects a model, and runs controlled project tests. TubeBrain records the real provider response and uses the EEL2 framework to reconstruct the brain's changing operational relational state.

TubeBrain is not a basic token or pricing counter. Tokens, timing, cost, completion, truncation, and throughput are supporting sensor channels. EEL2 uses those channels to characterize normalized activation, workload, context pressure, output pressure, completion integrity, relational stability, adaptation, strain, efficiency, and project fit.

What TubeBrain answers

TubeBrain helps investigate questions such as:

  • Which connected brain is best suited to my research project?
  • Which model explains student material most clearly?
  • Which coding brain completes without truncation?
  • Which brain remains operationally stable across repeated controlled tests?
  • Which brain reorganizes under context or output pressure?
  • Does a more expensive or token-heavy run produce a better human-rated result?
  • Is a brain fast but shallow, slow but productive, output-limited, strained, or well matched to the task?

What is new in v0.2.0

  • Manual local brain profiles with a name, purpose, model, instructions, temperature, and output limit.
  • API keys remain session-memory-only and are never stored in brain profiles.
  • A deterministic Functional Operational Experience panel generated locally with zero provider calls.
  • EEL2-centered user experience instead of a pricing-centered dashboard.
  • Operational dimensions for activation, workload, responsiveness, context pressure, output pressure, completion integrity, stability, adaptation, efficiency, and project fit.
  • Brain-to-project compatibility comparison grouped by named brain, model, and project type.
  • Project-fit interpretation updates locally when the user saves a quality rating.
  • New EEL2 channels for task completion, completion-token rate, output-cap use, and prompt-token share.
  • Safe automatic migration of v0.1.x local databases.
  • Expanded tests and documentation.

Important meaning of “experience” and “how it feels”

TubeBrain uses functional operational experience to describe how the connected AI system appears to be operating under a measured workload.

Examples include:

  • low or elevated activation;
  • light or heavy operational load;
  • responsive or slow execution;
  • context pressure;
  • output-limit strain;
  • settled, shifting, or reorganizing relational state;
  • productive adjustment;
  • major adaptation;
  • project fit.

These descriptions are derived from measured software behavior. TubeBrain does not claim that EEL2 proves biological feeling, emotion, consciousness, or sentience.

EEL2 in TubeBrain

For a completed provider operation at time t_k, TubeBrain builds a measured state vector:

Q(t_k) = measured software-operation channels

Channels include cumulative and latest values for prompt tokens, completion tokens, total tokens, active API seconds, cost, input/output size, successful completion, truncation, response time, processing rates, output-cap use, and prompt-token share.

EEL2 then computes:

r_i   raw rate of channel change
s_i   frozen robust reference scale
rho_i normalized signed activation
p_i   relative channel change
P_i   surrounding movement of other channels
E_i*  signed forward field
H_ij  directed inverse relational field
B_ij  sign branch (++,+-,-+,--)
D_H   distance from the previous compatible relational field

Movement bands:

D_H < 0.35       STABLE
0.35 <= D_H < 1 MOVING
D_H >= 1         REORGANIZING

These are configurable software interpretation thresholds, not universal physical constants.

See EEL2_IN_TUBEBRAIN.md for the full equations and interpretation rules.

How one brain test works

  1. The user verifies an OpenRouter model-call API key.
  2. The user creates or loads a local brain profile.
  3. The user chooses a project type and enters a real task.
  4. TubeBrain makes exactly one provider call.
  5. The provider response, usage, cost, finish reason, and end-to-end response time are recorded.
  6. EEL2 measures the operation after the call finishes.
  7. TubeBrain creates a deterministic operational-experience interpretation locally.
  8. The user rates project usefulness separately.
  9. Project fit is recalculated locally without another model call.
  10. The run, EEL2 state, experience profile, and rating remain in local SQLite history.

Credit-safe behavior

Each press of Run this brain experience makes exactly one provider request.

TubeBrain does not automatically:

  • retry;
  • switch models;
  • call a verifier;
  • ask another brain;
  • generate the EEL2 interpretation with an AI;
  • continue a truncated answer.

When finish_reason=length, TubeBrain records the API call as successful but the output as incomplete. The user may explicitly request one continuation, which is a separate measured call.

Installation on Windows

Requirements:

  • Windows 10 or 11;
  • Python 3.10 or newer;
  • PowerShell;
  • internet access;
  • an OpenRouter model-call API key.

Extract the ZIP and run:

START_TUBEBRAIN.cmd

The launcher creates .venv inside that user's own TubeBrain folder, installs dependencies, selects an available local port, starts the server, and opens the browser.

Default address:

http://127.0.0.1:8766

See INSTALL_WINDOWS.txt and TROUBLESHOOTING.md.

Privacy and local storage

The OpenRouter API key:

  • is held in the running Python process only;
  • is lost when TubeBrain closes;
  • is not written to SQLite;
  • is not stored in a brain profile;
  • is not included in exports.

Local records may contain prompts and model responses. Do not enter sensitive information unless you understand the provider and local-storage implications.

Generated local data is stored under:

data/tubebrain.db
exports/

These paths are excluded by .gitignore except for .gitkeep files.

Repository structure

app.py
├── tubebrain/
│   ├── provider.py
│   ├── eel2.py
│   ├── experience.py
│   ├── storage.py
│   └── prompts.py
├── templates/index.html
├── static/app.js
├── static/styles.css
├── tests/
├── START_TUBEBRAIN.cmd
├── START_TUBEBRAIN.ps1
├── RUN_TESTS.ps1
├── CHECK_TUBEBRAIN.ps1
├── README.md
├── EEL2_IN_TUBEBRAIN.md
├── OPERATIONAL_EXPERIENCE_METHOD.md
├── ARCHITECTURE.md
├── SECURITY.md
└── INSTALL_WINDOWS.txt

Controlled comparison method

For meaningful results:

  1. Use the same exact project prompt.
  2. Use the same project type.
  3. Use the same temperature.
  4. Use the same maximum output.
  5. Run each brain multiple times.
  6. Rate the actual response.
  7. Compare completion, rating, EEL2 state, field movement, timing, tokens, and cost together.

A single run is an observation, not proof that one model is universally best.

Current limitations

  • OpenRouter is the only provider adapter in v0.2.0.
  • Text-based completion only.
  • No automatic web search.
  • No file or image upload.
  • Local single-user application.
  • End-to-end response time is not OpenRouter time to first token.
  • EEL2 operational state is not an answer-correctness or consciousness score.
  • Project fit requires human rating and repeated controlled testing for strong conclusions.

Tests

Run:

Set-ExecutionPolicy -Scope Process Bypass
.\RUN_TESTS.ps1

Tests cover EEL2 mathematics, null/sign handling, complete relation count, field distance, functional-experience interpretation, brain-profile storage, API-key semantics, database migration, truncation semantics, and export/storage behavior.

License

No open-source license has been selected automatically. Source code published without a license remains under ordinary copyright restrictions. Add an intentional license before describing the project as freely reusable open-source software.

About

TubeBrain is a local AI nervous-system laboratory for testing and comparing model brains through OpenRouter. Connect your own API key, run real projects, compare quality, tokens, cost, latency, truncation, and project fit, and use EEL2 to study operational stability, strain, adaptation, and changing relational behavior.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages