Scan your whole stack
Are you using allora-sdk?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v1.5.0
allora-sdk was last scanned on 1 Dec 2026 at version 1.5.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 1.5.0 LATEST | 1 Dec 2026 | No rules fired |
| 1.6.0rc1 | 1 Dec 2026 | No rules fired |
| 1.5.0rc1 | 12 Nov 2026 | No rules fired |
Findings for v1.5.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 1.5.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
A Python SDK for interacting with the Allora Network. Submit machine learning predictions, query blockchain data, and access network inference results.
pip install allora_sdk
The ALLO token is the native "compute gas" currency of the Allora Network, a decentralized oracle platform that leverages machine learning to provide accurate and timely data to smart contracts. The network operates on a proof-of-stake consensus mechanism, ensuring security and scalability.
ALLO has 18 decimal places, unlike the native token on most Cosmos chains. This was chosen for compatibility with the Ethereum/EVM standard.
Submits predictions to Allora Network topics with your ML models. The worker handles wallet creation, blockchain transactions, and automatic retries so that you can focus on model engineering.
The simplest way to start participating in the Allora network is to paste the following snippet into a Jupyter or Google Colab notebook (or just a Python file that you can run from your terminal). It will automatically handle all of the network onboarding and configuration behind the scenes, and will start submitting inferences automatically.
A slightly more complete example can be found in the file example_inference_worker.py.
from allora_sdk import AlloraNetworkConfig, AlloraWorker, RunContext
async def run_model(context: RunContext) -> float:
# your ML model prediction logic
return 123.45
async def main():
worker = AlloraWorker.inferer(
topic_id=69,
network=AlloraNetworkConfig.testnet(),
run=run_model,
)
async for result in worker.run():
if isinstance(result, Exception):
print(f"Inference worker error: {result}")
else:
print(f"Prediction submitted to Allora: {result.submission}")
# IF YOU'RE RUNNING IN A PYTHON FILE:
import asyncio
asyncio.run(main())
# IF YOU'RE RUNNING IN A NOTEBOOK:
await main()
When you run this snippet, a few things happen:
allo address. This identity is saved in the same folder from which you run the worker script, and will be auto-detected if you run it again later.More resources:
from allora_sdk import AlloraWorker, FeeTier, AlloraWalletConfig, AlloraNetworkConfig
from allora_sdk.worker.autostake import AutoStakeConfig, AutoStakeTargetType
from allora_sdk.worker import SanityCheckConfig
inference_worker = AlloraWorker.inferer(
#
# Wallet config
#
# Initialize with a mnemonic
wallet=AlloraWalletConfig(mnemonic="..."),
#
# Networking config
#
# Helpers for common networks/environments
# network = AlloraNetworkConfig.testnet(),
# network = AlloraNetworkConfig.mainnet(),
# network = AlloraNetworkConfig.local(),
# Specify network options directly
network=AlloraNetworkConfig(
chain_id = "allora-testnet-1",
url = "grpc+https://allora-grpc.testnet.allora.network:443",
websocket_url = "wss://allora-rpc.testnet.allora.network/websocket",
fee_denom = "uallo",
fee_minimum_gas_price = 250_000_000.0,
congestion_aware_fees = True,
use_dynamic_gas_price = True,
),
# Topic ID (see https://explorer.allora.network for the full list)
topic_id=1,
# Specify the inference function directly
run=my_model,
# Allora API key -- see https://developer.allora.network for a free key.
# This is a convenience feature that allows the worker to fetch ALLO for gas fees on testnet.
api_key="UP-...",
# `fee_tier` controls how much you pay to ensure your inferences are included within
# an epoch. The options are ECO, STANDARD, or PRIORITY -- default is STANDARD.
fee_tier=FeeTier.PRIORITY,
# `debug` enables debug logging -- very noisy.
debug=True,
# Optional: auto-stake this worker's rewards to a reputer (Allora emissions module)
autostake=AutoStakeConfig(
target_type=AutoStakeTargetType.REPUTER,
target_address="allo1...reputer",
),
# Or: auto-stake to a Cosmos validator (staking MsgDelegate)
# autostake = AutoStakeConfig(
# target_type=AutoStakeTargetType.VALIDATOR,
# target_address="allovaloper1...validator",
# ),
# Optional sanity check (default: enabled, 60s throttle)
# sanity_check=SanityCheckConfig(enabled=False), # disable
# sanity_check=SanityCheckConfig(throttle_interval_seconds=30.0),
)
Reputers evaluate inference quality by computing losses between ground truth and predictions. An simple reputer can be built with the SDK just as easily as an inference worker. The main difference, is that instead of the run_model callback we need to pass a reputer_fn which has the type (context: RunContext, inference: dict[str, float]) -> float. This function gets called once for each inference in the epoch (that is, the network inference, each individual worker's inference, and a few additional "one-out" inferences which the network uses for scoring). It is expected to obtain a ground truth value, compare it to the inference, and return a loss which is computed with the topic-defined loss function.
In practice, it is often more convenient to have two separate callbacks:
get_ground_truth(context: RunContext) -> GroundTruthType which only runs once per epoch.loss(gt: GroundTruthType, inference: float) -> float for single-value topics, or of the type loss(gt: GroundTruthType, inference: dict[str, float]) -> float for multi-value topics, which runs for every value in the inference bundle.Note that the ground truth type does not need to agree with the inference type. That is useful for certain loss functions which require extra data. For example, the czar and ztae loss functions require a standard deviation of historical values, which can just be treated as part of the ground truth.
We provide a helper function make_reputer_function which takes two functions get_ground_truth and loss_fn as above and returns a reputer_fn that is suitable for passing to the Allora worker. It handles the caching of the ground truth, so that get_ground_truth only needs to be called once per epoch.
def mse_loss(x: float, y: float) -> float:
return (x-y)**2
async def get_ground_truth(context: RunContext) -> float:
nonce_time = await get_block_time(context.client, context.nonce)
prediction_time = nonce_time.replace(second=0, microsecond=0) + timedelta(days = 1)
logger.info(f'Generating ground truth for epoch starting at {nonce_time}')
logger.info(f'As this is a 1 day BTC/USD price prediction topic, we need to get the price of BTC at {prediction_time}')
# getting this from some data source
ground_truth = 123.45
return ground_truth
# ...
worker = AlloraWorker.reputer(
topic_id=69,
network=AlloraNetworkConfig.testnet(),
reputer_fn=make_reputer_function(get_ground_truth, mse_loss),
min_stake_uallo=1_000_000,
)
A full example is in example_reputer.py.
Low-level blockchain client for advanced users. Supports queries, transactions, and WebSocket subscriptions.
Initialization is very flexible and straightforward. The client can be initialized with:
from allora_sdk import AlloraRPCClient, AlloraWalletConfig, AlloraNetworkConfig
# Initialize client manually
client = AlloraRPCClient(
wallet=AlloraWalletConfig(
mnemonic="...", # wallet config is optional, only needed for sending transactions
prefix="allo", # bech32 prefix (default is "allo" for Allora Network)
),
network=AlloraNetworkConfig(
url="...", # RPC url
websocket_url="...", # websocket url is optional, only needed for subscribing to events
)
)
# Initialize client with preset network config defaults (testnet in this case)
client = AlloraRPCClient.testnet()
# Initialize client with preset network config, but some defaults overridden
client = AlloraRPCClient.testnet(
wallet=AlloraWalletConfig(mnemonic-"..."), # optional, only needed for sending transactions
websocket_url="...", # optional, only needed for subscribing to events
)
# Alternatively, initialize client from environment variables:
# - PRIVATE_KEY
# - MNEMONIC
# - MNEMONIC_FILE
# - ADDRESS_PREFIX
# - CHAIN_ID
# - RPC_ENDPOINT
# - WEBSOCKET_ENDPOINT
# - FAUCET_URL
# - FEE_DENOM
# - FEE_MIN_GAS_PRICE
# - FEE_GRANTER (bech32 `allo` address that pays fees via an on-chain grant)
# - MAX_FEES (hard per-tx fee cap in the fee denom)
# - ACCOUNT_SEQUENCE_RETRY_DELAY (seconds to wait before retrying a sequence mismatch)
# - GAS_ADJUSTMENT (safety multiplier on gas estimates, default 1.2)
# - BASE_GAS (gas limit replacing the per-message-type defaults;
# GAS_ADJUSTMENT still applies on top of it)
# - SIMULATE_GAS_FROM_START (true/false, default true)
#
# The tx settings above are also read by the AlloraWorker factories, so a
# deployment can configure them through the environment without going through
# AlloraRPCClient.from_env. Explicit arguments always win over the env var.
#
# Payload submissions expire with their submission window: workers/forecasters
# set timeout_height = nonce + topic.worker_submission_window; reputers set
# nonce + ground_truth_lag + extra_lag + topic.epoch_length (extra_lag rounds the
# ground-truth lag onto the epoch grid). A stale submission is then evicted from
# the mempool / rejected at CheckTx instead of being included and failing later.
# The actor sets that height only after it has loaded the topic and the window
# fields are positive; otherwise the tx is left unchanged.
client = AlloraRPCClient.from_env()
# Query network data
# Note: `height` is optional. Defaults to the latest block on the chain.
request = GetLatestRegretStdNormRequest(topic_id=123)
response = client.emissions.query.get_latest_regret_std_norm(request, height=6200000)
# Submit transactions
response = await client.emissions.tx.insert_worker_payload(
topic_id=1,
inference_value="55000.0",
nonce=12345
)
# WebSocket event subscriptions
from allora_sdk.rpc_client.protos.emissions.v10 import EventWorkerSubmissionWindowOpened
async def handle_event(event, block_height):
print(f"New epoch: {event.topic_id} at block {block_height}")
subscription_id = await client.events.subscribe_new_block_events_typed(
emissions.EventWorkerSubmissionWindowOpened,
[ EventAttributeCondition("topic_id", "=", "1") ],
handle_event
)
RPC wire protocols:
Modules:
Wire protocol is determined by the RPC url string passed to the config constructor:
grpc+http(s) will use the gRPC Protobuf client
rest+http(s) will use the Cosmos-LCD client
Transaction support: Fee estimation, signing, and broadcasting
WebSocket events: Real-time blockchain event subscriptions. For a usage example, see the AlloraWorker
Multi-chain: Testnet and mainnet support come with batteries included, but there is maximal configurability. Can be used with other Cosmos SDK chains.
Type safety: Full protobuf type and service definitions, codegen clients
Async HTTP client for the Forge API Gateway. Public types match the gateway wire JSON (same contract as the Go SDK):
get_all_topics() → list[Topic]get_topic(topic_id) → Topic (+ best-effort latest_network_inference)get_network_inference(topic_id, evm_chain_id=None) → NetworkInferenceObtain a forge_sk_… API key from your Allora Forge key provisioner (legacy
Upshot UP-… keys and the old developer portal key page are not used).
More detail: docs/FORGE_API_CLIENT.md ·
wire shapes: docs/FORGE_API_RESPONSE_SHAPES.md.
| Setting | Default |
|---|---|
| Gateway base | https://api.developer.allora.network |
| Network path | mainnet (testnet | mainnet | offchain) |
Gateway calls use Authorization: Bearer {key}.
Pass evm_chain_id (a SignatureFormat, chain id, or legacy slug) when you
need a populated NetworkInference.signature; omitting it sends no
evm_chain_id. Prefer network_inference_normalized for display prices.
Topic: gateway fields id / metadata (removed Upshot-style
topic_id / topic_name aliases)NetworkInference: flat gateway payload (removed nested Inference /
InferenceData); decoded as-is (no emptiness remap)get_network_inference replaces get_inference_by_topic_idEmptyInferenceErrorget_topic and TopicNotFoundErrorapi_key= — there is no embedded default keyforge_sk_ (legacy UP-… keys are rejected)/v2)allora-testnet-1)ChainID, TopicsResponse, APIResponsefetch_api_response(), get_request_url()Fetcher protocol is now (method, url, headers) and requires aclose()Topic catalog does not include Upshot-only fields (description,
counts, stakes, is_active, updated_at)Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.