Compare commits
2 commits
8a43bdca9a
...
011d3f8111
Author | SHA1 | Date | |
---|---|---|---|
011d3f8111 | |||
cfeb71b99c |
1 changed files with 56 additions and 6 deletions
|
@ -1,5 +1,11 @@
|
||||||
{ pkgs, spicetify-nix, ... }:
|
{ 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 = {
|
home = {
|
||||||
stateVersion = "23.11";
|
stateVersion = "23.11";
|
||||||
|
@ -44,6 +50,14 @@
|
||||||
external.enable = true;
|
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 = {
|
starship = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -68,8 +82,44 @@
|
||||||
};
|
};
|
||||||
codex = {
|
codex = {
|
||||||
enable = true;
|
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 = {
|
settings = {
|
||||||
model = "qwen2.5-coder";
|
model = "${localFastModel}";
|
||||||
provider = "ollama";
|
provider = "ollama";
|
||||||
providers = {
|
providers = {
|
||||||
ollama = {
|
ollama = {
|
||||||
|
@ -88,7 +138,7 @@
|
||||||
aichat = {
|
aichat = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
model = "ollama:qwen2.5-coder:latest";
|
model = "ollama:${localFastModel}";
|
||||||
clients = [
|
clients = [
|
||||||
{
|
{
|
||||||
type = "openai-compatible";
|
type = "openai-compatible";
|
||||||
|
@ -96,12 +146,12 @@
|
||||||
api_base = "http://localhost:11434/v1";
|
api_base = "http://localhost:11434/v1";
|
||||||
models = [
|
models = [
|
||||||
{
|
{
|
||||||
name = "qwen2.5-coder:latest";
|
name = "${localFastModel}";
|
||||||
supports_function_calling = true;
|
supports_function_calling = true;
|
||||||
supports_vision = true;
|
supports_vision = true;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "deepseek-r1:latest";
|
name = "${localReasoningModel}";
|
||||||
supports_function_calling = true;
|
supports_function_calling = true;
|
||||||
supports_vision = true;
|
supports_vision = true;
|
||||||
}
|
}
|
||||||
|
@ -113,12 +163,12 @@
|
||||||
api_base = "https://openrouter.ai/api/v1";
|
api_base = "https://openrouter.ai/api/v1";
|
||||||
models = [
|
models = [
|
||||||
{
|
{
|
||||||
name = "qwen/qwen-2.5-coder-32b-instruct:free";
|
name = "${remoteFastModel}";
|
||||||
supports_function_calling = true;
|
supports_function_calling = true;
|
||||||
supports_vision = true;
|
supports_vision = true;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "deepseek/deepseek-r1-0528:free";
|
name = "${remoteReasoningModel}";
|
||||||
supports_function_calling = true;
|
supports_function_calling = true;
|
||||||
supports_vision = true;
|
supports_vision = true;
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue