{"id":21931425,"url":"https://github.com/mimiquate/candlex","last_synced_at":"2025-08-27T01:46:39.284Z","repository":{"id":203585794,"uuid":"709833377","full_name":"mimiquate/candlex","owner":"mimiquate","description":"An Nx backend for candle machine learning framework","archived":false,"fork":false,"pushed_at":"2025-03-25T13:46:52.000Z","size":837,"stargazers_count":47,"open_issues_count":19,"forks_count":2,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-31T06:02:01.204Z","etag":null,"topics":["elixir-nx","machine-learning"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/candlex","language":"Elixir","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/mimiquate.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-25T13:42:41.000Z","updated_at":"2025-02-22T14:53:54.000Z","dependencies_parsed_at":"2023-10-30T13:38:29.863Z","dependency_job_id":"584dfc9a-9019-4d05-be24-dbd790b2983a","html_url":"https://github.com/mimiquate/candlex","commit_stats":{"total_commits":179,"total_committers":3,"mean_commits":"59.666666666666664","dds":0.4692737430167597,"last_synced_commit":"0bce6ad55e489c9e815412a53bba166aab28634a"},"previous_names":["mimiquate/candlex"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mimiquate%2Fcandlex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mimiquate%2Fcandlex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mimiquate%2Fcandlex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mimiquate%2Fcandlex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mimiquate","download_url":"https://codeload.github.com/mimiquate/candlex/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247608151,"owners_count":20965952,"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":["elixir-nx","machine-learning"],"created_at":"2024-11-28T23:13:52.602Z","updated_at":"2025-04-07T07:08:52.468Z","avatar_url":"https://github.com/mimiquate.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Candlex\n\n[![ci](https://github.com/mimiquate/candlex/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/mimiquate/candlex/actions?query=branch%3Amain)\n[![Hex.pm](https://img.shields.io/hexpm/v/candlex.svg)](https://hex.pm/packages/candlex)\n[![Docs](https://img.shields.io/badge/docs-gray.svg)](https://hexdocs.pm/candlex)\n\nAn `Nx` [backend](https://hexdocs.pm/nx/Nx.html#module-backends) for candle ([docs](https://huggingface.github.io/candle), [repo](https://github.com/huggingface/candle), [crate](https://crates.io/crates/candle-core)) machine learning framework\n\n## Installation\n\nIf [available in Hex](https://hex.pm/docs/publish), the package can be installed\nby adding `candlex` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:candlex, \"~\u003e 0.1.10\"}\n  ]\nend\n```\n\nDocumentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)\nand published on [HexDocs](https://hexdocs.pm). Once published, the docs can\nbe found at \u003chttps://hexdocs.pm/candlex\u003e.\n\n## Usage\n\nJust configure Nx to default to Candlex backend in your configuration:\n\n```elixir\n# Possibly config/runtime.exs\n\nconfig :nx, default_backend: Candlex.Backend\n```\n\nor in your scripts, precede all your Nx operations with:\n\n```elixir\nNx.default_backend(Candlex.Backend)\n```\n\nMore details in [Nx backends](https://hexdocs.pm/nx/Nx.html#module-backends)\n\n#### `CANDLEX_NIF_BUILD`\n\nDefaults to `false`. If `true` the native binary is built locally, which may be useful\nif no precompiled binary is available for your target environment. Once set, you\nmust run `mix deps.clean candlex --build` explicitly to force to recompile.\nBuilding has a number of dependencies, see *Building from source* below.\n\n#### `CANDLEX_NIF_TARGET`\n\nThe default value is `cpu`, which implies the final the binary supports targeting\nonly the host CPU.\n\n| Value | Target environment |\n| --- | --- |\n| cpu | |\n| cuda | CUDA 12.x |\n\nTo use Candlex with NVidia GPU you need [CUDA](https://developer.nvidia.com/cuda-downloads) compatible with your\nGPU drivers.\n\n## Building from source\n\nTo build the native binary locally you need to set `CANDLEX_NIF_BUILD=true`.\nKeep in mind that the compilation usually takes time.\n\nYou will need the following installed in your system for the compilation:\n\n  * [Git](https://git-scm.com) for fetching candle-core source\n  * [Rust](https://www.rust-lang.org) with cargo to compile rustler NIFs\n\n### GPU support\n\nTo build native binary with GPU support, you need to run in an environment that has CUDA installed,\nthen you can build with `CANDLEX_NIF_TARGET=cuda`. See the `CANDLEX_NIF_TARGET` for more details.\n\n## Releasing\n\nTo publish a new version of this package:\n\n1. Update version in `mix.exs`, `.github/workflows/binaries.yml` and `README.md`.\n1. `git commit -am \"build: bump version to \u003ctag-version\u003e\"`\n1. `git tag -s \u003ctag-version\u003e` to create new signed tag.\n1. `git push origin \u003ctag-version\u003e` to push the tag.\n1. Wait for the `binaries.yml` GitHub workflow to build all the NIF binaries.\n1. Publish the newly created draft release in GitHub (the download won't find the binaries otherwise).\n1. `mix rustler_precompiled.download Candlex.Native --all --print` to generate binaries checksums locally.\n1. `rm -r native/candlex/target priv/native` to leave out rust crate build artifacts from published elixir package.\n1. `mix hex.build --unpack` to check the package includes the correct files.\n1. `mix hex.publish` to publish package to Hex.pm.\n1. `git push origin main`\n\n## License\n\nCopyright 2023 Mimiquate\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmimiquate%2Fcandlex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmimiquate%2Fcandlex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmimiquate%2Fcandlex/lists"}