Skip to main content

Charms shared contracts: node & seed SDK, recipes, chunks, wire protocol, seed packages

Project description

charms-core

Shared contracts for the Charms platform — a community-powered AI workflow system where users design Charms (node-graph Recipes) and run them on a distributed fleet of Runes: instances of model-loading Seeds contributed by users who share their compute and earn Mana.

This package is the dependency-light foundation both the Charms server and the charms-launcher build on. Pure Pydantic v2 models plus stdlib — no web framework, no database, no model runtimes.

What's inside

Module Contents
charms_core.types Modalities, port schemas, node metadata, the CharmsError hierarchy
charms_core.node BasicNode — the in-process glue-node SDK
charms_core.seed Seed — the model-module SDK (load() / run() / streaming trio), manifests, descriptors
charms_core.package The seed package format: manifest.json models (typed options, prices, env rules, install indexes) + zip validation
charms_core.recipe Recipe graph models, validation, topological sort
charms_core.chunk The streaming chunk model + binary framing codec
charms_core.protocol Every WebSocket message on the launcher and realtime-client wires

Install

pip install charms-core

Python ≥ 3.12. Fully typed (py.typed).

Building a Seed

from pydantic import BaseModel
from charms_core.seed import Seed, SeedContext, SeedManifest
from charms_core.types import Modality, PortSchema

class EchoInput(BaseModel):
    text: str

class EchoOutput(BaseModel):
    text: str

class EchoSeed(Seed[EchoInput, EchoOutput, None]):
    manifest = SeedManifest(id="echo", name="Echo")
    inputs = [PortSchema(name="text", modality=Modality.TEXT)]
    outputs = [PortSchema(name="text", modality=Modality.TEXT)]
    input_model = EchoInput
    output_model = EchoOutput

    async def load(self, ctx: SeedContext) -> None: ...

    async def run(self, input: EchoInput, config: None = None) -> EchoOutput:
        return EchoOutput(text=input.text)

Package it (with a manifest.json, pyproject.toml, and README.md) and import it into a Charms server's seed registry; contributors then pull and run it as a Rune via the launcher.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

charms_core-0.1.0.tar.gz (23.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

charms_core-0.1.0-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

Details for the file charms_core-0.1.0.tar.gz.

File metadata

  • Download URL: charms_core-0.1.0.tar.gz
  • Upload date:
  • Size: 23.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for charms_core-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b7beb619ada7e2b4ed49885fce6e633e5182a9f69c252769ef8ea590ca006fca
MD5 a491e19e1c7df8057a22c43d3d90f1dc
BLAKE2b-256 ae2c36955de7ba5ec520c112db3b654a36aae91141ff548bc0c3a763c7a33bbb

See more details on using hashes here.

File details

Details for the file charms_core-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: charms_core-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for charms_core-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 163fbfeb67fd55da2eb5a33a955621a13487f854d3d8e96780df96a7acc18bda
MD5 607d8e5ddeec767873e1a6233c33c03f
BLAKE2b-256 109654ea262d5ec5d23c9d20e40ebc034e13720c642f9f923773e3838e7b7d74

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page