[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-10612":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":39,"readmeContent":40,"aiSummary":41,"trendingCount":16,"starSnapshotCount":16,"syncStatus":15,"lastSyncTime":42,"discoverSource":43},10612,"bittensor","latent-to\u002Fbittensor","latent-to","Internet-scale Neural Networks","https:\u002F\u002Fwww.bittensor.com\u002F",null,"Python",1463,477,43,2,0,1,6,21,5,63.14,"MIT License",false,"master",true,[27,28,29,30,31,32,33,34,35,36,37,38],"ai","blockchain","cryptocurrency","deep-learning","machine-learning","neural-networks","p2p","p2p-network","polkadot","pytorch","substrate","torch","2026-06-12 04:00:51","\u003Cdiv align=\"center\">\n\n# **Bittensor SDK** \u003C!-- omit in toc -->\n[![Discord Chat](https:\u002F\u002Fimg.shields.io\u002Fdiscord\u002F308323056592486420.svg)](https:\u002F\u002Fdiscord.gg\u002Fbittensor)\n[![CodeQL](https:\u002F\u002Fgithub.com\u002Fopentensor\u002Fbittensor\u002Factions\u002Fworkflows\u002Fgithub-code-scanning\u002Fcodeql\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fopentensor\u002Fbittensor\u002Factions)\n[![PyPI version](https:\u002F\u002Fbadge.fury.io\u002Fpy\u002Fbittensor.svg)](https:\u002F\u002Fbadge.fury.io\u002Fpy\u002Fbittensor)\n[![Codecov](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fopentensor\u002Fbittensor\u002Fgraph\u002Fbadge.svg)](https:\u002F\u002Fapp.codecov.io\u002Fgh\u002Fopentensor\u002Fbittensor)\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-yellow.svg)](https:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT) \n\n---\n\n## Internet-scale Neural Networks \u003C!-- omit in toc -->\n\n[Discord](https:\u002F\u002Fdiscord.gg\u002FqasY3HA9F9) • [Network](https:\u002F\u002Ftaostats.io\u002F) • [Research](https:\u002F\u002Fbittensor.com\u002Fwhitepaper) • [Documentation](https:\u002F\u002Fdocs.learnbittensor.org)\n\n\u003C\u002Fdiv>\n\n- [Overview of Bittensor](#overview-of-bittensor)\n- [The Bittensor SDK](#the-bittensor-sdk)\n- [Is Bittensor a blockchain or an AI platform?](#is-bittensor-a-blockchain-or-an-ai-platform)\n- [Subnets](#subnets)\n- [Subnet validators and subnet miners](#subnet-validators-and-subnet-miners)\n- [Yuma Consensus](#yuma-consensus)\n- [Release Notes](#release-notes)\n- [Install Bittensor SDK](#install-bittensor-sdk)\n- [Upgrade](#upgrade)\n- [Install on macOS and Linux](#install-on-macos-and-linux)\n  - [Install using a Bash command](#install-using-a-bash-command)\n  - [Install using `pip3 install`](#install-using-pip3-install)\n  - [Install from source](#install-from-source)\n  - [Verify using Python interpreter](#verify-using-python-interpreter)\n  - [Verify by listing axon information](#verify-by-listing-axon-information)\n- [Release Guidelines](#release-guidelines)\n- [Contributions](#contributions)\n- [License](#license)\n- [Acknowledgments](#acknowledgments)\n\n---\n\n## Overview of Bittensor\n\nWelcome! Bittensor is an open source platform on which you can produce competitive digital commodities. These digital commodities can be machine intelligence, storage space, compute power, protein folding, financial markets prediction, and many more. You are rewarded in **TAO** when you produce best digital commodities.\n\n## The Bittensor SDK\n\nThe Opentensor Foundation (OTF) provides all the open source tools, including this Bittensor SDK, the codebase and the documentation, with step-by-step tutorials and guides, to enable you to participate in the Bittensor ecosystem. \n\n- **Developer documentation**: https:\u002F\u002Fdocs.learnbittensor.org.\n- **A Beginner's Q and A on Bittensor**: https:\u002F\u002Fdocs.learnbittensor.org\u002Fquestions-and-answers.\n- **Bittensor whitepaper**: https:\u002F\u002Fbittensor.com\u002Fwhitepaper.\n\nThis Bittensor SDK contains ready-to-use Python packages for interacting with the Bittensor ecosystem, writing subnet incentive mechanisms, subnet miners, subnet validators and querying the subtensor (the blockchain part of the Bittensor network). \n\n---\n\n## Is Bittensor a blockchain or an AI platform?\n\nIn Bittensor there is one blockchain, and many platforms that are connected to this one blockchain. We call these platforms as **subnets**, and this one blockchain  **subtensor**. So, a subnet can be AI-related or it can be something else. The Bittensor network has a number of distinct subnets. All these subnets interact with subtensor blockchain. If you are thinking, \"So, subnets are not part of the blockchain but only interact with it?\" then the answer is \"yes, exactly.\"\n\n## Subnets\n\nEach category of the digital commodity is produced in a distinct subnet. Applications are built on these specific subnets. End-users of these applications would be served by these applications.\n\n## Subnet validators and subnet miners\n\nSubnets, which exist outside the blockchain and are connected to it, are off-chain competitions where only the best producers are rewarded. A subnet consists of off-chain **subnet validators** who initiate the competition for a specific digital commodity, and off-chain **subnet miners** who compete and respond by producing the best quality digital commodity.\n\n## Yuma Consensus\n\nScores are assigned to the top-performing subnet miners and subnet validators. The on-chain Yuma Consensus determines the TAO rewards for these top performers. The Bittensor blockchain, the subtensor, runs on decentralized validation nodes, just like any blockchain.\n\n**This SDK repo is for Bittensor platform only**\nThis Bittensor SDK codebase is for the Bittensor platform only, designed to help developers create subnets and build tools on Bittensor. For subnets and applications, refer to subnet-specific websites, which are maintained by subnet owners.\n\n## Release Notes\n\nSee [Bittensor SDK Release Notes](https:\u002F\u002Fdocs.learnbittensor.org\u002Fbittensor-rel-notes).\n\n---\n\n## Install Bittensor SDK\n\nBefore you can start developing, you must install Bittensor SDK and then create Bittensor wallet.\n\n## Upgrade\n\nIf you already installed Bittensor SDK, make sure you upgrade to the latest version. Run the below command:\n\n```bash\npython3 -m pip install --upgrade bittensor\n```\n\n---\n\n## Install on macOS and Linux\n\n### Note for macOS users\nThe macOS preinstalled CPython installation is compiled with LibreSSL instead of OpenSSL. There are a number\nof issues with LibreSSL, and as such is not fully supported by the libraries used by bittensor. Thus we highly recommend, if \nyou are using a Mac, to first install Python from [Homebrew](https:\u002F\u002Fbrew.sh\u002F). Additionally, the Rust FFI bindings \n[if installing from precompiled wheels (default)] require the Homebrew-installed OpenSSL package. If you choose to use\nthe preinstalled Python version from macOS, things may not work completely.\n\n### Installation\nYou can install Bittensor SDK on your local machine in either of the following ways. **Make sure you verify your installation after you install**:\n- [Install using a Bash command](#install-using-a-bash-command).\n- [Install using `pip3 install`](#install-using-pip3-install)\n- [Install from source](#install-from-source)\n\n### Install using a Bash command\n\nThis is the most straightforward method. It is recommended for a beginner as it will pre-install requirements like Python, if they are not already present on your machine. Copy and paste the following `bash` command into your terminal:\n\n```bash\n\u002Fbin\u002Fbash -c \"$(curl -fsSL https:\u002F\u002Fraw.githubusercontent.com\u002Fopentensor\u002Fbittensor\u002Fmaster\u002Fscripts\u002Finstall.sh)\"\n```\n\n**For Ubuntu-Linux users**\nIf you are using Ubuntu-Linux, the script will prompt for `sudo` access to install all required apt-get packages.\n\n### Install using `pip3 install`\n\n```bash\npython3 -m venv bt_venv\nsource bt_venv\u002Fbin\u002Factivate\npip install bittensor\n```\n\n### Install from source\n\n1. Create and activate a virtual environment\n\n    - Create Python virtual environment. Follow [this guide on python.org](https:\u002F\u002Fdocs.python.org\u002F3\u002Flibrary\u002Fvenv.html#creating-virtual-environments).\n\n    - Activate the new environment. Follow [this guide on python.org](https:\u002F\u002Fdocs.python.org\u002F3\u002Flibrary\u002Fvenv.html#how-venvs-work)\n\n2. Clone the Bittensor SDK repo\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fopentensor\u002Fbittensor.git\n```\n\n3.  Install\n\nYou can install using any of the below options:\n\n- **Install SDK**: Run the below command to install Bittensor SDK in the above virtual environment. This will also install `btcli`.\n\n    ```python\n    pip install bittensor\n    ```\n\n- **Install SDK with `torch`**: Install Bittensor SDK with [`torch`](https:\u002F\u002Fpytorch.org\u002Fdocs\u002Fstable\u002Ftorch.html).\n\n   ```python\n    pip install bittensor[torch]\n    ```\n  In some environments the above command may fail, in which case run the command with added quotes as shown below:\n\n  ```python\n    pip install \"bittensor[torch]\"\n    ```\n\n- **Install SDK with `cubit`**: Install Bittensor SDK with [`cubit`](https:\u002F\u002Fgithub.com\u002Fopentensor\u002Fcubit).\n\n  1. Install `cubit` first. See the [Install](https:\u002F\u002Fgithub.com\u002Fopentensor\u002Fcubit?tab=readme-ov-file#install) section. **Only Python 3.9 and 3.10 versions are supported**. \n  2. Then install SDK with `pip install bittensor`.\n  \n\n### Troubleshooting\n#### SSL: CERTIFICATE_VERIFY_FAILED\n\nIf you are encountering a `[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate` \nerror, use the command `python -m bittensor certifi` which will update your local SSL certificates.\n\n---\n\n## Install on Windows\n\nTo install and run Bittensor SDK on Windows you must install [**WSL 2** (Windows Subsystem for Linux)](https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fwindows\u002Fwsl\u002Fabout) on Windows and select [Ubuntu Linux distribution](https:\u002F\u002Fgithub.com\u002Fubuntu\u002FWSL\u002Fblob\u002Fmain\u002Fdocs\u002Fguides\u002Finstall-ubuntu-wsl2.md). \n\nAfter you installed the above, follow the same installation steps described above in [Install on macOS and Linux](#install-on-macos-and-linux).\n\n**ALERT**: **Limited support on Windows**\nWhile wallet transactions like delegating, transfer, registering, staking can be performed on a Windows machine using WSL 2, the mining and validating operations are not recommended and are not supported on Windows machines.\n\n---\n\n## Verify the installation\n\nYou can verify your installation in either of the below ways:\n\n### Verify using `btsdk` version\n\n```bash\npython3 -m bittensor\n```\n\nThe above command will show you the version of the `btsdk` you just installed.\n\n### Verify using Python interpreter\n\n1. Launch the Python interpreter on your terminal.   \n\n    ```bash\n    python3\n    ```\n2. Enter the following two lines in the Python interpreter.\n   \n    ```python\n    import bittensor as bt\n    print( bt.__version__ )\n    ```\n    The Python interpreter output will look like below:\n\n    ```python\n    Python 3.11.6 (main, Oct  2 2023, 13:45:54) [Clang 15.0.0 (clang-1500.0.40.1)] on darwin\n    Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n    >>> import bittensor as bt\n    >>> print( bt.__version__ )\n    \u003Cversion number>\n    ```\nYou will see the version number you installed in place of `\u003Cversion number>`. \n\n### Verify by listing axon information\n\nYou can also verify the Bittensor SDK installation by listing the axon information for the neurons. Enter the following lines in the Python interpreter.\n\n```python\nimport bittensor\nmetagraph = bittensor.Metagraph(1)\nmetagraph.axons[:10]\n```\nThe Python interpreter output will look like below.\n\n```bash\n[AxonInfo( \u002Fipv4\u002F3.139.80.241:11055, 5GqDsK6SAPyQtG243hbaKTsoeumjQQLhUu8GyrXikPTmxjn7, 5D7u5BTqF3j1XHnizp9oR67GFRr8fBEFhbdnuVQEx91vpfB5, 600 ), AxonInfo( \u002Fipv4\u002F8.222.132.190:5108, 5CwqDkDt1uk2Bngvf8avrapUshGmiUvYZjYa7bfA9Gv9kn1i, 5HQ9eTDorvovKTxBc9RUD22FZHZzpy1KRfaxCnRsT9QhuvR6, 600 ), AxonInfo( \u002Fipv4\u002F34.90.71.181:8091, 5HEo565WAy4Dbq3Sv271SAi7syBSofyfhhwRNjFNSM2gP9M2, 5ChuGqW2cxc5AZJ29z6vyTkTncg75L9ovfp8QN8eB8niSD75, 601 ), AxonInfo( \u002Fipv4\u002F64.247.206.79:8091, 5HK5tp6t2S59DywmHRWPBVJeJ86T61KjurYqeooqj8sREpeN, 5E7W9QXNoW7se7B11vWRMKRCSWkkAu9EYotG5Ci2f9cqV8jn, 601 ), AxonInfo( \u002Fipv4\u002F51.91.30.166:40203, 5EXYcaCdnvnMZbozeknFWbj6aKXojfBi9jUpJYHea68j4q1a, 5CsxoeDvWsQFZJnDCyzxaNKgA8pBJGUJyE1DThH8xU25qUMg, 601 ), AxonInfo( \u002Fipv4\u002F149.137.225.62:8091, 5F4tQyWrhfGVcNhoqeiNsR6KjD4wMZ2kfhLj4oHYuyHbZAc3, 5Ccmf1dJKzGtXX7h17eN72MVMRsFwvYjPVmkXPUaapczECf6, 600 ), AxonInfo( \u002Fipv4\u002F38.147.83.11:8091, 5Hddm3iBFD2GLT5ik7LZnT3XJUnRnN8PoeCFgGQgawUVKNm8, 5DCQw11aUW7bozAKkB8tB5bHqAjiu4F6mVLZBdgJnk8dzUoV, 610 ), AxonInfo( \u002Fipv4\u002F38.147.83.30:41422, 5HNQURvmjjYhTSksi8Wfsw676b4owGwfLR2BFAQzG7H3HhYf, 5EZUTdAbXyLmrs3oiPvfCM19nG6oRs4X7zpgxG5oL1iK4MAh, 610 ), AxonInfo( \u002Fipv4\u002F54.227.25.215:10022, 5DxrZuW8kmkZPKGKp1RBVovaP5zHtPLDHYc5Yu82Z1fWqK5u, 5FhXUSmSZ2ec7ozRSA8Bg3ywmGwrjoLLzsXjNcwmZme2GcSC, 601 ), AxonInfo( \u002Fipv4\u002F52.8.243.76:40033, 5EnZN591jjsKKbt3yBtfGKWHxhxRH9cJonqTKRT5yTRUyNon, 5ChzhHyGmWwEdHjuvAxoUifHEZ6xpUjR67fDd4a42UrPysyB, 601 )]\n>>>\n```\n\n### Testing\nYou can run integration and unit tests in interactive mode of IDE or in terminal mode using the command:\n```bash\npytest tests\u002Fintegration_tests\npytest tests\u002Funit_tests\n```\n\n#### E2E tests have 2 options for launching (legacy runner):\n- using a compiler based on the substrait code\n- using an already built docker image (docker runner)\n\n#### Local environment variables:\n- `LOCALNET_SH_PATH` - path to `localnet.sh` script in cloned subtensor repository (for legacy runner);\n- `BUILD_BINARY` - (`=0` or `=1`) - used with `LOCALNET_SH_PATH` for build or not before start localnet node (for legacy runner);\n- `USE_DOCKER` - (`=0` or `=1`) - used if you want to use specific runner to run e2e tests (for docker runner);\n- `FAST_BLOCKS` - (`=0` or `=1`) - allows you to run a localnet node in fast or non-fast blocks mode (for both types of runners).\n- `SKIP_PULL` - used if you are using a Docker image, but for some reason you want to temporarily limit the logic of updating the image from the repository.\n\n#### Using `docker runner` (default for now):\n- E2E tests with docker image do not require preliminary compilation\n- are executed very quickly\n- require docker installed in OS\n\nHow to use:\n```bash\npytest tests\u002Fe2e_tests\n```\n\n#### Using `legacy runner`:\n- Will start compilation of the collected code in your subtensor repository\n- you must provide the `LOCALNET_SH_PATH` variable in the local environment with the path to the file `\u002Fscripts\u002Flocalnet.sh` in the cloned repository within your OS\n- you can use the `BUILD_BINARY=0` variable, this will skip the copy step for each test.\n- you can use the `USE_DOCKER=0` variable, this will run tests using the \"legacy runner\", even if docker is installed in your OS\n\n#### How to use:\nRegular e2e tests run\n```bash\nLOCALNET_SH_PATH=\u002Fpath\u002Fto\u002Fyour\u002Flocalnet.sh pytest tests\u002Fe2e_tests\n```\n\nIf you want to skip re-build process for each e2e test\n```bash\nBUILD_BINARY=0 LOCALNET_SH_PATH=\u002Fpath\u002Fto\u002Fyour\u002Flocalnet.sh pytest tests\u002Fe2e_tests\n```\n\nIf you want to use legacy runner even with installed Docker in your OS\n```bash\nUSE_DOCKER=0 BUILD_BINARY=0 LOCALNET_SH_PATH=\u002Fpath\u002Fto\u002Fyour\u002Flocalnet.sh pytest tests\u002Fe2e_tests\n```\n\n---\n\n## Release Guidelines\nInstructions for the release manager: [RELEASE_GUIDELINES.md](.\u002Fcontrib\u002FRELEASE_GUIDELINES.md) document.\n\n## Contributions\nReady to contribute? Read the [contributing guide](.\u002Fcontrib\u002FCONTRIBUTING.md) before making a pull request.\n\n## License\nThe MIT License (MIT)\nCopyright © 2025 The Opentensor Foundation\nCopyright © 2025 Yuma Rao\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and\u002For sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n## Acknowledgments\n**learning-at-home\u002Fhivemind**\n","Bittensor 是一个开源平台，旨在通过互联网规模的神经网络生产竞争性的数字商品。该项目的核心功能包括利用区块链技术（基于 Polkadot 的 Substrate 框架）和深度学习工具（如 PyTorch）来创建、验证并激励高质量的机器智能模型和其他类型的数字资产生成。它提供了一个全面的 Python SDK，支持开发者轻松接入 Bittensor 生态系统，实现子网激励机制的设计与部署、子网矿工及验证者的开发等任务。Bittensor 适用于需要结合区块链安全性和去中心化特性的大规模人工智能应用场合，例如分布式计算资源分配、高级数据分析服务或任何可以被编码为数字商品形式的知识工作。","2026-06-11 03:29:21","top_topic"]