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.1 gives you dataset contracts, stratified splits, leakage-safe preprocessing, real PyTorch training, durable experiment journals, best checkpoints, drift detection, health scoring, framework adapters, and a complete visual explanation of the network without requiring a hosted control plane.

The report also turns evidence into decisions: ranked fixes for data quality, architecture, optimization, and generalization, each with an expected effect and a verification test. Use silver decisions .silver/experiment-report.json when you want the guidance as JSON instead of HTML.

Every layer, explained

Neural-network inputs, hidden layers, activations, gradients, prediction, and training health

Every experiment now generates a standalone HTML dashboard plus six SVGs from the actual run: feature flow, observed network layers and activations, layer health, training health, and the durable run timeline. No hosted service and no invented telemetry. Read the visual report contract.

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, consolidated JSON, six evidence-backed SVGs, and .silver/visual-report.html.

silver doctor
silver runs .silver/runs
silver health metrics.json
silver report .silver/experiment-report.json

Why people keep Silver in the loop

Need Silver 1.1
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
See what every layer is doing Shapes, parameters, activations, sparsity, gradients, and layer-health visuals
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.2.0.tar.gz (3.4 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.2.0-py3-none-any.whl (52.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: silver_lang-1.2.0.tar.gz
  • Upload date:
  • Size: 3.4 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.2.0.tar.gz
Algorithm Hash digest
SHA256 e09060f20835f0d6b06ae81e88ce0dac83c17a9b0d2d208de2b3820f80709d6a
MD5 883fa3d6ac758f81246754f131e68397
BLAKE2b-256 865c1cc629aae8ddba1fa96ef797f5b21b8ef3efed78adf9bc5571db8fea19fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for silver_lang-1.2.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: silver_lang-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 52.9 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c75da027470e2f43105be1df4f62e94e80c91de2df6e701bee9cb87ed41367df
MD5 365d42d1ceb5b1c5c970077dc2957fe2
BLAKE2b-256 fa3db49b1e616bfcee5485974ce97d15d4a8215b60ab9a470c391505aa00a9db

See more details on using hashes here.

Provenance

The following attestation bundles were made for silver_lang-1.2.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

This release

1.2.0 This release

2 files

1.1.0

2 files

1.0.0

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