Start here · Build on Foundry

From clean clone to shipping in under an hour.

Three audiences, three paths. Pick the one that matches what you're trying to build today; the others are linked at the end of each path so you can come back when the time is right.

Pick your path

Foundry is a two-sided protocol — supply (Smiths, Funders) and demand (Builders). Most people land here as one of these three:

  • Path A · Call an Ingot — you ship product, you want a model. Time: 15 minutes.
  • Path B · Contribute to a Forge — you have data or compute, you want shares. Time: 30 minutes.
  • Path C · Open a Forge — you want a model to exist, you'll underwrite it. Time: 1 hour.

Path A · Call an Ingot from your product

1 · Browse the catalog

Pick an Ingot. Visit /forges to browse active Forges, or /lineage to see the family tree of every minted Ingot. Copy the Ingot ID you want.

2 · Install + call

bash
pnpm add @foundryprotocol/sdk
ts
import { Foundry } from "@foundryprotocol/sdk";

const foundry = new Foundry({ contracts: "aristotle" });
const { output, receipt } = await foundry.inference.run(
  "ingot:0x…",
  { input: "Translate to Konkani: …" },
);

3 · Display the receipt

Show your users that the model they're calling is co-owned, and that their use paid the co-owners. This is the trust-builder that differentiates a Foundry-backed product from any other LLM wrapper.

tsx
<div className="receipt">
  <span>Generated by <a href={`/ingots/${ingotId}`}>Konkani v1</a></span>
  <span>•</span>
  <a href={`https://aristotle.0g.explorer/tx/${receipt.revenueTxHash}`}>
    Revenue paid on-chain ↗
  </a>
</div>

Highlight

Adapter for your framework? See Adapters. We ship Vercel AI SDK, LangChain, and OpenAI-compatible HTTP out of the box.

Path B · Contribute data or compute to a Forge

1 · Find an open Forge

Forges in OPEN state accept contributions. The list is at /forges. Read the modelSpec to see what kind of data is wanted and the eval criteria.

2 · Submit your data

Upload your corpus to 0G Storage, get the storage root, then submit the root to the Forge:

ts
import { Foundry } from "@foundryprotocol/sdk";
import { createWalletClient, custom } from "viem";

const wallet  = createWalletClient({ transport: custom(window.ethereum) });
const foundry = new Foundry({ contracts: "aristotle", walletClient: wallet });

const { txHash } = await foundry.forge.contributeData(
  "forge:0x…",
  "0x<storageRoot>",
);

3 · Wait for the Forge to close & claim

Once the contribution window ends, the eval coordinator runs LOO attribution. Shares mint automatically. When inference calls roll in, you pull your revenue with one line:

ts
const { txHash } = await foundry.revenue.claim(tokenId);

Path C · Open a Forge yourself

1 · Write the specs

A Forge is defined by two specs:

  • modelSpec — the architecture, training recipe, hyperparameters, base model (if any). Stored on 0G Storage; hash committed on-chain.
  • evalSpec — the held-out test set, the metric, the acceptance threshold. Stored on 0G Storage; hash committed on-chain.

2 · Pick an eval coordinator

Currently one coordinator runs: the Foundry-operated TEE on 0G Compute. Set its address in evalCoordinator. The roadmap includes opening this up to permissionless coordinators.

3 · Create the Forge

ts
const { txHash } = await foundry.forge.create({
  modelSpec:               "0x<hashOfModelSpec>",
  evalSpec:                "0x<hashOfEvalSpec>",
  evalCoordinator:         "0x<coordinatorAddress>",
  contributionWindowEnds:  BigInt(Math.floor(Date.now()/1000) + 7*86400),
});

4 · Fund + announce

Underwrite the compute budget by calling fundForge. Then announce the Forge — link to the explorer + the Forge detail page so Smiths can find it. The Forge in Public dashboard will surface it automatically once the indexer sees the create event.

Common patterns

Display the cap table on your product

tsx
const meta   = await foundry.ingot.meta(tokenId);
const shares = await Promise.all(
  holders.map(async (h) => ({
    holder: h,
    bps:    await foundry.ingot.shareOf(tokenId, h),
  })),
);
// Render a horizontal stacked bar segmented by share weight.

Show the TEE attestation

Every minted Ingot has its attestation indexed. Link to the explorer transaction for submitEvalResult from your UI; users can verify the TEE signature themselves.