parllama 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. parllama-0.2.0/PKG-INFO +194 -0
  2. parllama-0.2.0/README.md +149 -0
  3. parllama-0.2.0/parllama/__init__.py +22 -0
  4. parllama-0.2.0/parllama/__main__.py +25 -0
  5. parllama-0.2.0/parllama/app.py +615 -0
  6. parllama-0.2.0/parllama/app.tcss +152 -0
  7. parllama-0.2.0/parllama/data_manager.py +246 -0
  8. parllama-0.2.0/parllama/dialogs/__init__.py +3 -0
  9. parllama-0.2.0/parllama/dialogs/error_dialog.py +26 -0
  10. parllama-0.2.0/parllama/dialogs/help_dialog.py +79 -0
  11. parllama-0.2.0/parllama/dialogs/information.py +13 -0
  12. parllama-0.2.0/parllama/dialogs/input_dialog.py +108 -0
  13. parllama-0.2.0/parllama/dialogs/model_details_dialog.py +132 -0
  14. parllama-0.2.0/parllama/dialogs/password_dialog.py +88 -0
  15. parllama-0.2.0/parllama/dialogs/text_dialog.py +75 -0
  16. parllama-0.2.0/parllama/dialogs/yes_no_dialog.py +111 -0
  17. parllama-0.2.0/parllama/docker_utils.py +116 -0
  18. parllama-0.2.0/parllama/help.md +95 -0
  19. parllama-0.2.0/parllama/icons.py +25 -0
  20. parllama-0.2.0/parllama/messages/__init__.py +3 -0
  21. parllama-0.2.0/parllama/messages/main.py +144 -0
  22. parllama-0.2.0/parllama/models/__init__.py +3 -0
  23. parllama-0.2.0/parllama/models/jobs.py +30 -0
  24. parllama-0.2.0/parllama/models/ollama_data.py +75 -0
  25. parllama-0.2.0/parllama/models/settings_data.py +100 -0
  26. parllama-0.2.0/parllama/par_logger.py +49 -0
  27. parllama-0.2.0/parllama/py.typed +0 -0
  28. parllama-0.2.0/parllama/screens/__init__.py +3 -0
  29. parllama-0.2.0/parllama/screens/local_models_screen.py +263 -0
  30. parllama-0.2.0/parllama/screens/local_models_screen.tcss +12 -0
  31. parllama-0.2.0/parllama/screens/log_screen.py +50 -0
  32. parllama-0.2.0/parllama/screens/log_screen.tcss +9 -0
  33. parllama-0.2.0/parllama/screens/model_tools_screen.py +57 -0
  34. parllama-0.2.0/parllama/screens/model_tools_screen.tcss +11 -0
  35. parllama-0.2.0/parllama/screens/site_models_screen.py +207 -0
  36. parllama-0.2.0/parllama/screens/site_models_screen.tcss +46 -0
  37. parllama-0.2.0/parllama/theme_manager.py +122 -0
  38. parllama-0.2.0/parllama/themes/__init__.py +3 -0
  39. parllama-0.2.0/parllama/themes/par.json +25 -0
  40. parllama-0.2.0/parllama/time_display.py +64 -0
  41. parllama-0.2.0/parllama/utils.py +592 -0
  42. parllama-0.2.0/parllama/widgets/__init__.py +3 -0
  43. parllama-0.2.0/parllama/widgets/clickable_label.py +67 -0
  44. parllama-0.2.0/parllama/widgets/dbl_click_list_item.py +29 -0
  45. parllama-0.2.0/parllama/widgets/field_set.py +90 -0
  46. parllama-0.2.0/parllama/widgets/filter_input.py +22 -0
  47. parllama-0.2.0/parllama/widgets/grid_list.py +284 -0
  48. parllama-0.2.0/parllama/widgets/hidden_input.py +59 -0
  49. parllama-0.2.0/parllama/widgets/input_tab_complete.py +44 -0
  50. parllama-0.2.0/parllama/widgets/local_model_list_item.py +68 -0
  51. parllama-0.2.0/parllama/widgets/site_model_list_item.py +73 -0
  52. parllama-0.2.0/parllama/widgets/site_model_list_view.py +20 -0
  53. parllama-0.2.0/parllama.egg-info/PKG-INFO +194 -0
  54. parllama-0.2.0/parllama.egg-info/SOURCES.txt +59 -0
  55. parllama-0.2.0/parllama.egg-info/dependency_links.txt +1 -0
  56. parllama-0.2.0/parllama.egg-info/entry_points.txt +2 -0
  57. parllama-0.2.0/parllama.egg-info/requires.txt +17 -0
  58. parllama-0.2.0/parllama.egg-info/top_level.txt +1 -0
  59. parllama-0.2.0/pyproject.toml +3 -0
  60. parllama-0.2.0/setup.cfg +78 -0
@@ -0,0 +1,194 @@
1
+ Metadata-Version: 2.1
2
+ Name: parllama
3
+ Version: 0.2.0
4
+ Summary: Terminal UI for Ollama
5
+ Home-page: https://github.com/paulrobello/parllama
6
+ Author: Paul Robello
7
+ Author-email: probello@gmail.com
8
+ Maintainer: Paul Robello
9
+ Maintainer-email: probello@gmail.com
10
+ License: License :: OSI Approved :: MIT License
11
+ Project-URL: Documentation, https://github.com/paulrobello/parllama/blob/main/README.md
12
+ Project-URL: Source, https://github.com/paulrobello/parllama
13
+ Project-URL: Issues, https://github.com/paulrobello/parllama/issues
14
+ Project-URL: Wiki, https://github.com/paulrobello/parllama/wiki
15
+ Keywords: ollama,ai,terminal,tui
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Environment :: Console
18
+ Classifier: Development Status :: 4 - Beta
19
+ Classifier: Natural Language :: English
20
+ Classifier: Operating System :: OS Independent
21
+ Classifier: Programming Language :: Python :: 3
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Topic :: Terminals
24
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
25
+ Classifier: Typing :: Typed
26
+ Requires-Python: <3.13,>=3.10
27
+ Description-Content-Type: text/markdown
28
+ Requires-Dist: urllib3
29
+ Requires-Dist: requests
30
+ Requires-Dist: simplejson
31
+ Requires-Dist: attrs
32
+ Requires-Dist: certifi
33
+ Requires-Dist: requests-file
34
+ Requires-Dist: textual[syntax]>=0.69.0
35
+ Requires-Dist: asyncio
36
+ Requires-Dist: humanize
37
+ Requires-Dist: argparse
38
+ Requires-Dist: pyperclip
39
+ Requires-Dist: rich
40
+ Requires-Dist: python-dotenv
41
+ Requires-Dist: pydantic
42
+ Requires-Dist: ollama
43
+ Requires-Dist: bs4
44
+ Requires-Dist: docker
45
+
46
+ # PAR LLAMA
47
+
48
+ ## About
49
+ PAR LLAMA is a TUI application designed for easy management and use of Ollama based LLMs.
50
+ The application was built with [Textual](https://textual.textualize.io/) and [Rich](https://github.com/Textualize/rich?tab=readme-ov-file)
51
+
52
+ ### Screenshots
53
+ Supports Dark and Light mode as well as custom themes.
54
+
55
+ ![Local Models Dark](https://raw.githubusercontent.com/paulrobello/parllama/main/docs/local_models_dark_1.png)
56
+
57
+ ![Model View Dark](https://raw.githubusercontent.com/paulrobello/parllama/main/docs/models_view_dark_1.png)
58
+
59
+ ![Site Models Dark](https://raw.githubusercontent.com/paulrobello/parllama/main/docs/site_models_dark_1.png)
60
+
61
+ ![Local Models Light](https://raw.githubusercontent.com/paulrobello/parllama/main/docs/local_models_light_1.png)
62
+
63
+ ## Prerequisites for running
64
+ * Install and run [Ollama](https://ollama.com/download)
65
+ * Install Python 3.11 or newer
66
+
67
+ ## Prerequisites for dev
68
+ * Install pipenv
69
+ * Install GNU Compatible Make command
70
+
71
+ ## Prerequisites for model quantization
72
+ If you want to be able to quantize custom models, download the following tool from the releases area:
73
+ [HuggingFaceModelDownloader](https://github.com/bodaay/HuggingFaceModelDownloader)
74
+
75
+ Install [Docker Desktop](https://www.docker.com/products/docker-desktop/)
76
+
77
+ Pull the docker image ollama/quantize
78
+ ```bash
79
+ docker pull ollama/quantize
80
+ ```
81
+
82
+ ## Installing from mypi using pip
83
+ Create a virtual environment and install using pip
84
+ ```bash
85
+ mkdir parllama
86
+ cd parllama
87
+ python -m venv venv
88
+ source venv/Scripts/activate
89
+ pip install parllama
90
+ ```
91
+
92
+ ## Installing from mypi using pipx
93
+ ```bash
94
+ pipx install parllama
95
+ ```
96
+
97
+ ## Installing for dev mode
98
+ Clone the repo and run the following from the root of the repo:
99
+ ```bash
100
+ make first-setup
101
+ ```
102
+
103
+
104
+ ## Command line arguments
105
+ ```
106
+ usage: PAR LLAMA TUI [-h] [-v] [-d DATA_DIR] [-t THEME_NAME] [-m {dark,light}] [--restore-defaults] [--clear-cache] [--no-save]
107
+
108
+ PAR LLAMA TUI -- Ollama TUI.
109
+
110
+ options:
111
+ -h, --help show this help message and exit
112
+ -v, --version Show version information.
113
+ -d DATA_DIR, --data-dir DATA_DIR
114
+ Data Directory. Defaults to ~/.parllama
115
+ -t THEME_NAME, --theme-name THEME_NAME
116
+ Theme name. Defaults to par
117
+ -m {dark,light}, --theme-mode {dark,light}
118
+ Dark / Light mode. Defaults to dark
119
+ --restore-defaults Restore default settings and theme
120
+ --clear-cache Clear cached data
121
+ --no-save Prevent saving settings for this session.
122
+ --clear-cache Clear cached data
123
+ ```
124
+
125
+ ## Environment Variables
126
+ * PARLLAMA_DATA_DIR - Used to set --data-dir
127
+ * PARLLAMA_THEME_NAME - Used to set --theme-name
128
+ * PARLLAMA_THEME_MODE - Used to set --theme-mode
129
+
130
+
131
+ ## Running Par Llama
132
+
133
+ ### with pipx installation
134
+ From anywhere:
135
+ ```bash
136
+ parllama
137
+ ```
138
+
139
+ ### with pip installation
140
+ From parent folder of venv
141
+ ```bash
142
+ source venv/Scripts/activate
143
+ parllama
144
+ ```
145
+
146
+ ### Dev mode
147
+ From repo root:
148
+ ```bash
149
+ make dev
150
+ ```
151
+
152
+ ## Themes
153
+ Themes are json files stored in the themes folder in the data directory which defaults to **~/.parllama/themes**
154
+
155
+ The default theme is "par" so can be located in **~/.parllama/themes/par.json**
156
+
157
+ Themes have a dark and light mode are in the following format:
158
+ ```json
159
+ {
160
+ "dark": {
161
+ "primary": "#e49500",
162
+ "secondary": "#6e4800",
163
+ "warning": "#ffa62b",
164
+ "error": "#ba3c5b",
165
+ "success": "#4EBF71",
166
+ "accent": "#6e4800",
167
+ "panel": "#111",
168
+ "surface":"#1e1e1e",
169
+ "background":"#121212",
170
+ "dark": true
171
+ },
172
+ "light": {
173
+ "primary": "#004578",
174
+ "secondary": "#ffa62b",
175
+ "warning": "#ffa62b",
176
+ "error": "#ba3c5b",
177
+ "success": "#4EBF71",
178
+ "accent": "#0178D4",
179
+ "background":"#efefef",
180
+ "surface":"#f5f5f5",
181
+ "dark": false
182
+ }
183
+ }
184
+ ```
185
+
186
+ You must specify at least one of light or dark for the theme to be usable.
187
+
188
+ Theme can be changed via command line with the ```--theme-name``` option.
189
+
190
+
191
+ # Changelog
192
+
193
+ ### 0.2.0
194
+ Initial Release
@@ -0,0 +1,149 @@
1
+ # PAR LLAMA
2
+
3
+ ## About
4
+ PAR LLAMA is a TUI application designed for easy management and use of Ollama based LLMs.
5
+ The application was built with [Textual](https://textual.textualize.io/) and [Rich](https://github.com/Textualize/rich?tab=readme-ov-file)
6
+
7
+ ### Screenshots
8
+ Supports Dark and Light mode as well as custom themes.
9
+
10
+ ![Local Models Dark](https://raw.githubusercontent.com/paulrobello/parllama/main/docs/local_models_dark_1.png)
11
+
12
+ ![Model View Dark](https://raw.githubusercontent.com/paulrobello/parllama/main/docs/models_view_dark_1.png)
13
+
14
+ ![Site Models Dark](https://raw.githubusercontent.com/paulrobello/parllama/main/docs/site_models_dark_1.png)
15
+
16
+ ![Local Models Light](https://raw.githubusercontent.com/paulrobello/parllama/main/docs/local_models_light_1.png)
17
+
18
+ ## Prerequisites for running
19
+ * Install and run [Ollama](https://ollama.com/download)
20
+ * Install Python 3.11 or newer
21
+
22
+ ## Prerequisites for dev
23
+ * Install pipenv
24
+ * Install GNU Compatible Make command
25
+
26
+ ## Prerequisites for model quantization
27
+ If you want to be able to quantize custom models, download the following tool from the releases area:
28
+ [HuggingFaceModelDownloader](https://github.com/bodaay/HuggingFaceModelDownloader)
29
+
30
+ Install [Docker Desktop](https://www.docker.com/products/docker-desktop/)
31
+
32
+ Pull the docker image ollama/quantize
33
+ ```bash
34
+ docker pull ollama/quantize
35
+ ```
36
+
37
+ ## Installing from mypi using pip
38
+ Create a virtual environment and install using pip
39
+ ```bash
40
+ mkdir parllama
41
+ cd parllama
42
+ python -m venv venv
43
+ source venv/Scripts/activate
44
+ pip install parllama
45
+ ```
46
+
47
+ ## Installing from mypi using pipx
48
+ ```bash
49
+ pipx install parllama
50
+ ```
51
+
52
+ ## Installing for dev mode
53
+ Clone the repo and run the following from the root of the repo:
54
+ ```bash
55
+ make first-setup
56
+ ```
57
+
58
+
59
+ ## Command line arguments
60
+ ```
61
+ usage: PAR LLAMA TUI [-h] [-v] [-d DATA_DIR] [-t THEME_NAME] [-m {dark,light}] [--restore-defaults] [--clear-cache] [--no-save]
62
+
63
+ PAR LLAMA TUI -- Ollama TUI.
64
+
65
+ options:
66
+ -h, --help show this help message and exit
67
+ -v, --version Show version information.
68
+ -d DATA_DIR, --data-dir DATA_DIR
69
+ Data Directory. Defaults to ~/.parllama
70
+ -t THEME_NAME, --theme-name THEME_NAME
71
+ Theme name. Defaults to par
72
+ -m {dark,light}, --theme-mode {dark,light}
73
+ Dark / Light mode. Defaults to dark
74
+ --restore-defaults Restore default settings and theme
75
+ --clear-cache Clear cached data
76
+ --no-save Prevent saving settings for this session.
77
+ --clear-cache Clear cached data
78
+ ```
79
+
80
+ ## Environment Variables
81
+ * PARLLAMA_DATA_DIR - Used to set --data-dir
82
+ * PARLLAMA_THEME_NAME - Used to set --theme-name
83
+ * PARLLAMA_THEME_MODE - Used to set --theme-mode
84
+
85
+
86
+ ## Running Par Llama
87
+
88
+ ### with pipx installation
89
+ From anywhere:
90
+ ```bash
91
+ parllama
92
+ ```
93
+
94
+ ### with pip installation
95
+ From parent folder of venv
96
+ ```bash
97
+ source venv/Scripts/activate
98
+ parllama
99
+ ```
100
+
101
+ ### Dev mode
102
+ From repo root:
103
+ ```bash
104
+ make dev
105
+ ```
106
+
107
+ ## Themes
108
+ Themes are json files stored in the themes folder in the data directory which defaults to **~/.parllama/themes**
109
+
110
+ The default theme is "par" so can be located in **~/.parllama/themes/par.json**
111
+
112
+ Themes have a dark and light mode are in the following format:
113
+ ```json
114
+ {
115
+ "dark": {
116
+ "primary": "#e49500",
117
+ "secondary": "#6e4800",
118
+ "warning": "#ffa62b",
119
+ "error": "#ba3c5b",
120
+ "success": "#4EBF71",
121
+ "accent": "#6e4800",
122
+ "panel": "#111",
123
+ "surface":"#1e1e1e",
124
+ "background":"#121212",
125
+ "dark": true
126
+ },
127
+ "light": {
128
+ "primary": "#004578",
129
+ "secondary": "#ffa62b",
130
+ "warning": "#ffa62b",
131
+ "error": "#ba3c5b",
132
+ "success": "#4EBF71",
133
+ "accent": "#0178D4",
134
+ "background":"#efefef",
135
+ "surface":"#f5f5f5",
136
+ "dark": false
137
+ }
138
+ }
139
+ ```
140
+
141
+ You must specify at least one of light or dark for the theme to be usable.
142
+
143
+ Theme can be changed via command line with the ```--theme-name``` option.
144
+
145
+
146
+ # Changelog
147
+
148
+ ### 0.2.0
149
+ Initial Release
@@ -0,0 +1,22 @@
1
+ """PAR LLAMA TUI - A terminal user interface for Ollama."""
2
+
3
+ __author__ = "Paul Robello"
4
+ __copyright__ = "Copyright 2024, Paul Robello"
5
+ __credits__ = ["Paul Robello"]
6
+ __maintainer__ = "Paul Robello"
7
+ __email__ = "probello@gmail.com"
8
+ __version__ = "0.2.0"
9
+ __licence__ = "MIT"
10
+ __application_title__ = "PAR LLAMA"
11
+
12
+
13
+ __all__: list[str] = [
14
+ "__author__",
15
+ "__copyright__",
16
+ "__credits__",
17
+ "__maintainer__",
18
+ "__email__",
19
+ "__version__",
20
+ "__licence__",
21
+ "__application_title__",
22
+ ]
@@ -0,0 +1,25 @@
1
+ """The main entry point for the application."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import os
6
+
7
+ from parllama.app import ParLlamaApp
8
+ from parllama.models.settings_data import settings
9
+
10
+ if os.environ.get("DEBUG"):
11
+ import pydevd_pycharm # type: ignore
12
+
13
+ pydevd_pycharm.settrace(
14
+ "localhost", port=12345, suspend=False, patch_multiprocessing=True
15
+ )
16
+
17
+
18
+ def run() -> None:
19
+ """Run the application."""
20
+ print(f"Settings folder {settings.data_dir}")
21
+ ParLlamaApp().run()
22
+
23
+
24
+ if __name__ == "__main__":
25
+ run()