--- warning: DO NOT CHANGE THIS MANUALLY, THIS IS GENERATED BY https://github.com/duckdb/community-extensions repository, check README there title: infera excerpt: | DuckDB Community Extensions A DuckDB extension for in-database inference extension: name: infera description: A DuckDB extension for in-database inference version: 0.5.0 language: Rust & C++ build: cmake license: MIT OR Apache-2.0 maintainers: - habedi excluded_platforms: "windows_amd64_mingw;osx_amd64;wasm_threads" requires_toolchains: rust repo: github: CogitatorTech/infera ref: d70d4f1f8df2a5aa76f2c68d0b4c4b719eb5a2ce docs: hello_world: | -- 0. Assuming the extension is already installed and loaded -- 1. Load a simple linear model from a remote URL SELECT infera_load_model('linear_model', 'https://github.com/CogitatorTech/infera/raw/refs/heads/main/test/models/linear.onnx'); -- 2. Run a prediction using a very simple linear model -- Model: y = 2*x1 - 1*x2 + 0.5*x3 + 0.25 SELECT infera_predict('linear_model', 1.0, 2.0, 3.0); -- Expected output: 1.75 -- 3. Unload the model when we're done with it SELECT infera_unload_model('linear_model'); -- 4. Check the Infera version SELECT infera_get_version(); extended_description: | Infera extension allows users to use machine learning models directly in SQL queries to perform inference on data stored in DuckDB tables. It is developed in Rust and uses [Tract](https://github.com/snipsco/tract) as the backend inference engine. Infera supports loading and running models in [ONNX](https://onnx.ai/) format. Check out the [ONNX Model Zoo](https://huggingface.co/onnxmodelzoo) repository on Hugging Face for a large collection of ready-to-use models that can be used with Infera. For more information, like API references and usage examples, visit the project's [GitHub repository](https://github.com/CogitatorTech/infera). extension_star_count: 137 extension_star_count_pretty: 137 extension_download_count: 899 extension_download_count_pretty: 899 image: '/images/community_extensions/social_preview/preview_community_extension_infera.png' layout: community_extension_doc --- ### Compatibility Matrix This table covers all DuckDB releases that have not reached [end-of-life](https://duckdb.org/release_calendar), including LTS releases, and shows the 2 most recent patch releases of each. Older patch releases are not listed, but the extension may be available for them as well.
| Platform | 1.4.4 | 1.4.5 | 1.5.5 | 1.5.6 | 2.0.0 | | :--- | :---: | :---: | :---: | :---: | :---: | | Linux AMD64 | ✅ | ❌ | ✅ | ✅ | ✅ | | Linux ARM64 | ✅ | ❌ | ✅ | ✅ | ✅ | | macOS AMD64 | ❌ | ❌ | ❌ | ❌ | ❌ | | macOS ARM64 | ✅ | ❌ | ✅ | ✅ | ✅ | | Windows AMD64 | ✅ | ❌ | ✅ | ✅ | ✅ | | Windows ARM64 | ❌ | ❌ | ❌ | ❌ | ❌ | | WebAssembly | ❌ | ❌ | ✅ | ✅ | ✅ | ### Installing and Loading ```sql INSTALL {{ page.extension.name }} FROM community; LOAD {{ page.extension.name }}; ``` {% if page.docs.hello_world %} ### Example ```sql {{ page.docs.hello_world }}``` {% endif %} {% if page.docs.extended_description %} ### About {{ page.extension.name }} {{ page.docs.extended_description }} {% endif %} ### Added Functions | function_name | function_type | description | comment | examples | |---------------------------|---------------|------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------|------------------------------------------------------------------------------| | infera_load_model | scalar | Load an ONNX model from a local file path or a remote URL and assign it a unique name. | Supports local paths and remote URLs; caches remote models. | [select infera_load_model('local_model','/path/to/model.onnx');] | | infera_unload_model | scalar | Unload a model, freeing its associated resources. | Returns true on success. | [select infera_unload_model('local_model');] | | infera_set_autoload_dir | scalar | Scan a directory for .onnx files, load them automatically, and return a JSON report. | Returns JSON with loaded models and any errors. | [select infera_set_autoload_dir('path/to/your/models');] | | infera_get_loaded_models | scalar | Return a JSON array containing the names of all currently loaded models. | JSON array of model names. | [select infera_get_loaded_models();] | | infera_get_model_info | scalar | Return a JSON object with metadata for a specific loaded model (name, input/output shapes). | Throws an error if the model is not loaded. | [select infera_get_model_info('local_model');] | | infera_predict | scalar | Perform inference on a batch of data; returns a single float value per input row. | Features accept FLOAT, DOUBLE, INTEGER, BIGINT, DECIMAL (cast to float). | [select infera_predict('my_model', 1.0, 2.5, 3.0) as prediction;] | | infera_predict_multi | scalar | Perform inference and return all outputs as a JSON-encoded array. | Useful for models that produce multiple predictions per sample. | [select infera_predict_multi('multi_output_model', 1.0, 2.0);] | | infera_predict_multi_list | scalar | Perform inference and return outputs as a typed LIST\[FLOAT\]. | Avoids JSON parsing for multi-output models. | [select infera_predict_multi_list('multi_output_model', 1.0, 2.0);] | | infera_predict_from_blob | scalar | Perform inference on raw BLOB data (e.g., image tensor); returns LIST\[FLOAT\]. | Accepts raw tensor BLOB data from a column. | [select infera_predict_from_blob('my_model', my_blob_column) from my_table;] | | infera_is_model_loaded | scalar | Return true if the given model is currently loaded, otherwise false. | NULL | [select infera_is_model_loaded('squeezenet');] | | infera_get_version | scalar | Return a JSON object with version and build information for the Infera extension. | NULL | [select infera_get_version();] | | infera_clear_cache | scalar | Clear the entire model cache directory to free up disk space. | Returns true on success. | [select infera_clear_cache();] | | infera_get_cache_info | scalar | Return cache statistics: directory path, total size in bytes, file count, and configured size limit. | Returns JSON with cache fields. | [select infera_get_cache_info();] | ### Overloaded Functions This extension does not add any function overloads. ### Added Types This extension does not add any types. ### Added Settings | name | description | input_type | scope | aliases | typed_value | |----------------|---------------------------------------------------------|------------|--------|---------|-------------| | temp_directory | Set the directory to which temporary files are written. | VARCHAR | GLOBAL | [] | post.db.tmp |