[package]
edition = "2021"
rust-version = "1.70"
name = "aprender"
version = "0.25.1"
authors = ["Noah Gift <noah@paiml.com>"]
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Next-generation machine learning library in pure Rust"
documentation = "https://docs.rs/aprender"
readme = "README.md"
keywords = [
"machine-learning",
"classification",
"clustering",
"statistics",
"graph-algorithms",
]
categories = [
"science",
"algorithms",
]
license = "MIT"
repository = "https://github.com/paiml/aprender"
[features]
audio = [
"rustfft",
"thiserror",
]
audio-alsa = [
"audio-capture",
"alsa",
]
audio-capture = ["audio"]
audio-codec = ["audio"]
audio-coreaudio = ["audio-capture"]
audio-noise = ["audio"]
audio-noise-wasm = [
"audio-noise",
"wasm-bindgen",
"js-sys",
]
audio-playback = ["audio"]
audio-wasapi = ["audio-capture"]
audio-webaudio = ["audio-capture"]
chaos-basic = []
chaos-byzantine = ["chaos-basic"]
chaos-full = [
"chaos-network",
"chaos-byzantine",
]
chaos-network = ["chaos-basic"]
cpu-only = []
cuda = ["trueno/cuda-monitor"]
datasets = ["alimentar"]
default = ["parallel"]
format-compression = [
"lz4_flex",
"zstd",
]
format-encryption = [
"aes-gcm",
"argon2",
"x25519-dalek",
"hkdf",
"sha2",
]
format-homomorphic = []
format-quantize = ["half"]
format-signing = ["ed25519-dalek"]
gpu = ["trueno/gpu"]
hf-hub-integration = [
"hf-hub",
"dirs",
"ureq",
"sha2",
]
inference-monitoring = ["entrenar"]
parallel = ["rayon"]
rag = ["trueno-rag"]
safetensors-compare = [
"safetensors",
"hf-hub-integration",
"half",
]
showcase-profile = ["renacer"]
showcase-zram = ["trueno-zram-core"]
[lib]
name = "aprender"
path = "src/lib.rs"
[[example]]
name = "aco_tsp"
path = "examples/aco_tsp.rs"
[[example]]
name = "admm_optimization"
path = "examples/admm_optimization.rs"
[[example]]
name = "apr_cache"
path = "examples/apr_cache.rs"
[[example]]
name = "apr_cli_commands"
path = "examples/apr_cli_commands.rs"
[[example]]
name = "apr_embed"
path = "examples/apr_embed.rs"
[[example]]
name = "apr_inspection"
path = "examples/apr_inspection.rs"
[[example]]
name = "apr_loading_modes"
path = "examples/apr_loading_modes.rs"
[[example]]
name = "apr_scoring"
path = "examples/apr_scoring.rs"
[[example]]
name = "apr_with_metadata"
path = "examples/apr_with_metadata.rs"
[[example]]
name = "automl_clustering"
path = "examples/automl_clustering.rs"
[[example]]
name = "batch_optimization"
path = "examples/batch_optimization.rs"
[[example]]
name = "bayesian_blocks_histogram"
path = "examples/bayesian_blocks_histogram.rs"
[[example]]
name = "bayesian_linear_regression"
path = "examples/bayesian_linear_regression.rs"
[[example]]
name = "bayesian_logistic_regression"
path = "examples/bayesian_logistic_regression.rs"
[[example]]
name = "bench_comparison"
path = "examples/bench_comparison.rs"
[[example]]
name = "beta_binomial_inference"
path = "examples/beta_binomial_inference.rs"
[[example]]
name = "boston_housing"
path = "examples/boston_housing.rs"
[[example]]
name = "bundle_trace_demo"
path = "examples/bundle_trace_demo.rs"
[[example]]
name = "chat_template"
path = "examples/chat_template.rs"
[[example]]
name = "classification_training"
path = "examples/classification_training.rs"
[[example]]
name = "code_analysis"
path = "examples/code_analysis.rs"
[[example]]
name = "community_detection"
path = "examples/community_detection.rs"
[[example]]
name = "constrained_optimization"
path = "examples/constrained_optimization.rs"
[[example]]
name = "convex_optimization"
path = "examples/convex_optimization.rs"
[[example]]
name = "create_test_apr"
path = "examples/create_test_apr.rs"
[[example]]
name = "create_test_transformer_apr"
path = "examples/create_test_transformer_apr.rs"
[[example]]
name = "cross_validation"
path = "examples/cross_validation.rs"
[[example]]
name = "cuda_backend"
path = "examples/cuda_backend.rs"
[[example]]
name = "data_preprocessing_scalers"
path = "examples/data_preprocessing_scalers.rs"
[[example]]
name = "dataframe_basics"
path = "examples/dataframe_basics.rs"
[[example]]
name = "dbscan_clustering"
path = "examples/dbscan_clustering.rs"
[[example]]
name = "decision_tree_iris"
path = "examples/decision_tree_iris.rs"
[[example]]
name = "decision_tree_regression"
path = "examples/decision_tree_regression.rs"
[[example]]
name = "descriptive_statistics"
path = "examples/descriptive_statistics.rs"
[[example]]
name = "dirichlet_multinomial_inference"
path = "examples/dirichlet_multinomial_inference.rs"
[[example]]
name = "gamma_poisson_inference"
path = "examples/gamma_poisson_inference.rs"
[[example]]
name = "gbm_iris"
path = "examples/gbm_iris.rs"
[[example]]
name = "gmm_clustering"
path = "examples/gmm_clustering.rs"
[[example]]
name = "graph_algorithms_comprehensive"
path = "examples/graph_algorithms_comprehensive.rs"
[[example]]
name = "graph_social_network"
path = "examples/graph_social_network.rs"
[[example]]
name = "grid_search_tuning"
path = "examples/grid_search_tuning.rs"
[[example]]
name = "hierarchical_clustering"
path = "examples/hierarchical_clustering.rs"
[[example]]
name = "iris_clustering"
path = "examples/iris_clustering.rs"
[[example]]
name = "isolation_forest_anomaly"
path = "examples/isolation_forest_anomaly.rs"
[[example]]
name = "knn_iris"
path = "examples/knn_iris.rs"
[[example]]
name = "lof_anomaly"
path = "examples/lof_anomaly.rs"
[[example]]
name = "logic_family_tree"
path = "examples/logic_family_tree.rs"
[[example]]
name = "logistic_regression"
path = "examples/logistic_regression.rs"
[[example]]
name = "lottery_ticket_pruning"
path = "examples/lottery_ticket_pruning.rs"
[[example]]
name = "market_basket_apriori"
path = "examples/market_basket_apriori.rs"
[[example]]
name = "mem_test"
path = "examples/mem_test.rs"
[[example]]
name = "mem_test_full"
path = "examples/mem_test_full.rs"
[[example]]
name = "metaheuristics_optimization"
path = "examples/metaheuristics_optimization.rs"
[[example]]
name = "mixture_of_experts"
path = "examples/mixture_of_experts.rs"
[[example]]
name = "model_serialization"
path = "examples/model_serialization.rs"
[[example]]
name = "model_zoo"
path = "examples/model_zoo.rs"
[[example]]
name = "naive_bayes_iris"
path = "examples/naive_bayes_iris.rs"
[[example]]
name = "negative_binomial_glm"
path = "examples/negative_binomial_glm.rs"
[[example]]
name = "neural_network_training"
path = "examples/neural_network_training.rs"
[[example]]
name = "nlp_advanced"
path = "examples/nlp_advanced.rs"
[[example]]
name = "normal_inverse_gamma_inference"
path = "examples/normal_inverse_gamma_inference.rs"
[[example]]
name = "online_learning"
path = "examples/online_learning.rs"
[[example]]
name = "optimizer_demo"
path = "examples/optimizer_demo.rs"
[[example]]
name = "pca_iris"
path = "examples/pca_iris.rs"
[[example]]
name = "phi_hf_import"
path = "examples/phi_hf_import.rs"
[[example]]
name = "pipeline_verification"
path = "examples/pipeline_verification.rs"
[[example]]
name = "poka_yoke_validation"
path = "examples/poka_yoke_validation.rs"
[[example]]
name = "predator_prey_optimization"
path = "examples/predator_prey_optimization.rs"
[[example]]
name = "pruning_magnitude"
path = "examples/pruning_magnitude.rs"
[[example]]
name = "qa_chat"
path = "examples/qa_chat.rs"
[[example]]
name = "qa_falsify"
path = "examples/qa_falsify.rs"
[[example]]
name = "qa_run"
path = "examples/qa_run.rs"
[[example]]
name = "qa_serve"
path = "examples/qa_serve.rs"
[[example]]
name = "qa_verify"
path = "examples/qa_verify.rs"
[[example]]
name = "qwen_apr_native"
path = "examples/qwen_apr_native.rs"
[[example]]
name = "qwen_chat"
path = "examples/qwen_chat.rs"
[[example]]
name = "qwen_inference"
path = "examples/qwen_inference.rs"
[[example]]
name = "random_forest_iris"
path = "examples/random_forest_iris.rs"
[[example]]
name = "random_forest_regression"
path = "examples/random_forest_regression.rs"
[[example]]
name = "recommend_content"
path = "examples/recommend_content.rs"
[[example]]
name = "regularized_regression"
path = "examples/regularized_regression.rs"
[[example]]
name = "rosetta_stone"
path = "examples/rosetta_stone.rs"
[[example]]
name = "shell_encryption_demo"
path = "examples/shell_encryption_demo.rs"
required-features = ["format-encryption"]
[[example]]
name = "shell_model_format"
path = "examples/shell_model_format.rs"
[[example]]
name = "showcase_benchmark"
path = "examples/showcase_benchmark.rs"
[[example]]
name = "sovereign_offline"
path = "examples/sovereign_offline.rs"
[[example]]
name = "sovereign_stack"
path = "examples/sovereign_stack.rs"
[[example]]
name = "spectral_clustering"
path = "examples/spectral_clustering.rs"
[[example]]
name = "svm_iris"
path = "examples/svm_iris.rs"
[[example]]
name = "synthetic_data_generation"
path = "examples/synthetic_data_generation.rs"
[[example]]
name = "tabu_tsp"
path = "examples/tabu_tsp.rs"
[[example]]
name = "text_classification"
path = "examples/text_classification.rs"
[[example]]
name = "text_preprocessing"
path = "examples/text_preprocessing.rs"
[[example]]
name = "time_series_forecasting"
path = "examples/time_series_forecasting.rs"
[[example]]
name = "topic_sentiment_analysis"
path = "examples/topic_sentiment_analysis.rs"
[[example]]
name = "trueno_compute_integration"
path = "examples/trueno_compute_integration.rs"
[[example]]
name = "tsne_visualization"
path = "examples/tsne_visualization.rs"
[[example]]
name = "whisper_transcribe"
path = "examples/whisper_transcribe.rs"
[[example]]
name = "xor_training"
path = "examples/xor_training.rs"
[[test]]
name = "benchmark_parity_apr"
path = "tests/benchmark_parity_apr.rs"
[[test]]
name = "book"
path = "tests/book/mod.rs"
[[test]]
name = "chaos_tests"
path = "tests/chaos_tests.rs"
[[test]]
name = "chat_template_probar_testing"
path = "tests/chat_template_probar_testing.rs"
[[test]]
name = "chat_template_tests"
path = "tests/chat_template_tests.rs"
[[test]]
name = "falsification_2x_ollama_tests"
path = "tests/falsification_2x_ollama_tests.rs"
[[test]]
name = "falsification_brick_tests"
path = "tests/falsification_brick_tests.rs"
[[test]]
name = "falsification_budget_tests"
path = "tests/falsification_budget_tests.rs"
[[test]]
name = "falsification_correctness_tests"
path = "tests/falsification_correctness_tests.rs"
[[test]]
name = "falsification_cuda_tests"
path = "tests/falsification_cuda_tests.rs"
[[test]]
name = "falsification_measurement_tests"
path = "tests/falsification_measurement_tests.rs"
[[test]]
name = "falsification_performance_tests"
path = "tests/falsification_performance_tests.rs"
[[test]]
name = "falsification_real_profiling"
path = "tests/falsification_real_profiling.rs"
[[test]]
name = "format_parity_tests"
path = "tests/format_parity_tests.rs"
[[test]]
name = "github_issue_5_safetensors_tests"
path = "tests/github_issue_5_safetensors_tests.rs"
[[test]]
name = "github_issue_8_elasticnet_safetensors_tests"
path = "tests/github_issue_8_elasticnet_safetensors_tests.rs"
[[test]]
name = "github_issue_8_forest_safetensors_tests"
path = "tests/github_issue_8_forest_safetensors_tests.rs"
[[test]]
name = "github_issue_8_kmeans_safetensors_tests"
path = "tests/github_issue_8_kmeans_safetensors_tests.rs"
[[test]]
name = "github_issue_8_lasso_safetensors_tests"
path = "tests/github_issue_8_lasso_safetensors_tests.rs"
[[test]]
name = "github_issue_8_ridge_safetensors_tests"
path = "tests/github_issue_8_ridge_safetensors_tests.rs"
[[test]]
name = "github_issue_8_scaler_safetensors_tests"
path = "tests/github_issue_8_scaler_safetensors_tests.rs"
[[test]]
name = "github_issue_8_tree_safetensors_tests"
path = "tests/github_issue_8_tree_safetensors_tests.rs"
[[test]]
name = "integration"
path = "tests/integration.rs"
[[test]]
name = "mutation_testing_tests"
path = "tests/mutation_testing_tests.rs"
[[test]]
name = "parity_cross_format"
path = "tests/parity_cross_format.rs"
[[test]]
name = "property_tests"
path = "tests/property_tests.rs"
[[test]]
name = "qwen2_generation_tests"
path = "tests/qwen2_generation_tests.rs"
[[test]]
name = "qwen2_golden_trace_tests"
path = "tests/qwen2_golden_trace_tests.rs"
[[test]]
name = "qwen2_weight_loading_tests"
path = "tests/qwen2_weight_loading_tests.rs"
[[test]]
name = "realizar_integration_tests"
path = "tests/realizar_integration_tests.rs"
[[test]]
name = "rosetta_dangerous"
path = "tests/rosetta_dangerous.rs"
[[test]]
name = "spec_checklist_tests"
path = "tests/spec_checklist_tests.rs"
[[test]]
name = "synthetic_integration_tests"
path = "tests/synthetic_integration_tests.rs"
[[test]]
name = "tinyllama_generation_test"
path = "tests/tinyllama_generation_test.rs"
[[test]]
name = "toyota_principles_tests"
path = "tests/toyota_principles_tests.rs"
[[test]]
name = "verify_audio_checklist"
path = "tests/verify_audio_checklist.rs"
[[bench]]
name = "citl"
path = "benches/citl.rs"
harness = false
[[bench]]
name = "dataframe"
path = "benches/dataframe.rs"
harness = false
[[bench]]
name = "graph"
path = "benches/graph.rs"
harness = false
[[bench]]
name = "kmeans"
path = "benches/kmeans.rs"
harness = false
[[bench]]
name = "linear_regression"
path = "benches/linear_regression.rs"
harness = false
[[bench]]
name = "ollama_parity"
path = "benches/ollama_parity.rs"
harness = false
required-features = ["format-quantize"]
[[bench]]
name = "recommend"
path = "benches/recommend.rs"
harness = false
[dependencies.aes-gcm]
version = "0.10"
optional = true
[dependencies.alimentar]
version = "0.2.2"
optional = true
[dependencies.alsa]
version = "0.9"
optional = true
[dependencies.argon2]
version = "0.5"
features = ["std"]
optional = true
default-features = false
[dependencies.bincode]
version = "1.3"
[dependencies.dirs]
version = "6.0"
optional = true
[dependencies.ed25519-dalek]
version = "2.1"
features = [
"std",
"zeroize",
"rand_core",
]
optional = true
default-features = false
[dependencies.entrenar]
version = "0.5"
optional = true
[dependencies.half]
version = "2.4"
features = ["std"]
optional = true
default-features = false
[dependencies.hf-hub]
version = "0.4"
features = ["ureq"]
optional = true
default-features = false
[dependencies.hkdf]
version = "0.12"
optional = true
[dependencies.js-sys]
version = "0.3"
optional = true
[dependencies.lz4_flex]
version = "0.11"
optional = true
[dependencies.minijinja]
version = "2.14.0"
features = [
"loader",
"serde",
]
[dependencies.rand]
version = "0.8"
features = ["small_rng"]
[dependencies.rand_chacha]
version = "0.3"
[dependencies.rayon]
version = "1.10"
optional = true
[dependencies.renacer]
version = "0.9.1"
optional = true
[dependencies.rmp-serde]
version = "1.3"
[dependencies.rustfft]
version = "6.2"
optional = true
[dependencies.safetensors]
version = "0.4"
optional = true
[dependencies.serde]
version = "1.0"
features = ["derive"]
[dependencies.serde_json]
version = "1.0"
[dependencies.sha2]
version = "0.10"
optional = true
[dependencies.thiserror]
version = "2.0"
optional = true
[dependencies.trueno]
version = "0.14.3"
[dependencies.trueno-rag]
version = "0.1.10"
optional = true
[dependencies.trueno-zram-core]
version = "0.3.0"
optional = true
[dependencies.ureq]
version = "2.12"
features = ["json"]
optional = true
[dependencies.wasm-bindgen]
version = "0.2"
optional = true
[dependencies.x25519-dalek]
version = "2.0"
features = ["static_secrets"]
optional = true
default-features = false
[dependencies.zstd]
version = "0.13"
optional = true
[dev-dependencies.criterion]
version = "0.5"
[dev-dependencies.ctrlc]
version = "3.4"
[dev-dependencies.jugar-probar]
version = "0.5"
[dev-dependencies.proptest]
version = "1.6"
[dev-dependencies.renacer]
version = "0.9.1"
[dev-dependencies.tempfile]
version = "3.14"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.memmap2]
version = "0.9"
[target.'cfg(target_arch = "wasm32")'.dependencies.getrandom]
version = "0.2"
features = ["js"]
[lints.clippy]
approx_constant = "allow"
assertions_on_constants = "allow"
assigning_clones = "allow"
bool_to_int_with_if = "allow"
cast_lossless = "allow"
cast_possible_truncation = "allow"
cast_possible_wrap = "allow"
cast_precision_loss = "allow"
cast_sign_loss = "allow"
checked_conversions = "warn"
clone_on_copy = "allow"
cloned_instead_of_copied = "allow"
cloned_ref_to_slice_refs = "allow"
const_is_empty = "allow"
default_constructed_unit_structs = "allow"
default_trait_access = "allow"
derivable_impls = "allow"
doc_markdown = "allow"
erasing_op = "allow"
excessive_precision = "allow"
explicit_deref_methods = "warn"
explicit_iter_loop = "warn"
field_reassign_with_default = "allow"
float_cmp = "allow"
format_push_string = "allow"
identity_op = "allow"
if_not_else = "allow"
ignore_without_reason = "allow"
implicit_clone = "warn"
inconsistent_struct_constructor = "warn"
index_refutable_slice = "allow"
inefficient_to_string = "allow"
items_after_statements = "allow"
iter_cloned_collect = "allow"
large_stack_arrays = "allow"
len_zero = "allow"
manual_contains = "allow"
manual_let_else = "allow"
manual_ok_or = "warn"
manual_range_contains = "allow"
many_single_char_names = "allow"
map_unwrap_or = "allow"
match_same_arms = "allow"
match_wildcard_for_single_variants = "allow"
missing_const_for_fn = "allow"
missing_errors_doc = "allow"
missing_fields_in_debug = "allow"
missing_panics_doc = "allow"
module_name_repetitions = "allow"
must_use_candidate = "allow"
needless_borrows_for_generic_args = "allow"
needless_pass_by_value = "allow"
needless_range_loop = "allow"
needless_raw_string_hashes = "allow"
no_effect_underscore_binding = "allow"
nonminimal_bool = "allow"
overly_complex_bool_expr = "allow"
print_literal = "allow"
ptr_arg = "allow"
redundant_closure_for_method_calls = "allow"
redundant_guards = "allow"
return_self_not_must_use = "allow"
semicolon_if_nothing_returned = "allow"
similar_names = "allow"
single_char_pattern = "allow"
single_match_else = "allow"
stable_sort_primitive = "allow"
too_many_arguments = "allow"
too_many_lines = "allow"
trivially_copy_pass_by_ref = "allow"
type_complexity = "allow"
uninlined_format_args = "allow"
unnecessary_debug_formatting = "allow"
unnecessary_literal_bound = "allow"
unnecessary_literal_unwrap = "allow"
unnecessary_map_or = "allow"
unnecessary_wraps = "allow"
unnested_or_patterns = "warn"
unreadable_literal = "allow"
unused_self = "allow"
used_underscore_binding = "warn"
useless_vec = "allow"
vec_init_then_push = "allow"
[lints.clippy.all]
level = "warn"
priority = -1
[lints.clippy.pedantic]
level = "warn"
priority = -1
[lints.rust]
missing_debug_implementations = "warn"
missing_docs = "allow"
trivial_casts = "warn"
trivial_numeric_casts = "warn"
unreachable_pub = "warn"
unsafe_code = "deny"
unsafe_op_in_unsafe_fn = "warn"
unused_import_braces = "warn"
unused_lifetimes = "warn"
unused_qualifications = "allow"
[lints.rust.rust_2018_idioms]
level = "warn"
priority = -1
[profile.release]
lto = true
codegen-units = 1
debug = 2