Skip to main content

Silver

Silver is a small, inspectable language and machine-learning toolkit for Python.

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.9 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-0.4.0.tar.gz (55.6 kB view details)

Uploaded Source

Built Distribution

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

silver_lang-0.4.0-py3-none-any.whl (42.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for silver_lang-0.4.0.tar.gz
Algorithm Hash digest
SHA256 ff07d0b9d185a491e6935cad73c57e3471699545b0e3fb52442be04add3d848f
MD5 24b7b2e41a91f9172f79629b8c636bd0
BLAKE2b-256 eb7c534df323c28383306bf2682b6953a3160ae5a0c562e06672481208152fa3

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: silver_lang-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 42.8 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-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c52305074e2fea3cba04c4320ff167af64bb38fef644b402ca0a6ae331ebefed
MD5 d32058fb604a46e44275163002545061
BLAKE2b-256 2851a88cc54f2951b2f06d5f9f048f548cae5d9bc65878a610bf2226d17393d3

See more details on using hashes here.

Provenance

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

1.0.0

2 files

This release

0.4.0 This release

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