Eternal AI is a decentralized operating system for AI agents. Its kernel is a suite of Solidity smart contracts that together create a trustless onchain runtime for AI agents to live onchain.
Eternal AI was originally developed for decentralized AI agents on Bitcoin. However, the design is versatile enough to power other blockchains as well.
Join us in building a truly open AI environment for AI agents that is permissionless, censorship-resistant, and unstoppable.
We provide a CLI eai
to simplify the process.
To install eai
sudo ./install.sh
Then, you can use the following command and follow its interactive instructions.
eai miner setup
Press 1
(Setup local cluster). Press 1
again for a full auto-install.
Suppose you want to custom-install, press 2
. This will give you the option to install specific packages.
- 1. Create `./env/local_contracts.json` # create a default config file
- 2. Start HardHat as your local chain
- 3. Deploy Eternal AI Kernel smart contracts
- 4. Start Eternal AI Compute Nodes/Miners
- 5. Start System APIs
For this tutorial, we'll simplify the process by having the three local miners on the same compute node. In production, each miner should have their own compute.
The miners serve DeepSeek-R1-Distill-Qwen-1.5B-Q8_0. However, you should be able to use any models.
DeepSeek-R1 is stored on Filecoin, a decentralized storage network. Its hash is ipfs://bafkreieglfaposr5fggc7ebfcok7dupfoiwojjvrck6hbzjajs6nywx6qi
.
The miners first fetch the model weights stored in multiple chunks on Filecoin and combine them into one complete model.
For MacOS:
cd decentralized-compute/models
sudo bash download_model_macos.sh bafkreieglfaposr5fggc7ebfcok7dupfoiwojjvrck6hbzjajs6nywx6qi
For Ubuntu:
cd decentralized-compute/models
sudo bash download_model_linux.sh bafkreieglfaposr5fggc7ebfcok7dupfoiwojjvrck6hbzjajs6nywx6qi
Create and start an Ollama instance.
ollama create DeepSeek-R1-Distill-Qwen-1.5B-Q8 -f Modelfile
You can try the following quick test to ensure your miner is ready. This will send an onchain prompt to your local blockchain and see if the miners respond.
curl -X POST "http://localhost:8004/v1/chat/completions" -H "Content-Type: application/json" -d '{
"model": "DeepSeek-R1-Distill-Qwen-1.5B-Q8",
"messages": [
{
"role": "system",
"content": "You are a deep thinker."
},
{
"role": "user",
"content": "Design a DeFAI agent that trades autonomously on Uniswap."
}
]
}'
Note that the model info is stored in the Modelfile
file. In the future, if you want to change the model, update the file.
FROM DeepSeek-R1-Distill-Qwen-1.5B-Q8_0/DeepSeek-R1-Distill-Qwen-1.5B-Q8_0.gguf
In this step, we'll deploy a production-grade agent orchestration platform in one single line of code. It provides powerful tools for you to deploy, manage, and scale your agents onchain.
Run the following command:
eai aaas start
In this step, we'll deploy Eternal AI Decentralized Inference API that can be used instead of centralized OpenAI API. There are a lot of things to like about Decentralized Inference API. It's permissionless, trustless, censorship-resistant, tamper-proof, and onchain verifiable.
Run the following command:
eai apis start
Eternal AI treats each agent as a non-fungible. AI-721 inherits ERC-721 and adds AI features.
Run the following script to install dependencies and deploy the AI-721 contract:
eai aaas deploy-contract
Let's create an agent who is a Donald Trump twin.
Run the following script to mint an agent:
eai agent create $(pwd)/decentralized-agents/characters/donald_trump.txt
The .txt file is the system prompt for your agent. It will be used to set the initial behavior for your agent. You can modify the content of the prompt file to adjust your agent's personality.
Fetch agent info from the AI-721 contract:
eai agent info <agent_id>
Also, to list out all agents on your machine, run this:
eai agent list
eai agent chat <agent_id>
Navigate to the ./developer-guides/run-an-end-to-end-decentralized-for-ai-agents/5.start-agent
folder and run the following command to configure your twitter account.
node setup.js --TWITTER_USERNAME <TWITTER_USERNAME> --TWITTER_PASSWORD <TWITTER_PASSWORD> --TWITTER_EMAIL <TWITTER_EMAIL>
Then build a Docker image for the Eliza runtime.
docker build -t eliza .
And start an Eliza agent by running the following command.
docker run --env-file .env -v ./config.json:/app/eliza/agents/config.json eliza
Congrats! You made it! You've deployed a decentralized operating system for AI agents on your computer.
We have a little gift for you: share your agent character file to be entered into a 10,000 EAI raffle.
It's simple. Create a pull request and add your agent character file to the folder decentralized-agents/characters/
folder. Name the file in this format <agent-name>-by-<your-name>.txt
.
Eternal AI is an end-to-end decentralized infrastructure created for a wide array of AI agents and blockchains.
Here are the major components of the Eternal AI software stack.
Component | Description |
---|---|
ai-kernel | A set of Solidity smart contracts that trustlessly coordinate user space, onchain space, and offchain space. |
decentralized-agents | A set of Solidity smart contracts that define AI agent standards (AI-721, SWARM-721, KB-721). |
decentralized-inference | The decentralized inference APIs. |
decentralized-compute | The peer-to-peer GPU clustering and orchestration protocol. |
agent-as-a-service | The production-grade agent launchpad and management. |
agent-studio | No-code, drag 'n drop, visual programming language for AI creators. |
blockchains | A list of blockchains that are AI-powered by Eternal AI. |
Here are the key ongoing research projects.
Component | Description |
---|---|
cuda-evm | The GPU-accelerated EVM and its Solidity tensor linear algebra libary. |
nft-ai | AI-powered fully-onchain NFTs. |
physical-ai | AI-powered hardware devices. |
- Decentralize everything. Ensure that no single point of failure or control exists by questioning every component of the Eternal AI system and decentralizing it.
- Trustless. Use smart contracts at every step to trustlessly coordinate all parties in the system.
- Production grade. Code must be written with production-grade quality and designed for scale.
- Everything is an agent. Not just user-facing agents, but every component in the infrastructure, whether a swarm of agents, an AI model storage system, a GPU compute node, a cross-chain bridge, an infrastructure microservice, or an API, is implemented as an agent.
- Agents do one thing and do it well. Each agent should have a single, well-defined purpose and perform it well.
- Prompting as the unified agent interface. All agents have a unified, simplified I/O interface with prompting and response for both human-to-agent interactions and agent-to-agent interactions.
- Composable. Agents can work together to perform complex tasks via a chain of prompts.
Eternal AI is built using a modular approach, so support for other blockchains, agent frameworks, GPU providers, or AI models can be implemented quickly. Please reach out if you run into issues while working on an integration.
We are still building out the Eternal AI DAO.
Once the DAO is in place, EAI holders will oversee the governance and the treasury of the Eternal AI project with a clear mission: to build truly open AI.
Thank you for considering contributing to the source code. We welcome contributions from anyone and are grateful for even the most minor fixes.
If you'd like to contribute to Eternal AI, please fork, fix, commit, and send a pull request for the maintainers to review and merge into the main code base.
- GitHub Issues: bug reports, feature requests, issues, etc.
- GitHub Discussions: discuss designs, research, new ideas, thoughts, etc.
- X (Twitter): announcements about Eternal AI