-
Notifications
You must be signed in to change notification settings - Fork 10.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add flake app to run openai proxy #4612
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,6 +110,15 @@ | |
type = "app"; | ||
program = "${self.packages.${system}.default}/bin/llama-server"; | ||
}; | ||
apps.llama-server-openai-proxy = { | ||
type = "app"; | ||
program = "${ | ||
(let pythonWithPkgs = pkgs.python3.withPackages (ps: with ps; [ flask requests ]); | ||
in pkgs.writeShellScriptBin "run-openai-proxy" '' | ||
${pythonWithPkgs}/bin/python3 ${self}/examples/server/api_like_OAI.py | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could've been a |
||
'') | ||
}/bin/run-openai-proxy"; | ||
Comment on lines
+116
to
+120
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't suggest anything concrete right now, but it might be a good thing to do some form of |
||
}; | ||
apps.llama-embedding = { | ||
type = "app"; | ||
program = "${self.packages.${system}.default}/bin/embedding"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to mention this in #4605, but we wouldn't have had to manually wrap these in
apps
if we instead exposed them (in the overlay and) in packages/legacyPackages, and if we ensured thatmeta.mainProgram
s are set correctly (withwriteShellScriptBin
they are)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could now add this to
scope.nix
:llama.cpp/.devops/nix/scope.nix
Lines 7 to 12 in 4e1d251
This way the attribute would show up as
llamaPackages.llama-server-openai-proxy
in nixpkgs with the flake'soverlays.default
applied, as well as in the flake'slegacyPackages.${system}.llamaPackages
.