Skip to content

Commit fe04c49

Browse files
committed
tabby local chat model, can use ai local chat from vim
1 parent fc8a8e3 commit fe04c49

29 files changed

+7308
-3
lines changed

nix/configuration.nix

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,15 @@ in {
818818
download --model DeepSeekCoder-1.3B
819819
'';
820820
}
821+
// fj.mkFirejailCustom {
822+
pkg = "tabby-download-instruct";
823+
dir = "tabby-download";
824+
net = true;
825+
exe = ''
826+
${import ./tabby.nix}/bin/tabby \
827+
download --model Qwen2.5-Coder-1.5B-Instruct
828+
'';
829+
}
821830
// fj.mkFirejailCustom {
822831
pkg = "tabby-agent";
823832
dir = "tabby";
@@ -838,7 +847,13 @@ in {
838847
}
839848
// fj.mkFirejailOffline {
840849
pkg = "vi";
841-
exe = "${vi}/bin/vi";
850+
exe = "${
851+
import ./vi-socat.nix {
852+
sock = "/home/${
853+
config.services.functora.userName
854+
}/.firejail/tabby/tabby.sock";
855+
}
856+
}/bin/vi";
842857
}
843858
// fj.mkFirejailOffline {
844859
pkg = "hoogle-w3m";
@@ -914,6 +929,7 @@ in {
914929
pulsemixer
915930
(import ./vidmaker.nix)
916931
(import ./clipmaker.nix)
932+
neovim
917933
];
918934
programs.git = {
919935
enable = true;

nix/tabby-agent.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ in
77
text = ''
88
${pkgs.socat}/bin/socat \
99
TCP-LISTEN:8080,fork,reuseaddr,keepalive \
10-
UNIX:${sock},keepalive &
10+
UNIX:${sock},keepalive || true &
1111
1212
SOCAT_PID="$!"
1313

nix/tabby-services.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ in [
1616
${import ./tabby-socat.nix}/bin/tabby-socat \
1717
serve \
1818
--device vulkan \
19-
--model DeepSeekCoder-1.3B
19+
--model DeepSeekCoder-1.3B \
20+
--chat-model Qwen2.5-Coder-1.5B-Instruct
2021
'';
2122
}
2223
)

nix/vi-socat.nix

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{sock}: let
2+
pkgs = import ./nixpkgs.nix;
3+
vi = import ./../pub/vi/nix/default.nix {};
4+
in
5+
pkgs.writeShellApplication {
6+
name = "vi";
7+
text = ''
8+
${pkgs.socat}/bin/socat \
9+
TCP-LISTEN:8080,fork,reuseaddr,keepalive \
10+
UNIX:${sock},keepalive || true &
11+
12+
SOCAT_PID="$!"
13+
14+
cleanup() {
15+
kill "$SOCAT_PID" 2>/dev/null
16+
exit 0
17+
}
18+
19+
trap cleanup SIGINT SIGTERM EXIT
20+
21+
${vi}/bin/vi "$@"
22+
23+
cleanup
24+
'';
25+
}

pub/vi/nix/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ in
5656
let g:vimColorScheme = '${vimColorScheme}'
5757
let g:languagetool_jar='${languagetool}/share/languagetool-commandline.jar'
5858
source ${vi-src}/vimrc.vim
59+
luafile ${vi-src}/vimrc.lua
5960
try
6061
source ~/.vi/vimrc.vim
6162
catch

pub/vi/src/gp.nvim/.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root = true
2+
3+
[*]
4+
indent_style = tab
5+
indent_size = 1
6+
tab_width = 4
7+
end_of_line = lf
8+
insert_final_newline = true
9+
charset = utf-8
10+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: robitx
2+
ko_fi: robitx
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: docgen
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- docs
7+
pull_request:
8+
branches:
9+
- main
10+
- docs
11+
jobs:
12+
docs:
13+
runs-on: ubuntu-latest
14+
if: ${{ ! contains(github.event.pull_request.head.ref, 'release-please') }}
15+
steps:
16+
- uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Update README with Snippet Permalink
21+
uses: Robitx/snippet-permalink-updater-action@main
22+
with:
23+
snippet_file: 'lua/gp/config.lua'
24+
start_marker: 'README_REFERENCE_MARKER_START'
25+
end_marker: 'README_REFERENCE_MARKER_END'
26+
markdown_file: 'README.md'
27+
replace_marker: '<!-- README_REFERENCE_MARKER_REPLACE_NEXT_LINE -->'
28+
29+
- name: panvimdoc
30+
uses: kdheepak/panvimdoc@main
31+
with:
32+
vimdoc: gp.nvim
33+
version: "Neovim"
34+
demojify: true
35+
treesitter: true
36+
docmapping: true
37+
docmappingprojectname: false
38+
dedupsubheadings: false
39+
40+
- name: Push changes
41+
uses: stefanzweifel/git-auto-commit-action@v4
42+
with:
43+
commit_message: "chore: update README and auto-generate vimdoc"
44+
commit_user_name: "github-actions[bot]"
45+
commit_user_email: "github-actions[bot]@users.noreply.github.com"
46+
commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
on:
2+
workflow_dispatch:
3+
4+
permissions:
5+
contents: write
6+
pull-requests: write
7+
8+
name: release-please
9+
10+
jobs:
11+
release-please:
12+
runs-on: ubuntu-latest
13+
if: ${{ github.ref == 'refs/heads/main' }}
14+
steps:
15+
- uses: googleapis/release-please-action@v4
16+
id: release
17+
with:
18+
release-type: simple

pub/vi/src/gp.nvim/.gp.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
Use this example as a convention for helper functions:
2+
```
3+
---@param name string # name of the augroup
4+
---@param opts table | nil # options for the augroup
5+
---@return number # returns augroup id
6+
_H.create_augroup = function(name, opts)
7+
...
8+
end
9+
10+
---@param file_name string # name of the file for which to get buffer
11+
---@return number | nil # buffer number
12+
_H.get_buffer = function(file_name)
13+
...
14+
end
15+
```
16+
17+
The function assignment is preferred over:
18+
```
19+
function _H.create_augroup(name, opts)
20+
...
21+
end
22+
```
23+
24+
Module has following structure:
25+
```lua
26+
local uv = vim.uv or vim.loop
27+
28+
local config = require("gp.config")
29+
30+
local M = {
31+
_Name = "Gp", -- plugin name
32+
_state = {}, -- table of state variables
33+
agents = {}, -- table of agents
34+
cmd = {}, -- default command functions
35+
config = {}, -- config variables
36+
hooks = {}, -- user defined command functions
37+
defaults = require("gp.defaults"), -- some useful defaults
38+
deprecator = require("gp.deprecator"), -- handle deprecated options
39+
helpers = require("gp.helper"), -- helper functions
40+
imager = require("gp.imager"), -- imager module
41+
logger = require("gp.logger"), -- logger module
42+
render = require("gp.render"), -- render module
43+
spinner = require("gp.spinner"), -- spinner module
44+
tasker = require("gp.tasker"), -- tasker module
45+
vault = require("gp.vault"), -- vault module
46+
whisper = require("gp.whisper"), -- whisper module
47+
}
48+
```
49+

0 commit comments

Comments
 (0)