{"id":18519978,"url":"https://github.com/tf-encrypted/moose","last_synced_at":"2025-05-08T21:25:22.129Z","repository":{"id":37696775,"uuid":"257892054","full_name":"tf-encrypted/moose","owner":"tf-encrypted","description":"Secure distributed dataflow framework for encrypted machine learning and data processing","archived":false,"fork":false,"pushed_at":"2024-03-20T16:32:35.000Z","size":46656,"stargazers_count":61,"open_issues_count":110,"forks_count":16,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-02-02T03:51:12.723Z","etag":null,"topics":["cryptography","data-science","distributed-computing","machine-learning","privacy","secure-computation"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tf-encrypted.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-22T12:16:15.000Z","updated_at":"2025-01-20T08:37:05.000Z","dependencies_parsed_at":"2023-02-09T10:01:00.424Z","dependency_job_id":null,"html_url":"https://github.com/tf-encrypted/moose","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tf-encrypted%2Fmoose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tf-encrypted%2Fmoose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tf-encrypted%2Fmoose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tf-encrypted%2Fmoose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tf-encrypted","download_url":"https://codeload.github.com/tf-encrypted/moose/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238044095,"owners_count":19407128,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cryptography","data-science","distributed-computing","machine-learning","privacy","secure-computation"],"created_at":"2024-11-06T17:18:09.437Z","updated_at":"2025-02-10T02:09:30.390Z","avatar_url":"https://github.com/tf-encrypted.png","language":"Rust","funding_links":[],"categories":["Software"],"sub_categories":["Retired software"],"readme":"# Moose\n\n[![crate][crate-image]][crate-link]\n[![Docs][docs-image]][docs-link]\n[![PyDocs][pydocs-image]][pydocs-link]\n[![Build Status][build-image]][build-link]\n[![Apache2 License 2.0][license-image]][license-link]\n[![Minimum rustc version][rustc-image]][rustc-link]\n[![Downloads][downloads-image]][crate-link]\n\nMoose is a secure distributed dataflow framework consisting of a compiler, runtime, and Python eDSL and bindings. It is suitable for, but not limited to, encrypted machine learning and data processing. It's production ready and written primarily in Rust.\n\nComputations are expressed using either the eDSL or by programming against the Rust API. Each operation in the dataflow graphs are pinned to a placement which represents either a physical machine or one of several kinds of virtual execution units. Moose currently includes support for simpler machine learning models, and a virtual placement backed by secure multi-party computation (MPC) in the form of replicated secret sharing. Please see [docs.rs](https://docs.rs/moose/), [examples](https://github.com/tf-encrypted/moose/tree/main/pymoose/examples), [tutorials](https://github.com/tf-encrypted/moose/tree/main/tutorials), or our [whitepaper](https://github.com/tf-encrypted/moose-whitepaper) for more details.\n\nMoose is a community driven open source project and contributions are more than welcome. Moose was created at Cape.\n\n## Example\n\nThe following is a simple example using the Python eDSL and bindings to express and evaluate an encrypted computation using replicated secret sharing.\n\n```python\nimport numpy as np\nimport pymoose as pm\n\nalice = pm.host_placement(\"alice\")\nbob = pm.host_placement(\"bob\")\ncarole = pm.host_placement(\"carole\")\nreplicated = pm.replicated_placement(\"rep\", players=[alice, bob, carole])\n\n@pm.computation\ndef simple_computation(\n    x: pm.Argument(placement=alice, vtype=pm.TensorType(pm.float64)),\n    y: pm.Argument(placement=bob, vtype=pm.TensorType(pm.float64)),\n):\n    with alice:\n        x = pm.cast(x, dtype=pm.fixed(14, 23))\n\n    with bob:\n        y = pm.cast(y, dtype=pm.fixed(14, 23))\n\n    with replicated:\n        z = pm.add(x, y)\n\n    with carole:\n        v = pm.cast(z, dtype=pm.float64)\n\n    return v\n\nruntime = pm.GrpcMooseRuntime({\n    alice: \"localhost:50000\",\n    bob: \"localhost:50001\",\n    carole: \"localhost:50002\",\n})\nruntime.set_default()\n\nresult = my_computation(\n    x=np.array([1.0, 2.0], dtype=np.float64),\n    y=np.array([3.0, 4.0], dtype=np.float64),\n)\nprint(result)\n```\n\nMake sure to have three instances of Comet running before running the Python code:\n\n```sh\ncomet --identity localhost:50000 --port 50000\ncomet --identity localhost:50001 --port 50001\ncomet --identity localhost:50002 --port 50002\n```\n\nIn this example the inputs are provided by the Python script but Moose also supports loading data locally from e.g. NumPy files.\n\n\n## Installation\n\nMoose is packaged in two ways: the Python eDSL and bindings, and the CLI tools. In a typical use case you might want to install the Python bindings on your laptop and the CLI tools on the servers running in the distributed cluster (or use the [Docker image](https://hub.docker.com/r/tfencrypted/moose)).\n\nInstall the Python eDSL and bindings using:\n\n```sh\npip install moose-python\n```\n\nInstall the CLI tools using (assuming you already have [Rust installed](https://www.rust-lang.org/learn/get-started)):\n\n```sh\ncargo install moose\n```\n\nYou will also need to have OpenBLAS installed in both cases:\n\n- Debian/Ubuntu: `sudo apt install libopenblas-dev`\n\n- macOS: `homebrew install openblas`\n\nAlternatively, you can install from the source code as described in [DEVELOP.md](https://github.com/tf-encrypted/moose/tree/main/DEVELOP.md).\n\n## License\n\nMoose is distributed under the terms of Apache License (Version 2.0). Copyright as specified in [NOTICE](https://github.com/tf-encrypted/moose/tree/main/NOTICE).\n\n\n[//]: # (badges)\n\n\n[crate-image]: https://img.shields.io/crates/v/moose.svg\n[crate-link]: https://crates.io/crates/moose\n[docs-image]: https://docs.rs/moose/badge.svg\n[docs-link]: https://docs.rs/moose\n[pydocs-image]: https://img.shields.io/readthedocs/pymoose?label=pydocs\n[pydocs-link]: https://pymoose.readthedocs.io\n[build-image]: https://github.com/tf-encrypted/moose/workflows/CI/badge.svg\n[build-link]: https://github.com/tf-encrypted/moose/actions\n[license-image]: https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat\n[license-link]: https://www.apache.org/licenses/LICENSE-2.0\n[rustc-image]: https://img.shields.io/badge/rustc-1.56+-blue.svg\n[rustc-link]: https://github.com/tf-encrypted/moose#rust-version-requirements\n[downloads-image]: https://img.shields.io/crates/d/moose.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftf-encrypted%2Fmoose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftf-encrypted%2Fmoose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftf-encrypted%2Fmoose/lists"}