Archived
1
0
Fork 0

Compare commits

...

2 commits

Author SHA1 Message Date
011d3f8111
Add custom instructions for AI 2025-07-02 04:12:43 -05:00
cfeb71b99c
Improve AI 2025-07-02 03:50:48 -05:00

View file

@ -1,5 +1,11 @@
{ pkgs, spicetify-nix, ... }:
let
localFastModel = "qwen2.5-coder-num_ctx";
localReasoningModel = "deepseek-r1-num_ctx";
remoteFastModel = "deepseek/deepseek-chat-v3-0324:free"; # "qwen/qwen-2.5-coder-32b-instruct:free";
remoteReasoningModel = "deepseek/deepseek-r1-0528:free";
in
{
home = {
stateVersion = "23.11";
@ -44,6 +50,14 @@
external.enable = true;
};
};
shellAliases = {
aichat_reasoning_remote = "aichat --model openrouter:${remoteReasoningModel}";
aichat_reasoning_local = "aichat --model ollama:${localReasoningModel}";
aichat_fast_remote = "aichat --model openrouter:${remoteFastModel}";
aichat_fast_local = "aichat --model ollama:${localFastModel}";
codex_remote = "codex --provider openrouter --model ${remoteFastModel}";
codex_local = "codex --provider ollama --model ${localFastModel}";
};
};
starship = {
enable = true;
@ -68,8 +82,44 @@
};
codex = {
enable = true;
custom-instructions = ''
## 10. Applying Patch Files with patch
When the built-in `apply_patch` tool or `git apply` fails to apply a diff/patch file (especially if the file being patched contains special characters that might confuse simpler patch tools), the standard `patch` utility can be a more robust alternative.
- **Patch File Format**: Ensure your patch file is in a standard unified diff format. Typically, these patches are generated with `git diff > my_feature.patch` or manually crafted. If the patch refers to files with `a/` and `b/` prefixes (e.g., `--- a/file.txt`, `+++ b/file.txt`), you'll use the `-p1` option.
- **Creating the Patch File**: You can create a patch file using shell redirection, for example:
```bash`
cat <<'EOF' > fix_descriptive_name.patch
--- a/path/to/your/file.ext
+++ b/path/to/your/file.ext
@@ -line_num,num_lines +line_num,num_lines @@ context_or_change
-old_line_content
+new_line_content
EOF
```
*Important*: Ensure the `EOF` marker is on its own line with no trailing spaces.
- **Applying the Patch**: Use the `patch` command via the `shell` tool. The `-p1` option strips the leading component from file paths in the patch file (`a/`, `b/`).
```
# Example: Apply a patch file
default_api.shell(command=["sh", "-c", "patch -p1 < fix_descriptive_name.patch"])
```
- **Verification**: After applying, always verify that the target file has been changed as expected (e.g., using `cat` or `git diff`).
- **Cleanup**: Remove the patch file if it's no longer needed:
```
default_api.shell(command=["rm", "fix_descriptive_name.patch"])
```
'';
settings = {
model = "qwen2.5-coder";
model = "${localFastModel}";
provider = "ollama";
providers = {
ollama = {
@ -88,7 +138,7 @@
aichat = {
enable = true;
settings = {
model = "ollama:qwen2.5-coder:latest";
model = "ollama:${localFastModel}";
clients = [
{
type = "openai-compatible";
@ -96,12 +146,12 @@
api_base = "http://localhost:11434/v1";
models = [
{
name = "qwen2.5-coder:latest";
name = "${localFastModel}";
supports_function_calling = true;
supports_vision = true;
}
{
name = "deepseek-r1:latest";
name = "${localReasoningModel}";
supports_function_calling = true;
supports_vision = true;
}
@ -113,12 +163,12 @@
api_base = "https://openrouter.ai/api/v1";
models = [
{
name = "qwen/qwen-2.5-coder-32b-instruct:free";
name = "${remoteFastModel}";
supports_function_calling = true;
supports_vision = true;
}
{
name = "deepseek/deepseek-r1-0528:free";
name = "${remoteReasoningModel}";
supports_function_calling = true;
supports_vision = true;
}