aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / crates / aienos-infer / src / lib.rs
| 1 | #![no_std] |
| 2 | // SPDX-License-Identifier: Apache-2.0 |
| 3 | // Copyright 2026 Drake Stapleton (AIEN / aien-dev) |
| 4 | // |
| 5 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | // you may not use this file except in compliance with the License. |
| 7 | // You may obtain a copy of the License at |
| 8 | // |
| 9 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | // |
| 11 | // Unless required by applicable law or agreed to in writing, software |
| 12 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | // See the License for the specific language governing permissions and |
| 15 | // limitations under the License. |
| 16 | #![deny(unsafe_code)] |
| 17 | // Block loops mirror ggml index arithmetic; as_chunks/is_multiple_of are too |
| 18 | // new for this workspace to rely on. |
| 19 | #![allow( |
| 20 | clippy::needless_range_loop, |
| 21 | clippy::chunks_exact_to_as_chunks, |
| 22 | clippy::manual_is_multiple_of |
| 23 | )] |
| 24 | |
| 25 | //! Native inference ingestion (aienos#34 lane 1): a bounded GGUF v3 reader |
| 26 | //! and the ggml block dequantizers (Q4_K, Q6_K and the plain float types) |
| 27 | //! needed to load Llama-3.2-1B-Instruct-Q4_K_M. |
| 28 | //! |
| 29 | //! Everything works on a `&[u8]` slice. Every read is length checked and |
| 30 | //! hostile input yields a [`GgufError`], never a panic. Dequantizers are |
| 31 | //! scalar and written for correctness first. |
| 32 | |
| 33 | extern crate alloc; |
| 34 | #[cfg(test)] |
| 35 | extern crate std; |
| 36 | |
| 37 | pub mod decode; |
| 38 | #[allow(unsafe_code)] // the only unsafe in this crate: SDOT intrinsics behind a capability token |
| 39 | pub mod dotprod; |
| 40 | pub mod gguf; |
| 41 | pub mod half; |
| 42 | pub mod math; |
| 43 | pub mod model; |
| 44 | pub mod quant; |
| 45 | pub mod tokenizer; |
| 46 | |
| 47 | pub use decode::{argmax, generate_greedy, DecodeState}; |
| 48 | pub use dotprod::{cpu_dotprod, set_cpu_dotprod, DotProd, Q8Act}; |
| 49 | pub use gguf::{ArrayView, GgmlType, Gguf, GgufError, TensorInfo, Value, ValueType}; |
| 50 | pub use model::{InferError, Model}; |
| 51 | pub use tokenizer::Tokenizer; |