Skip to main content

Silver

Silver — inspectable machine learning

PyPI CI Ecosystem Apache-2.0

One local-first, inspectable path from raw data to a trained model—and a language/runtime for understanding every layer underneath it.

Silver 1.0 gives you dataset contracts, stratified splits, leakage-safe preprocessing, real PyTorch training, durable experiment journals, best checkpoints, drift detection, health scoring, framework adapters, and compiler traces without requiring a hosted control plane.

The 60-second path

python -m pip install 'silver-lang[ecosystem]'
silver init my-first-silver-project
cd my-first-silver-project
silver experiment silver-project.json

That command produces a model checkpoint, dataset contract, replayable JSONL run journal, drift report, training-health assessment, and consolidated JSON report under .silver/.

silver doctor
silver runs .silver/runs
silver health metrics.json

Why people keep Silver in the loop

Need Silver 1.0
Know whether serving data still matches training Portable contracts and explainable drift signals
Train without hiding the loop Deterministic PyTorch trainer with callbacks and best-state restoration
Track experiments without deploying a server Atomic checkpoints and append-only local run journals
Understand why training is unhealthy Scored diagnostics with ranked remediation actions
Connect existing tools safely Discoverable adapters and shell-free JSONL subprocess bridges
See what code actually becomes Lexer → AST → IR → optimizer → bytecode → VM traces

The Silver ecosystem also includes lightweight Python packages for datasets, training lifecycles, diagnostics, and bridges to PyTorch, TensorFlow, Keras, notebooks, and remote jobs. Start with Choose your Silver path to install only what your project needs.

It is for people who want to see what a program, model, compiler, or agent is doing instead of handing the important parts to opaque infrastructure. Silver keeps source structure, intermediate representations, tensor operations, execution traces, and model metadata available to the caller.

Silver is useful for:

  • teaching language runtimes, compilers, autodiff, and neural networks;
  • building deterministic experiments and replayable agent workflows;
  • inspecting a model while it runs, not only reading its final prediction;
  • prototyping small Python tools without a large native ML dependency;
  • explaining how a larger architecture is organized before choosing a heavy production backend.

It is not a replacement for PyTorch, TensorFlow, or a hosted model service. Some larger architecture APIs are deliberately inspectable blueprints. The executable reference path currently focuses on the language runtime, tensors, autodiff, dense classifiers, ML source compilation, and TinyGPT.

Install From PyPI

python -m pip install silver-lang

Requirements: Python 3.10 or newer.

First Program

from silverlang import build_pipeline, run_source

source = """
fn main():
    value = 6 * 7
    return value
"""

print(run_source(source).value)
print(build_pipeline(source).to_json())

The runtime supports functions, assignments, integer literals, variables, arithmetic, returns, deterministic traces, tokenization, source digests, and execution manifests. Use explain() when you want to understand what happened, not only get a value back.

A Small ML Experiment

The executable reference implementation is Python:

from silverlang import build_pipeline

artifacts = build_pipeline(source)
print(artifacts.to_json())

Inspectable ML

The native ML implementation includes deterministic dense layers, ReLU, sigmoid and linear activations, softmax classifier output, single-sample SGD, cross-entropy training, tensor operations, reverse-mode autodiff, neuron inspection, model graphs, tensor graph metadata, gradient checks, named datasets, deterministic TinyGPT generation, and virtual large-model profiles.

from silverlang.ml.tensor import Tensor

tensor = Tensor.vector_grad(1, -2, 3).relu().sum()
tensor.backward()
print(tensor.inspect())

The package also has blueprints for Transformer, recurrent, CNN, autoencoder, GAN, diffusion, mixture-of-experts, retrieval-augmented, and hybrid systems. These describe components, dimensions, estimated scale, and composition boundaries. They do not allocate or train those large architectures yet.

For a model-level explanation, use the computed inspection and translation helpers:

from silverlang import teach_network

study = teach_network()
print(study.summary)

Try the CLI

silver run program.sv

The CLI prints a deterministic execution manifest as JSON, which makes a small Silver program easy to inspect in a terminal or CI job.

Test Before Publishing

Friends can test the exact package artifacts without publication:

python -m pip install -e '.[dev]'
python -m pytest
python -m build

The companion packages are built from their own directories:

python build_packages.py

The generated wheels and source archives can then be installed by a separate Python project.

Develop Silver

python -m pip install -e '.[dev]'
python -m pytest
python -m build

The test suite exercises the Python compiler, VM, runtime, and ML paths. See CONTRIBUTING.md for the contributor workflow and docs/index.md for topic-focused guides.

Publish the Package Family

The root checkout is an umbrella repository. Export the six standalone package repositories with:

python scripts/export_repositories.py --owner YOUR_GITHUB_OWNER

The script creates local repositories with package-specific CI and PyPI release workflows. It never creates remotes or pushes credentials. Follow docs/publishing.md for the exact GitHub and PyPI steps.

Public API

See the supervised-learning cookbook for a complete dataset-to-model-to-GPU-to-diagnostics example covering the package family.

The root silverlang package exports the lexer, parser, compiler pipeline, stack VM, runtime traces, visualization helpers, agent/workbench helpers, and the inspectable tensor and neural-network teaching modules. Lower-level modules include silverlang.frontend, silverlang.ir, silverlang.bytecode, silverlang.vm, and silverlang.ml.

Read docs/api.md for examples, docs/language/syntax.md for the language surface, and docs/ml/tiny-gpt.md for a small model walkthrough. See docs/ecosystem.md for the separate-package roadmap.

Project Boundaries

Silver favors a small reference implementation with visible contracts over a large dependency graph. The package includes language execution, compiler and bytecode inspection, a stack VM, memory utilities, graph and package models, replayable agent workflows, application planning, module loading, IDE models, and the native ML paths described above.

Specialized ML estimators such as Adam, unsupervised learning, reinforcement learning, regression, and full executable CNN, Transformer, GAN, and diffusion backends are future work. Contributions that make one of those paths real, tested, and explainable are especially valuable.

License

Silver is distributed under the Apache License 2.0.

Download files

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

Source Distribution

silver_lang-1.0.0.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

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

silver_lang-1.0.0-py3-none-any.whl (49.0 kB view details)

Uploaded Python 3

File details

Details for the file silver_lang-1.0.0.tar.gz.

File metadata

  • Download URL: silver_lang-1.0.0.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for silver_lang-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c22b0a76384a2ee6535cfc0fa54a37584a57c716aed8b633af1ae0a38c77305d
MD5 96381c4d20a538fa98b61bf4dcac3ad5
BLAKE2b-256 93e4190a22e0ca0ba641e76e0e2555664b8e189564b96fb0cc439cebf094d15d

See more details on using hashes here.

Provenance

The following attestation bundles were made for silver_lang-1.0.0.tar.gz:

Publisher: release.yml on adfgdartec/silver-lang

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file silver_lang-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: silver_lang-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 49.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for silver_lang-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1e93ca8be9a01dee36877d4ad11ecdf32c683c7cc97a8cfe05eacbab180bd336
MD5 a2c4a915242891664fc7e71ee1e65abd
BLAKE2b-256 2c6fbbc43eba33354f8d8dae0e32b6441a0152c32f3b12e81a7b15f187443cdf

See more details on using hashes here.

Provenance

The following attestation bundles were made for silver_lang-1.0.0-py3-none-any.whl:

Publisher: release.yml on adfgdartec/silver-lang

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.3.0

2 files

1.2.0

2 files

1.1.0

2 files

This release

1.0.0 This release

2 files

0.4.0

2 files

0.3.0

2 files

0.1.0

2 files

Supported by

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