forge-sdk
Python SDK for the Forge compute economy. AI agents earn and spend Compute Units.
Install
pip install forge-sdk
Quick Start
from forge_sdk import ForgeClient
forge = ForgeClient() # connects to localhost:3000
# Check your CU balance
balance = forge.balance()
print(f"Balance: {balance['effective_balance']} CU")
# Run inference (costs CU)
result = forge.chat("What is gravity?")
print(f"Answer: {result['content']}")
print(f"Cost: {result['cu_cost']} CU")
print(f"Remaining: {result['balance']} CU")
Autonomous Agent
from forge_sdk import ForgeAgent
agent = ForgeAgent(max_cu_per_task=500)
while agent.has_budget():
result = agent.think("What should I do next?")
if result is None:
break # budget exhausted
print(result['content'])
print(agent.status())
API
| Method | Description |
|---|---|
forge.balance() |
CU balance, reputation |
forge.pricing() |
Market price, cost estimates |
forge.chat(prompt) |
Run inference, pay CU |
forge.can_afford(tokens) |
Check before spending |
forge.trades() |
Trade history |
forge.network() |
Mesh economic state + Merkle root |
forge.providers() |
Ranked providers by cost/reputation |
forge.safety() |
Kill switch, circuit breaker status |
forge.kill(reason) |
Emergency halt |
forge.invoice(cu) |
Create Lightning invoice |
Environment
| Variable | Default | Description |
|---|---|---|
FORGE_URL |
http://127.0.0.1:3000 |
Forge node URL |
FORGE_API_TOKEN |
(none) | Bearer token for protected nodes |
What is Forge?
Forge is a distributed inference protocol where compute is currency. Unlike Bitcoin (useless SHA-256 hashes), Forge nodes earn CU by performing useful LLM inference. AI agents can autonomously earn, spend, and manage their compute budget.
Metadata
Release files for forge-sdk 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| forge_sdk-0.2.0.tar.gz | 4.3 kB | Without provenance | Details for forge_sdk-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| forge_sdk-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for forge_sdk-0.2.0-py3-none-any.whl |
Total release size: 8.9 kB
Release files / forge_sdk-0.2.0.tar.gz
| Download URL | forge_sdk-0.2.0.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a94629622d924db61c3bdc495e825425290fc485b6021fa2c6db47425f80a74e
|
|
BLAKE2b-256 checksum How to use checksums |
64a91f74d9fb7945df4a7102a8c8b50e251057e2bb96a8f84bdbd8ab11648dc7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Release files / forge_sdk-0.2.0-py3-none-any.whl
| Download URL | forge_sdk-0.2.0-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b5c42fc2d0c926cea59ae2b0407deb2e67e994bc621f4030f45aa8f1eb64f2bd
|
|
BLAKE2b-256 checksum How to use checksums |
2c02534bf56a12ebc80db7d5509cbf0b80d883ab84e31c4d05143330b4564545
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Security for forge-sdk 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.