interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / crates / aienos-infer / src / lib.rs

51 lines · 1863 bytes Raw Blame History
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
33extern crate alloc;
34#[cfg(test)]
35extern crate std;
36
37pub mod decode;
38#[allow(unsafe_code)] // the only unsafe in this crate: SDOT intrinsics behind a capability token
39pub mod dotprod;
40pub mod gguf;
41pub mod half;
42pub mod math;
43pub mod model;
44pub mod quant;
45pub mod tokenizer;
46
47pub use decode::{argmax, generate_greedy, DecodeState};
48pub use dotprod::{cpu_dotprod, set_cpu_dotprod, DotProd, Q8Act};
49pub use gguf::{ArrayView, GgmlType, Gguf, GgufError, TensorInfo, Value, ValueType};
50pub use model::{InferError, Model};
51pub use tokenizer::Tokenizer;