Universal Love & Non-Aggression Inference Platform
Authors/Creators
Description
The JianAi Platform is a production-grade AI inference service platform implemented in Rust, spanning five thousand six hundred seventy-seven lines of code. It uniquely embeds Mohist philosophical nomenclature into its technical architecture, treating every component name as a living design contract that collapses the barrier between documentation and source code.
The system centers on a three-tier cache hierarchy named after the Four Symbols. ZhuQue serves as the L1 in-memory hot cache powered by Moka W-TinyLFU eviction, delivering sub-millisecond latency. XuanWu acts as the L2 RocksDB warm cache built on LSM-tree structured storage with dual compression. QingLong functions as the optional L3 S3 cold cache for deep archival. JiGuanCheng orchestrates automatic backfill across all tiers and handles model-scoped batch eviction.
Resilience is enforced by the JianAi stack, which combines three independent defensive lines. FeiGong is a lock-free circuit breaker using pure atomic operations with a three-state machine and compare-exchange state transitions. ShangTong is a request deduplicator that elects one Leader to execute real work while Followers await broadcast results via DashMap and broadcast channels. JieYong is a token-bucket rate limiter based on Tokio Semaphore, coupled with capped exponential backoff and jittered retry logic.
Observability is delivered through TianZhi, a Prometheus metrics registry covering thirty-plus dimensions across cache, inference, circuit breaker, and RPC health. MingGui performs eight-dimensional parallel health checks producing Healthy, Degraded, or Unhealthy composite status. ShangXian operates as an analytics engine that evaluates seven individual failure nodes plus four composite scenarios such as cache thrashing and cascading failure, outputting actionable recommendations with severity levels. The system also auto-generates Grafana dashboard JSON and thirteen production-grade PrometheusRule alerts.
The platform exposes HTTP REST via Axum and gRPC via Tonic as a dual-stack service layer, protected by TraceLayer, CompressionLayer, and CorsLayer middleware. It implements graceful shutdown through SIGTERM and SIGINT signal handlers with CancellationToken propagation, ensuring all in-flight requests complete before exit. The codebase maintains zero unsafe code except controlled slice reinterpretation with strict alignment validation, and all shared state satisfies static lifetime constraints.
Beyond core inference acceleration, the system includes the JiZhong and JiFa skill seed subsystem purpose-built for embodied intelligence. JiZhong stores compact unexpanded skill descriptors while JiFa represents fully expanded runtime skills with JSON parameters and runtime handles. This enables cross-entity skill transfer across a global robot fleet via S3, with semver versioning and SHA-256 checksums providing rollback-capable version control for progressive reinforcement learning. The entire system has been verified via release compilation on Android Termux ARM architecture in six minutes and nineteen seconds with zero compilation errors, proving robust deployment capability from embedded devices to datacenter tiers.
Files
Files
(163.3 kB)
| Name | Size | |
|---|---|---|
|
md5:3d20ff86956ae50c063bb762d8d32de0
|
163.3 kB | Download |