facet-standard  by rokoss21

Deterministic AI execution and tool-calling contracts

Created 5 months ago
320 stars

Top 84.5% on SourcePulse

GitHubView on GitHub
Project Summary

FACET provides a deterministic contract layer for AI systems, addressing common failures in tool-calling and context management by treating AI behavior like compiled software. It targets engineers and researchers seeking reliable, predictable AI execution, offering benefits such as eliminating runtime failures and enforcing strict protocols across different AI providers.

How It Works

FACET operates as a Neural Architecture Description Language (NADL) and contract system. It parses .facet documents into a strict Abstract Syntax Tree (AST), validates them using a Facet Type System (FTS), and executes variables via a deterministic Reactive DAG (R-DAG). Context is managed deterministically through the Token Box Model, and provider-specific outputs are rendered from a canonical JSON model. This contract-first approach enforces constraints before generation, ensuring validity rather than relying on post-hoc corrections or prompt engineering.

Quick Start & Requirements

The core of FACET is its specification, with the current production standard being v2.1.3 (SPECIFICATION.md). A reference compiler implementation is available in Rust at https://github.com/rokoss21/facet-compiler. Installation details for specific language bindings or adapters are not provided in the README, as the focus is on the standard itself. Links to previous specification versions (archive/facet-v2.1.2.md, archive/facet-v2.0-cr1.md) are available.

Highlighted Details

  • Deterministic Tool-Calling: Eliminates unreliable tool invocation by enforcing strict schemas, parameter types, and provider-specific constraints at compile time, preventing common failures like missing parameters or schema drift.
  • Resource-Bounded Context: The Token Box Model ensures deterministic context packing, compression, and allocation, guaranteeing that critical information is preserved and context handling is reproducible.
  • Reproducible Agents: The R-DAG enforces a deterministic execution flow for multi-step workflows, preventing cycles and forward references to ensure stable and replayable agent behavior.
  • Contract-First Enforcement: Treats AI interactions as compiled software, using compilation, typing, and canonicalization to enforce contracts rather than relying on best-effort structured output or runtime retries.

Maintenance & Community

FACET is authored by Emil Rokosssovskiy (rokoss21), with a website at https://rokoss21.tech and primary code hosted on GitHub (https://github.com/rokoss21). The README does not detail specific community channels (like Discord/Slack) or a public roadmap.

Licensing & Compatibility

The project and its accompanying materials are released under the MIT License. This license permits free use, modification, distribution, and commercial adoption, provided proper attribution is maintained.

Limitations & Caveats

The specification is designated as "REC-PROD" (Recommendation for Production), indicating a stable release. The primary reference implementation is in Rust, which may require integration effort for teams not using Rust. Adapters for specific AI providers are planned for future development.

Health Check
Last Commit

3 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
374 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.