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.

License

CC BY-ND 4.0 — use and redistribute freely (other projects included) with attribution (charms-core, © ArioAtlas); no modified versions may be distributed. Provided as-is, without warranties or liability of any kind.

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.1.tar.gz (29.7 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.1-py3-none-any.whl (27.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: charms_core-0.1.1.tar.gz
  • Upload date:
  • Size: 29.7 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.1.tar.gz
Algorithm Hash digest
SHA256 81b41aa984e0e57630950f8bd83fa3a3627617dd71d6aef82572707ad74ff814
MD5 748ca9a3ffe46447f304a08d3627a3c7
BLAKE2b-256 c61aeb49720ee68782e171c58217a9c63c6959363afac40a3ffa517db0231b31

See more details on using hashes here.

File details

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

File metadata

  • Download URL: charms_core-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 27.4 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fcbc1cc61210b063a705e7a070be216d6efb6b1717eb03cb84c32ef628278000
MD5 63fb4761084e1b44ac7af1fac7550bee
BLAKE2b-256 15c31143c13e9f3570eb005f08d5fee7cca7a06a6773093fea97cae23db3c8b6

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