aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configs/users/fcuny/llm/templates/commit-prompt.yaml25
-rw-r--r--configs/users/fcuny/llm/templates/pr-prompt.yaml15
-rw-r--r--configs/users/fcuny/llm/templates/readme-gen.yaml6
-rw-r--r--flake/overlays.nix1
-rw-r--r--home/profiles/llm.nix33
-rw-r--r--home/profiles/mac.nix2
-rw-r--r--home/profiles/secrets.nix12
-rw-r--r--home/programs/emacs/default.nix2
-rw-r--r--home/programs/emacs/init.el1
-rw-r--r--home/programs/emacs/site-lisp/init-llm.el33
-rw-r--r--pkgs/llmPython/default.nix84
-rw-r--r--secrets/secrets.nix6
12 files changed, 1 insertions, 219 deletions
diff --git a/configs/users/fcuny/llm/templates/commit-prompt.yaml b/configs/users/fcuny/llm/templates/commit-prompt.yaml
deleted file mode 100644
index f9a2752..0000000
--- a/configs/users/fcuny/llm/templates/commit-prompt.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-model: claude-3.7-sonnet
-prompt: >
- Write a concise, informative commit message for these changes:
- - Review the whole context of the diff carefully to see what effect the change would have on the rest of the code and explain that. Be specific about the effect.
- - Do not guess about intent.
- - The goal of this commit message is that someone familiar with the codebase, but not with these changes would understand why the changes were made and what was changed.
- - The first line should be a short summary of the changes
- - Remember to mention the files that were changed, and what was changed
- - Explain the 'why' behind changes
- - Use bullet points for multiple changes
- - Tone: Use some emojis, be funny, and expressive, but stay professional
- - If there are no changes, or the input is blank - then return a blank string
-
- Think carefully about what would be most helpful to someone trying to understand the intent of this commit before you write your commit message. Your commit message will be used as an example to train other team members about the content of a good commit message.
-
- The output format should be:
-
- Summary of changes
- - changes
- - changes
- and so on
-
- What you write will be passed directly to git commit -m "[message]"
-
- Here's the input: $input
diff --git a/configs/users/fcuny/llm/templates/pr-prompt.yaml b/configs/users/fcuny/llm/templates/pr-prompt.yaml
deleted file mode 100644
index 53671ba..0000000
--- a/configs/users/fcuny/llm/templates/pr-prompt.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-model: claude-3.7-sonnet
-prompt: >
- Write a clear, informative pull request message in markdown:
-
- * Start with a summary
- * Remember to mention the files that were changed, and what was changed
- * Explain the 'why' behind changes
- * Include a bulleted list to outline all of the changes
- * If there are no changes, or the input is blank - then return a blank string
-
- Think carefully before you write your pull request body.
-
- What you write will be passed to create a github pull request
-
- Text to use for the pull request message: $input
diff --git a/configs/users/fcuny/llm/templates/readme-gen.yaml b/configs/users/fcuny/llm/templates/readme-gen.yaml
deleted file mode 100644
index 585aaf2..0000000
--- a/configs/users/fcuny/llm/templates/readme-gen.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-system: You are a senior product engineer. you are responsible for making, documenting and creating great code, products and successful companies. write a readme for this repo in markdown. my github username is fcuny.
- - Use emojis.
- - Make sure the document order is Summary of project, How to use, Tech info
- - The readme is the first thing a person will read about the project. Be thorough.
- - Use markdown formatting.
- - Use code blocks for code.
diff --git a/flake/overlays.nix b/flake/overlays.nix
index 1429138..e38f0e5 100644
--- a/flake/overlays.nix
+++ b/flake/overlays.nix
@@ -2,7 +2,6 @@
{
flake.overlays.default = _final: prev: {
- llmPython = prev.callPackage "${self}/pkgs/llmPython/" { };
sapi = prev.callPackage "${self}/pkgs/sapi" { };
hashi = prev.callPackage "${self}/pkgs/hashi" { };
};
diff --git a/home/profiles/llm.nix b/home/profiles/llm.nix
deleted file mode 100644
index 2793373..0000000
--- a/home/profiles/llm.nix
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- configPath,
- lib,
- ...
-}:
-let
- basePath = "llm/templates";
- llmTemplates = [
- "pr-prompt.yaml"
- "commit-prompt.yaml"
- "readme-gen.yaml"
- ];
- mkLlmTemplate = file: {
- ".config/${basePath}/${file}" = {
- source = "${configPath}/${basePath}/${file}";
- };
- };
-in
-{
- home.file = lib.mkMerge (map mkLlmTemplate llmTemplates);
-
- programs.fish = {
- shellAliases = {
- commit-msg = "git diff --cached | llm -t commit-prompt";
- pr-msg = "git diff HEAD | llm -t pr-prompt";
- readme-gen = "llm -t readme-gen";
- };
- };
-
- home.sessionVariables = {
- LLM_USER_PATH = "$HOME/.config/llm";
- };
-}
diff --git a/home/profiles/mac.nix b/home/profiles/mac.nix
index 66270c1..564ff23 100644
--- a/home/profiles/mac.nix
+++ b/home/profiles/mac.nix
@@ -15,7 +15,6 @@
"${self}/home/programs/ssh.nix"
"${self}/home/programs/starship.nix"
"${self}/home/programs/tmux.nix"
- ./llm.nix
./secrets.nix
];
@@ -32,7 +31,6 @@
dust
jless
jq
- llmPython.llm # llm and claude support
nil # nix lsp
nix-direnv # integration with direnv
nixfmt-rfc-style # new formatter
diff --git a/home/profiles/secrets.nix b/home/profiles/secrets.nix
index 65131df..986a9e9 100644
--- a/home/profiles/secrets.nix
+++ b/home/profiles/secrets.nix
@@ -1,17 +1,7 @@
-{ self, config, ... }:
+{ config, ... }:
{
age = {
identityPaths = [ "${config.home.homeDirectory}/.ssh/agenix" ];
secretsDir = "${config.home.homeDirectory}/.local/share/agenix";
-
- secrets = {
- llm = {
- file = "${self}/secrets/users/fcuny/llm.age";
- path = "${config.home.homeDirectory}/.config/llm/keys.json";
- };
- anthropic-api-key = {
- file = "${self}/secrets/users/fcuny/anthropic-api-key.age";
- };
- };
};
}
diff --git a/home/programs/emacs/default.nix b/home/programs/emacs/default.nix
index c20f3da..7f00bf8 100644
--- a/home/programs/emacs/default.nix
+++ b/home/programs/emacs/default.nix
@@ -27,7 +27,6 @@ let
git-link
go-mode
gotest
- gptel # LLM client for Emacs
hcl-mode
jq-mode
json-mode
@@ -53,7 +52,6 @@ let
"init.el"
"site-lisp/init-base.el"
"site-lisp/init-completion.el"
- "site-lisp/init-llm.el"
"site-lisp/init-programming.el"
"site-lisp/init-text.el"
"site-lisp/init-ui.el"
diff --git a/home/programs/emacs/init.el b/home/programs/emacs/init.el
index 973e4ad..b19f78a 100644
--- a/home/programs/emacs/init.el
+++ b/home/programs/emacs/init.el
@@ -16,7 +16,6 @@
(require 'init-completion)
(require 'init-text)
(require 'init-programming)
-(require 'init-llm)
(use-package server
:config
diff --git a/home/programs/emacs/site-lisp/init-llm.el b/home/programs/emacs/site-lisp/init-llm.el
deleted file mode 100644
index 48346e6..0000000
--- a/home/programs/emacs/site-lisp/init-llm.el
+++ /dev/null
@@ -1,33 +0,0 @@
-;;; init-llm.el --- Configure LLMs -*- lexical-binding: t -*-
-;; Author: Franck Cuny <franck@fcuny.net>
-
-;;; Commentary:
-
-;; Configure completions
-
-;;; Code:
-(require 's)
-
-(defun fcuny/read-anthropic-key ()
- "Read and return the API key for anthropic."
- (with-temp-buffer
- (insert-file-contents "~/.local/share/agenix/anthropic-api-key")
- (s-trim (buffer-string))))
-
-(use-package gptel
- :custom
- (gptel-default-mode 'org-mode)
- :config
- (gptel-make-anthropic "Claude" :stream t :key (lambda () (fcuny/read-anthropic-key))))
-
-(use-package aidermacs
- :bind ("C-c a" . aidermacs-transient-menu)
- :custom
- (aider-args '("--no-check-update" "--no-show-model-warnings"))
- (aidermacs-default-model "claude-3-7-sonnet-latest")
- :config
- (setenv "ANTHROPIC_API_KEY" (fcuny/read-anthropic-key)))
-
-(provide 'init-llm)
-
-;;; init-llm.el ends here
diff --git a/pkgs/llmPython/default.nix b/pkgs/llmPython/default.nix
deleted file mode 100644
index b62bcb4..0000000
--- a/pkgs/llmPython/default.nix
+++ /dev/null
@@ -1,84 +0,0 @@
-{
- pkgs,
- lib,
- ...
-}:
-let
- # Define all packages in a recursive attribute set
- pythonPackages = rec {
- llm = pkgs.python3.pkgs.buildPythonPackage rec {
- pname = "llm";
- version = "0.24.2";
- format = "setuptools";
-
- src = pkgs.fetchurl {
- url = "https://files.pythonhosted.org/packages/source/l/llm/llm-0.24.2.tar.gz";
- sha256 = "sha256-4U8nIhg4hM4JaSIBtUzdlhlCSS8Nk8p0mmLQKzuL9Do=";
- };
-
- # Dependencies
- propagatedBuildInputs = with pkgs.python3.pkgs; [
- pyyaml
- click
- click-default-group
- condense-json
- openai
- pip
- pluggy
- puremagic
- pydantic
- python-ulid
- setuptools
- sqlite-migrate
- sqlite-utils
- ];
-
- # Disable tests - enable if you have specific test dependencies
- doCheck = false;
-
- # Basic import check
- pythonImportsCheck = [ "llm" ];
-
- meta = with lib; {
- description = "CLI utility and Python library for interacting with Large Language Models from organizations like OpenAI, Anthropic and Gemini plus local models installed on your own machine.";
- homepage = "https://github.com/simonw/llm";
- license = licenses.asl20;
- };
- };
-
- # Note, these are available in nixpkgs unstable, but are still behind the latest versions
- llm-anthropic = pkgs.python3.pkgs.buildPythonPackage rec {
- pname = "llm-anthropic";
- version = "0.15.1";
- format = "pyproject";
-
- src = pkgs.fetchurl {
- url = "https://files.pythonhosted.org/packages/source/l/llm_anthropic/llm_anthropic-0.15.1.tar.gz";
- sha256 = "sha256-C8xNs4oS51YxAn1iJkk8j4sJ5dO0pVOwIiP4mv/MnQk=";
- };
-
- nativeBuildInputs = with pkgs.python3.pkgs; [
- setuptools
- wheel
- ];
- # Dependencies
- propagatedBuildInputs = with pkgs.python3.pkgs; [
- anthropic
- llm # Use the llm we defined above
- ];
-
- # Disable tests - enable if you have specific test dependencies
- doCheck = false;
-
- # Basic import check
- pythonImportsCheck = [ "llm_anthropic" ];
-
- meta = with lib; {
- description = "LLM access to models by Anthropic, including the Claude series";
- homepage = "https://github.com/simonw/llm-anthropic";
- license = licenses.asl20;
- };
- };
- };
-in
-pythonPackages
diff --git a/secrets/secrets.nix b/secrets/secrets.nix
index 0aa5bc8..b54fd77 100644
--- a/secrets/secrets.nix
+++ b/secrets/secrets.nix
@@ -9,12 +9,6 @@ let
};
in
{
- "users/fcuny/llm.age".publicKeys = [
- users.fcuny
- ];
- "users/fcuny/anthropic-api-key.age".publicKeys = [
- users.fcuny
- ];
"restic_password.age".publicKeys = [
users.fcuny
hosts.vm-synology