Skip to main content

Run AI models as real smart contracts

Al can be run truly on-chain as Internet Computer smart contracts, making it tamperproof and unstoppable, and autonomous if needed

Decentralized AI

AI Models on ICP Today

See a series of demos how the Internet Computer has the capability of running AI in a smart contract.
On-chain Facial Recognition – AI running on ICP

Demo

On-chain Facial Recognition – AI running on ICP

The world's first demonstration of AI inference running directly on the blockchain, presented by Dominic Williams

Try out the AI demo by yourself

Check out the open-source repo on GitHub and tryout the AI demo by yourself.

GO TO GITHUB REPO

let image = imageops::resize(
&image, 160, 160, FilterType::Triangle);

let tensor = Array4::from_shape_fn(
(1, 3, 160, 160), |(_, c, y, x)| {
image[(x as u32, y as u32)][c] as f32 / 255.0
});

let result = model.run(
tvec!(Tensor::from(tensor).into()))?;

A recent study on AI finds that nearly half of the respondents (49%) are concerned about the misuse of AI for nefarious purposes.

Survey in the Artificial Intelligence Index Report 2024 by Stanford University.

What is needed to solve these issues?

Model integrity

Users need assurance that their AI prompts are handled by untampered models. Traditional software integrity methods, such as source code analysis, are infeasible for AI models because they consist of complex numerical weights and extensive matrices, rather than human-readable code, making direct verification impossible.

Data confidentiality

During training and operation, AI models handle sensitive data, like medical inquiries or corporate secrets. Users need guarantees that their information remains secure and doesn't leak to the model creators, other users, or AI infrastructure providers.

Availability

AI models will become essential for business processes and societies in general. As with every critical infrastructure, solutions must be found to keep AI models resilient to interruptions and to protect them from censorship.

Making AI trustworthy

What the future holds

Blockchain AI is still in its early stages. Currently, smart contracts can run small AI models like ImageNet for onchain image classification. Short-term improvements will decrease latency and support larger models, while the long-term goal is to enable smart contracts to perform AI computations on GPUs, allowing both training and inference of large models fully onchain.

Short-term

  • Faster deterministic floating-point operations
  • Wasm SIMD (Single-instruction multiple data)
  • Upgrade Wasm memory to 64-bit

Long-term

  • Explore API for deterministic AI computation on GPUs.
  • Develop public specification for nodes with GPUs.
  • Add subnets with the new nodes to ICP.

News & media

Get all the news from the Internet Computer ecosystem

Explore more news

Explore AI on ICP