npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lovelace-ai/compute

v0.0.1

Published

Canonical Lattice Cloud compute types, catalog, and wire protocol

Downloads

286

Readme

@lovelace-ai/compute

Canonical Lattice Cloud compute catalog, protocol, metering, pricing, and client types.

Overview

This package is the shared compute contract for the Lattice gateway, developer portal, SDKs, and provider-facing code. It keeps task classes, runtime kinds, provider tiers, model catalog data, relay wire shapes, and metering units consistent across consumers. Use it when a boundary needs to agree on what a compute task is, how a provider advertises capability, how relay work is represented, or how usage should be priced and metered.

Import Surface

  • @lovelace-ai/compute exposes catalog helpers, task and modality schemas, relay protocol schemas, personal runtime protocol types, metering and pricing helpers, reputation scoring, revenue split helpers, and the Lattice Cloud client contract.
  • The package is a shared protocol library. Service startup, request routing, authentication, and persistence are owned by the gateway or consuming service.
  • Prefer this package over duplicated protocol definitions in app, SDK, or platform-test code.

Usage

Protocol consumers should validate incoming or outgoing wire payloads at the service boundary and use the shared helpers for catalog normalization.

import {
  RelayWorkSubmissionSchema,
  canonicalizeModelName,
} from "@lovelace-ai/compute";

const work = RelayWorkSubmissionSchema.parse(await request.json());
const model = canonicalizeModelName("gpt-4o-mini");

SDK consumers that need a typed client can use the exported Lattice Cloud client factory with explicit base URL and credential configuration.

Public API

The public API is the compute protocol. It covers catalog aliases, canonical task classes, provider relay messages, personal runtime messages, OpenAI-compatible chat shapes, usage meters, pricing, reputation, and revenue sharing. Any protocol change should update the gateway/service tests, SDK docs, and platform tests together because this package is the contract those surfaces share.

OpenAPI Contract

This package emits the canonical OpenAPI 3.1 document for the buyer-facing Lattice Cloud API. The TypeScript, Python, and Rust SDKs generate their wire cores from it. The gateway also merges it with generated gateway routes before it serves /openapi.json and /docs, so Scalar and the SDKs read the same compute contract without dropping public gateway callbacks. The document is assembled from the Zod schemas in this package (buildOpenApiDocument and the LATTICE_CONTRACT route manifest in src/contract.ts) and committed at contract/openapi.json.

  • Regenerate after changing the contract: pnpm exec turbo run contract:emit --filter=@lovelace-ai/compute --concurrency=2.
  • Check for drift: pnpm exec turbo run contract:check --filter=@lovelace-ai/compute --concurrency=2.

The document is a build artifact — never hand-edit contract/openapi.json.

Development

Run package typechecking from the repository root with pnpm exec turbo run typecheck --filter=@lovelace-ai/compute --concurrency=2. Run linting with pnpm exec turbo run lint --filter=@lovelace-ai/compute --concurrency=2. Run tests with pnpm exec turbo run test --filter=@lovelace-ai/compute --concurrency=2 -- --maxWorkers=2. Update this README when top-level usage, import boundaries, or package ownership changes. Use generated API documentation for symbol-level detail instead of duplicating export catalogs here.

Related Documentation

License

MIT