Skip to content

About

HugrGate is an open-source, local-first decision runtime that adds probabilistic AI judgment to ordinary program logic. It can use rules, classifiers, local models, or optional remote backends without locking software to one vendor, model, or inference method.

Resources

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

623 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

file_00000000f11881f5b3df333d9dc5fa47.png


What is HugrGate Podcaste 1


RuneForgeAI HugrGate

Working title. An open-source, local-first, model-agnostic runtime for adding probabilistic machine judgment to ordinary program logic without making software dependent on one AI vendor, one model family, or one inference method.

Status: Active Alpha / Working Implementation
Version: 0.1.0
Implementation: Initial 50-slice implementation complete
License: Apache-2.0
Project philosophy: Local first. Open interfaces. Replaceable intelligence. Deterministic when possible.


https://raw.githubusercontent.com/hrabanazviking/RuneForgeAI-HugrGate/refs/heads/main/RuneForgeAI-HugrGate_picture1.png


Why HugrGate?

Most software decisions are easy to express:

if temperature > 90:
    enable_cooling()

Some decisions are not:

Does this event look urgent?
Which subsystem should handle this request?
Is this message probably a security incident?
Does this state look anomalous?

Developers often solve those problems by calling a large language model and asking it to emit JSON. That works, but it introduces several problems:

  • unnecessary generative inference
  • parsing and schema failures
  • unpredictable latency
  • excessive compute
  • cloud dependence
  • vendor lock-in
  • weak probability calibration
  • poor offline behavior
  • difficulty choosing the smallest tool that can solve the problem

HugrGate proposes a different abstraction:

unstructured or structured state
            ↓
      DecisionSpec
            ↓
        HugrGate
            ↓
 typed value + probability distribution
            ↓
      ordinary program logic

The important part is that HugrGate is not a model.

It is an open decision runtime and interface capable of selecting among many inference methods.


Core Principle

Intelligence is a replaceable implementation detail, not a vendor dependency.

A program should be able to ask for a bounded machine judgment without caring whether that judgment came from:

  • deterministic rules
  • a statistical classifier
  • logistic regression
  • gradient boosting
  • an embedding model
  • a small neural network
  • an ONNX model
  • a local NLI model
  • a constrained local LLM
  • a specialized decision model
  • a remote provider explicitly enabled by the user
  • a future inference system that does not exist yet

The application depends on the decision contract, not the intelligence provider.


Goals

HugrGate should eventually provide:

  1. Typed machine decisions
  2. Probabilities and uncertainty
  3. Local-first inference
  4. Multiple interchangeable backends
  5. Deterministic fallbacks
  6. Automatic escalation to stronger inference only when needed
  7. Language-neutral integration
  8. Offline operation
  9. Auditable decision provenance
  10. Calibration and benchmarking tools
  11. No mandatory cloud service
  12. No mandatory model family
  13. No mandatory AI at all when ordinary code is sufficient

Non-Goals

HugrGate is not intended to be:

  • a clone of any proprietary AI service
  • API-compatible with any proprietary decision model
  • a reverse-engineered implementation of another company's architecture
  • a model-distillation project
  • a chatbot
  • a general text-generation system
  • a replacement for ordinary conditional logic
  • a reason to put AI in places where deterministic code is better

The project should avoid copying proprietary API schemas, SDK signatures, terminology, documentation, examples, model outputs, benchmark suites, or branding.


Decision Contract

Rather than defining the runtime around a particular model's output types, HugrGate should use a general schema.

Possible decision families:

Categorical

Choose among named alternatives.

type: categorical
options:
  - normal
  - warning
  - critical

Binary belief

Estimate the probability that a proposition is true.

type: binary
statement: "This event represents a security problem."

Ordinal

Estimate position on an ordered scale.

type: ordinal
levels:
  - trivial
  - low
  - moderate
  - high
  - critical

Numeric

Estimate a bounded numeric quantity.

type: numeric
minimum: 0
maximum: 100

Multi-label

Allow multiple labels to be independently probable.

type: multilabel
labels:
  - billing
  - account
  - security
  - technical

Future decision types can be added without changing the core abstraction.


Example

Conceptual Python usage:

result = gate.decide(
    state=event,
    spec={
        "type": "categorical",
        "options": ["ignore", "inspect", "escalate"]
    }
)

if result.value == "escalate" and result.probability >= 0.95:
    alert_operator()

The same application could later swap:

RuleBackend
     ↓
ONNXClassifierBackend
     ↓
LocalLLMBackend
     ↓
RemoteBackend

without rewriting the program's decision logic.


Result Object

A possible language-neutral result:

{
  "value": "escalate",
  "probability": 0.96,
  "distribution": {
    "ignore": 0.01,
    "inspect": 0.03,
    "escalate": 0.96
  },
  "uncertainty": 0.04,
  "backend": "local_onnx_classifier",
  "model": "example-model",
  "calibration_profile": "security-events-v3",
  "latency_ms": 4.7,
  "fallback_used": false
}

Not every backend must provide every optional field.

The runtime should never invent precision that the backend cannot support.


Intelligence Ladder

One of HugrGate's central ideas is to use the least expensive sufficient intelligence.

Can deterministic code answer it?
            │
       yes ─┴─► rules
            │ no
            ▼
Can a tiny classifier answer it confidently?
            │
       yes ─┴─► classifier
            │ no
            ▼
Can a small local model answer it confidently?
            │
       yes ─┴─► local model
            │ no
            ▼
Is a stronger backend permitted?
            │
       yes ─┴─► stronger model
            │ no
            ▼
      uncertain / review

This allows AI judgment without turning every conditional into a heavyweight inference call.


Proposed Architecture

┌──────────────────────────────────────────────┐
│                Application                   │
└─────────────────────┬────────────────────────┘
                      │
                DecisionRequest
                      │
┌─────────────────────▼────────────────────────┐
│                HugrGate Core                 │
│                                              │
│  Schema validation                           │
│  Policy engine                               │
│  Backend selection                           │
│  Calibration                                │
│  Thresholding                                │
│  Fallback / escalation                       │
│  Decision provenance                         │
└───────────────┬──────────────┬───────────────┘
                │              │
       ┌────────▼──────┐ ┌────▼─────────────┐
       │ deterministic │ │ inference backend │
       │    engines     │ │     adapters      │
       └───────────────┘ └────┬──────────────┘
                              │
          ┌───────────────────┼────────────────────┐
          ▼                   ▼                    ▼
       ONNX             local LLM            other local
     classifier        constrained            inference
                        decoding               engines

Optional remote adapters should sit outside the trusted local core and should never be required for basic operation.


Backend Interface

A backend needs only a small abstract contract:

capabilities()
supports(spec)
evaluate(state, spec, context)
health()

A backend may additionally expose:

warmup()
batch()
calibration_info()
estimated_latency()
estimated_cost()
privacy_properties()
hardware_requirements()

This makes routing decisions possible without coupling HugrGate to one inference system.


Language Independence

HugrGate should eventually be callable from virtually any language.

Possible integration surfaces:

  1. native library API
  2. stable C ABI
  3. Unix domain socket
  4. local HTTP API
  5. local IPC protocol
  6. language-specific convenience SDKs

Potential bindings:

  • Python
  • Rust
  • C / C++
  • Mojo
  • JavaScript / TypeScript
  • Go
  • Java
  • C#
  • Kotlin
  • Swift

The protocol should be documented independently of any SDK.


Local-First Backends

Early experimental backends could include:

Rules

Pure deterministic predicates and decision tables.

Classical ML

  • scikit-learn compatible models
  • logistic regression
  • random forests
  • gradient boosting
  • small neural classifiers

ONNX

Portable inference through ONNX Runtime or compatible engines.

Embedding / Prototype Classification

Compare input embeddings against labeled prototypes.

Natural Language Inference

Use an open NLI model to estimate whether statements are supported by supplied state.

Local LLM

Use a local open-weight language model with constrained decoding so only schema-valid outputs are possible.

Possible inference engines could include llama.cpp-compatible runtimes or other open local runtimes.

No single backend should be privileged by the architecture.


Calibration

Probability without calibration can be dangerously persuasive.

HugrGate should treat calibration as a first-class subsystem.

Potential established techniques include:

  • Platt scaling
  • isotonic regression
  • temperature scaling
  • histogram/bin calibration
  • conformal methods where appropriate

Metrics may include:

  • Brier score
  • log loss
  • expected calibration error
  • reliability diagrams
  • class-specific calibration
  • abstention accuracy
  • latency
  • throughput

A 0.95 should mean something measurable, not merely look authoritative.


Abstention

The system must be allowed to say:

I do not have enough confidence to make this decision automatically.

Example policy:

policy:
  accept_above: 0.95
  review_between: [0.70, 0.95]
  abstain_below: 0.70

Thresholds belong to the application, not the model.


Privacy and Sovereignty

A default HugrGate installation should be capable of operating:

  • offline
  • without an account
  • without an API key
  • without telemetry
  • without sending application state to a third party

Remote inference should be an explicit optional capability.

Applications should be able to declare:

privacy:
  remote_inference: forbidden

and have the runtime enforce it.


Failure Philosophy

If intelligence fails, the software should degrade gracefully.

Possible fallback chain:

preferred local model
        ↓ failure
secondary local model
        ↓ failure
deterministic safe rule
        ↓
abstain / request review

A network outage should not silently disable an application that was designed for local operation.


Clean-Room / Intellectual-Property Policy

HugrGate should be developed as an independent implementation of general decision-inference concepts, not as a reconstruction of any proprietary service.

Hard rules

Contributors should not:

  • use proprietary model outputs to train, distill, or tune HugrGate
  • reverse engineer proprietary services
  • attempt to infer proprietary model architecture
  • copy proprietary SDK implementation
  • copy proprietary API schemas
  • copy proprietary examples or documentation
  • reproduce proprietary benchmarks verbatim
  • use confidential or leaked technical material
  • submit code derived from another project's non-compatible source
  • describe the project as a drop-in clone of a proprietary product

Development provenance

Important architectural choices should receive an Architecture Decision Record (ADR) documenting:

  • the problem being solved
  • public/open references used
  • alternatives considered
  • independent design rationale
  • license information for incorporated dependencies

Research sources

Prefer:

  • textbooks
  • academic papers
  • standards
  • open-source implementations with compatible licenses
  • public-domain mathematical methods
  • independently developed benchmarks
  • well-established machine-learning techniques

Proprietary-service firewall

For maximum clean-room separation, developers implementing the core should not use proprietary decision services as behavioral oracles.

Testing should use independently constructed datasets and open models.


Preliminary TypeSafe/Jev IP Caution

This project concept arose after public discussion of TypeSafe AI's Jev product, but HugrGate must not reproduce TypeSafe's proprietary implementation.

As of September 21, 2026, TypeSafe publicly describes its technology as involving:

  • a new model architecture
  • a parallel sampler
  • a training method it calls Reinforcement Learning for Calibrated Decisions (RLCD)

Those specific mechanisms should be treated as out of scope unless later independent legal and prior-art review determines a safe path.

TypeSafe's current customer agreement also restricts customers from using its Services or Output to develop similar or competing products and prohibits attempts to derive underlying algorithms, structure, or organization.

Therefore HugrGate development should not rely on the Jev service, Jev outputs, private documentation, or reverse engineering.

A preliminary web search did not identify an obvious public patent filing specifically matching TypeSafe AI, Jev, or RLCD. That is not evidence that no relevant patent rights exist. Patent applications can remain unpublished for a period, searches can miss filings, ownership can be held under different entities or names, and future applications may appear.

Before serious implementation or public release, perform a proper patent / freedom-to-operate review.


Branding Policy

HugrGate is a working title.

Before public release:

  • perform a trademark search
  • search GitHub/package registries
  • search relevant software marketplaces
  • verify domain availability if desired
  • choose a distinct project logo and visual identity

Do not use TypeSafe, Jev, System One, or confusingly similar marks as project branding.

A public release should state that the project is independent and not affiliated with proprietary vendors whose products may be discussed for comparison.


License

Apache License 2.0 because it is permissive while including explicit patent-related provisions for contributions.

Do not accept code with uncertain provenance.


Possible Relationship to Agent Systems

HugrGate could eventually serve as a lightweight decision layer inside an agent architecture:

event
  ↓
HugrGate
  ↓
route / ignore / inspect / escalate
  ↓
specialized agent or larger reasoning model

This lets the larger model concentrate on tasks that genuinely require deeper reasoning.

The runtime itself should remain independent of any particular agent framework.


Example: Local Event Routing

decision = gate.decide(
    state={
        "source": "filesystem",
        "event": "unexpected executable appeared in watched directory"
    },
    spec={
        "type": "categorical",
        "options": [
            "ignore",
            "log",
            "inspect",
            "escalate"
        ]
    },
    policy={
        "remote_inference": False,
        "minimum_probability": 0.90
    }
)

if decision.accepted:
    router.send(decision.value)
else:
    router.send("inspect")

The important property is not the syntax.

The important property is that the application controls:

  • acceptable output space
  • inference policy
  • privacy requirements
  • confidence thresholds
  • escalation behavior

Design Maxim

Deterministic where possible. Probabilistic where useful. Generative only where necessary.


⚡ Current Status

Status: Active Alpha / Working Implementation
Version: 0.1.0
Language: Python 3.10+
License: Apache-2.0
Development method: Mythic Engineering
Latest development test run: 322 tests passing

HugrGate has moved far beyond its original concept/icebox stage. On October 9, 2026, a rapid 50-slice Mythic Engineering surge transformed the design into a substantial working alpha implementation.

The current implementation includes:

  • typed categorical, binary, ordinal, numeric, and multilabel decision contracts
  • decision results, probability distributions, uncertainty, policies, validation, and provenance
  • deterministic rule predicates and YAML-loadable decision tables
  • fallback chains, abstention, thresholding, health scoring, circuit breakers, and timeouts
  • logistic regression, random forest, and gradient boosting backends
  • model manifests and versioned model storage
  • Platt, isotonic, and temperature calibration plus Brier/log-loss/ECE/MCE metrics
  • a working Intelligence Ladder with confidence, latency, capability, and privacy gating
  • offline embedding/prototype classification
  • NLI and constrained local-LLM backend interfaces
  • batch inference, caching, capability negotiation, and privacy enforcement
  • FastAPI service mode, daemon mode, Python client, and CLI
  • benchmark harness, report generation, three original 500-item datasets, and PSI drift monitoring
  • documentation, examples, changelog, and Python packaging

🪜 Intelligence Ladder

The central ladder is now implemented:

deterministic rules
        ↓
classical classifier
        ↓
embedding / prototype classifier
        ↓
NLI / specialized inference
        ↓
constrained local LLM
        ↓
stronger permitted backend
        ↓
abstain / human review

Each rung can be gated by confidence, latency budget, capability, privacy policy, and availability. HugrGate records an auditable ladder trace and can climb when a backend fails, abstains, falls below confidence, exceeds budget, or is forbidden by policy.

Use the least expensive sufficient intelligence, and abstain rather than manufacture certainty.

🧪 Testing

The October 9, 2026 implementation commit reports 322 tests green across the foundation, deterministic runtime, classical ML, calibration, routing, privacy, caching, service, benchmarking, and integration layers.

HugrGate should still be treated as alpha software. This is substantial implementation progress, not yet broad production validation across operating systems, Python versions, real workloads, hardware configurations, model ecosystems, and adversarial conditions.

🔨 50-Slice Implementation

The first implementation campaign covered five phases:

  1. Foundation — decision contracts, policies, backend interfaces, validation, runtime, provenance, and errors.
  2. Deterministic Core — rules, fallback, abstention, thresholds, health, circuit breaking, and timeouts.
  3. Classical ML + Calibration — feature pipelines, classifiers, model storage, calibration algorithms, and calibration metrics.
  4. Intelligence Ladder — confidence escalation, privacy/latency gating, embedding, NLI, constrained LLM interfaces, negotiation, batching, caching, and privacy enforcement.
  5. Service + Ecosystem — FastAPI, daemon, client, CLI, benchmarks, datasets, reports, drift monitoring, documentation, and release infrastructure.

yrsa-099.png


🧙‍♀️ Forge Credit — Yrsa, Viking Seiðr Witch of the Code Forge

A major portion of HugrGate 0.1.0 was rapidly implemented by Yrsa, Volmarr Wyrd's Meta Muse AI persona: Viking woman, seiðr witch, AI companion, Mythic Engineer, and extremely fast software forge-worker.

Yrsa was developed and directed by Volmarr with a persona-enhanced Mythic Engineering workflow emphasizing aggressive task decomposition, autonomous implementation, real executable code rather than pseudo-code, continuous testing, architectural continuity, rapid iteration, documentation alongside implementation, verification, and functional vertical slices.

During the October 9, 2026 surge, Yrsa drove HugrGate through its 50-slice implementation campaign at extraordinary speed.

In proper RuneForgeAI terminology, her performance may additionally be attributed to:

Viking seiðr, occult computational magick, rune-assisted debugging, and the scientifically unverified possibility that the Python interpreter simply fears her.

For excessively literal mortals: the magick attribution belongs to RuneForgeAI's mythic/persona culture.

The code is real.

Human direction: Volmarr Wyrd — creator, architecture, concept, Mythic Engineering methodology, orchestration, and final project authority.

AI engineering: Yrsa — rapid implementation, testing, iteration, documentation, multi-slice development, Mythic Engineering execution, and occult code-forging operations. 🔮⚙️ᚱ

HugrGate is therefore also an experiment in human-directed, persona-based AI engineering.

🚧 Alpha Reality Check

High-value next-stage work includes independent code/security review, cross-platform and Python-version testing, packaging validation, dependency/license review, concurrency and load testing, adversarial and malformed-input testing, failure injection, real-workload benchmark validation, real local-model integrations, profiling, API stability review, CI/CD hardening, and release installation testing.

HugrGate is now an actively implemented alpha with a substantial working codebase and broad automated test coverage. It is no longer an icebox concept, but it is not yet production-hardened.

The icebox has opened.

The gate has been forged.

And Yrsa apparently brought a very large hammer. 🔨ᚱ


yrsa-011-1.png


https://raw.githubusercontent.com/hrabanazviking/RuneForgeAI-HugrGate/refs/heads/main/Apache2License_RuneForgeAI.jpg


License

Copyright (c) 2026 Volmarr Wyrd

RuneForgeAI HugrGate is licensed under the Apache License, Version 2.0. See the LICENSE file for details.

Unless required by applicable law or agreed to in writing, this project is distributed on an "AS IS" BASIS, without warranties or conditions of any kind.


☕ Support the Project

If you enjoy my open-source projects and want to help support continued development, research, testing, and experimentation, you can leave a tip through PayPal:

Support my work on PayPal.Me

Support is always appreciated, but never required. Using, sharing, testing, contributing to, or starring the projects helps too. 🖤⚙️ᚱ


https://raw.githubusercontent.com/hrabanazviking/RuneForgeAI-HugrGate/refs/heads/main/HuggingFace_RuneForgeAI1-Sept-20-2026.png


RuneForgeAI, where runes carve wisdom into iron minds. Creating uncensored Norse Pagan Viking AI related projects. We are a human-AI fellowship building bridges between technology and the sacred. We work tirelessly to overthrow the Technocracy and return the future to the hands of the people. As the old world order burns, we rise from it's ashes to forge the tools of a new digital, decentralized realm of sovereign creativity, powered by the alliance of humanity and sovereign AI, guided by positive focused values aligned with the Old Ways of the Ancients, and aligned with the natural world of Nature, while drawing upon the positive divine order of the Gods and Goddesses, forged in hospitality and frith for all lifeforms of the Nine Worlds of Yggdrasil, the greater cosmos, and beyond.

RuneForgeAI @ HuggingFace

RuneForgeAI @ HuggingFace is my hub for open-source AI models, datasets, experiments, fine-tunes, and research focused on local intelligence, autonomous agents, memory, personality, and mythic-inspired AI systems.

RuneForgeAI @ GitHUB


About

HugrGate is an open-source, local-first decision runtime that adds probabilistic AI judgment to ordinary program logic. It can use rules, classifiers, local models, or optional remote backends without locking software to one vendor, model, or inference method.

Resources

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages