From 01a515dea2f49b0e12a2a4f79e456fc387ab9624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Mon, 12 Aug 2024 09:28:38 +0200 Subject: [PATCH] nix: add router to the devshell (#2396) --- flake.nix | 4 ++++ router.nix | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 router.nix diff --git a/flake.nix b/flake.nix index fdd67d00..1d14561f 100644 --- a/flake.nix +++ b/flake.nix @@ -70,6 +70,10 @@ torch transformers vllm + + (callPackage ./router.nix { + inherit (rustPlatform) buildRustPackage importCargoLock; + }) ]); venvDir = "./.venv"; diff --git a/router.nix b/router.nix new file mode 100644 index 00000000..eeeac199 --- /dev/null +++ b/router.nix @@ -0,0 +1,18 @@ +{ buildRustPackage, importCargoLock, pkg-config, protobuf, openssl }: + +buildRustPackage { + name = "text-generation-router"; + + src = ./.; + + sourceDir = ./backends/v3; + + cargoLock = { + lockFile = ./Cargo.lock; + }; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = [ openssl.dev protobuf ]; + +}