{"id":20236011,"url":"https://github.com/combust/mleap-rs","last_synced_at":"2025-04-10T19:01:51.685Z","repository":{"id":74304045,"uuid":"81644842","full_name":"combust/mleap-rs","owner":"combust","description":"Rust implementation of MLeap","archived":false,"fork":false,"pushed_at":"2017-04-07T04:09:33.000Z","size":111,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-24T16:42:23.628Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/combust.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-11T10:06:04.000Z","updated_at":"2021-08-08T03:57:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"4eecb13d-c07c-400f-a08f-60c22b69f1a3","html_url":"https://github.com/combust/mleap-rs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/combust%2Fmleap-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/combust%2Fmleap-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/combust%2Fmleap-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/combust%2Fmleap-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/combust","download_url":"https://codeload.github.com/combust/mleap-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248278610,"owners_count":21077275,"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":[],"created_at":"2024-11-14T08:18:42.850Z","updated_at":"2025-04-10T19:01:51.667Z","avatar_url":"https://github.com/combust.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MLeap on Rust\n\nMLeap is a runtime for executing machine learning pipelines created\nusing Spark, Scikit-learn or Tensorflow. It includes a JSON/Protobuf3\nserialization format as well as an execution engine for scoring results\nin realtime. It is focused on performance and portability.\n\nThe MLeap on Rust project aims to expand the capabilities of the\noriginal [MLeap](https://github.com/combust/mleap) by taking it off of the JVM.\n\n## Requirements\n\n1. Install [rustup](https://www.rustup.rs/)\n2. Install the stable rust: `rustup install stable`\n3. `git submodule init`\n4. `git submodule update`\n\n## Building\n\nAfter installing the stable version of rust with rustup, it is easy to\nbuild MLeap:\n\n```\ncargo build\n```\n\n## Running Tests\n\nThe tests require a pretrained Airbnb model that can be downloaded here:\n[airbnb.model.json.zip](https://s3-us-west-2.amazonaws.com/mleap-demo/airbnb.model.json.zip).\n\nOnce you have it downloaded:\n\n1. `mkdir /tmp/model`\n2. Copy the model file into `/tmp/model`\n3. Unzip the model file, the tests expect it to be here\n4. Make sure that `/tmp/model/bundle.json` exists. This is a good check\n   to make sure the model is good and was unzipped properly to the\n`/tmp/model` folder.\n5. `cargo test`\n\n## Examples\n\nThe tests are good examples for how to work with MLeap on Rust.\nTake look at [the tests](https://github.com/combust/mleap-rs/blob/master/src/bundle/mod.rs).\n\nThe tests will show how to build a LeapFrame from scratch, load a\ntransformer from an MLeap bundle, transform the LeapFrame and then\nextract a result.\n\n1. `test_airbnb` shows the Rust interface\n2. `test_airbnb_c` show the C native interface to the MLeap library\n\n## C Native Interface\n\nThe C native interface is a collection of C-compatible functions exposed\nby MLeap. It is defined in one file here: [c/mod.rs](https://github.com/combust/mleap-rs/blob/master/src/c/mod.rs).\n\nLeapFrames are passed as `*mut frame::LeapFrame`, these can just be\n`void *` in C code.\n\nTransformers are passed as `*mut Box\u003ctform::DefaultNode\u003e`, again, in C\ncode these can just be `void *` when declaring the method signature.\n\n### Resource/Memory Management\n\nThere are two methods that allocate resources:\n1. `mleap_frame_with_size` allocates a new LeapFrame\n2. `mleap_transformer_load` allocates a new Transformer\n\nIn order to free these resources when you are done, make sure to use\nthese two corresponding methods:\n\n1. `mleap_frame_free` to free a LeapFrame, this will also deallocate any\n   data stored in the columns\n2. `mleap_transformer_free` to free a Transformer\n\nForgetting to free resources will cause a memory leak.\n\n## .Net bindings\n\nThe `bindings/csharp` directory provide a prototype of .Net bindings\nfor MLeap, via its C interfaces.\n\nNB: The project files (`.csproj`, `.sln`) with a `.NetCore` suffix\ntarget the .Net Core platform whereas the ones without target the\nMicrosoft Windows CLR.\n\n### How to build for .NetCore\n\nCAUTION this was only tried on one local machine - adapt to you own system.\n\n1. Ensure you have installed .Net Core\n   `$ dotnet --version`\n2. Restore (or initialize) the .Net Core store\n   `bindings/csharp $ dotnet restore MLeap.NetCore.sln`\n3. Build the .Net package\n   `bindings/csharp $ dotnet pack MLeap.NetCore.sln`\n4. Make the MLeap-RS native library findable by the test\n   `bindings/csharp $ ln -s ../../target/debug/libmleap.dylib .\n\nPlease remind to copy the MLeap-RS native library to a location where\nit can be found at runtime (current directory for the MLeapTest\nexample, somewhere on your LD_LIBRARY_PATH, ...).\n\n\n   \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcombust%2Fmleap-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcombust%2Fmleap-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcombust%2Fmleap-rs/lists"}