mlx-code 0.0.33__tar.gz → 0.0.34__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.
- {mlx_code-0.0.33 → mlx_code-0.0.34}/PKG-INFO +2 -2
- {mlx_code-0.0.33 → mlx_code-0.0.34}/README.md +1 -1
- {mlx_code-0.0.33 → mlx_code-0.0.34}/mlx_code/main.py +10 -0
- {mlx_code-0.0.33 → mlx_code-0.0.34}/mlx_code/tui.py +11 -2
- {mlx_code-0.0.33 → mlx_code-0.0.34}/mlx_code.egg-info/PKG-INFO +2 -2
- {mlx_code-0.0.33 → mlx_code-0.0.34}/setup.py +1 -1
- {mlx_code-0.0.33 → mlx_code-0.0.34}/LICENSE +0 -0
- {mlx_code-0.0.33 → mlx_code-0.0.34}/mlx_code/__init__.py +0 -0
- {mlx_code-0.0.33 → mlx_code-0.0.34}/mlx_code/apis.py +0 -0
- {mlx_code-0.0.33 → mlx_code-0.0.34}/mlx_code/bare.py +0 -0
- {mlx_code-0.0.33 → mlx_code-0.0.34}/mlx_code/bats.py +0 -0
- {mlx_code-0.0.33 → mlx_code-0.0.34}/mlx_code/gits.py +0 -0
- {mlx_code-0.0.33 → mlx_code-0.0.34}/mlx_code/lsp_tool.py +0 -0
- {mlx_code-0.0.33 → mlx_code-0.0.34}/mlx_code/mcb.py +0 -0
- {mlx_code-0.0.33 → mlx_code-0.0.34}/mlx_code/mcb_tool.py +0 -0
- {mlx_code-0.0.33 → mlx_code-0.0.34}/mlx_code/repl.py +0 -0
- {mlx_code-0.0.33 → mlx_code-0.0.34}/mlx_code/stream_log.py +0 -0
- {mlx_code-0.0.33 → mlx_code-0.0.34}/mlx_code/tools.py +0 -0
- {mlx_code-0.0.33 → mlx_code-0.0.34}/mlx_code/util.py +0 -0
- {mlx_code-0.0.33 → mlx_code-0.0.34}/mlx_code/view_git.py +0 -0
- {mlx_code-0.0.33 → mlx_code-0.0.34}/mlx_code/view_log.py +0 -0
- {mlx_code-0.0.33 → mlx_code-0.0.34}/mlx_code/web.py +0 -0
- {mlx_code-0.0.33 → mlx_code-0.0.34}/mlx_code.egg-info/SOURCES.txt +0 -0
- {mlx_code-0.0.33 → mlx_code-0.0.34}/mlx_code.egg-info/dependency_links.txt +0 -0
- {mlx_code-0.0.33 → mlx_code-0.0.34}/mlx_code.egg-info/entry_points.txt +0 -0
- {mlx_code-0.0.33 → mlx_code-0.0.34}/mlx_code.egg-info/requires.txt +0 -0
- {mlx_code-0.0.33 → mlx_code-0.0.34}/mlx_code.egg-info/top_level.txt +0 -0
- {mlx_code-0.0.33 → mlx_code-0.0.34}/setup.cfg +0 -0
- {mlx_code-0.0.33 → mlx_code-0.0.34}/tests/__init__.py +0 -0
- {mlx_code-0.0.33 → mlx_code-0.0.34}/tests/test.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mlx-code
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.34
|
|
4
4
|
Summary: Coding Agent for Mac
|
|
5
5
|
Home-page: https://josefalbers.github.io/mlx-code/
|
|
6
6
|
Author: J Joe
|
|
@@ -107,7 +107,7 @@ result = await agent.run('refactor utils.py to use dataclasses')
|
|
|
107
107
|
|
|
108
108
|
```bash
|
|
109
109
|
# ephemeral run (no installation)
|
|
110
|
-
uvx --from mlx-code[all] mlc
|
|
110
|
+
uvx --from "mlx-code[all]" mlc
|
|
111
111
|
|
|
112
112
|
# or install into the current environment
|
|
113
113
|
pip install mlx-code[all]
|
|
@@ -31,6 +31,7 @@ logger = setup_logger('.log.json')
|
|
|
31
31
|
generation_stream = mx.new_thread_local_stream(mx.default_device())
|
|
32
32
|
gen_lock = threading.Lock()
|
|
33
33
|
abort_ev = threading.Event()
|
|
34
|
+
_EXPERIMENTAL = []
|
|
34
35
|
|
|
35
36
|
@dataclass
|
|
36
37
|
class ToolCall:
|
|
@@ -797,6 +798,13 @@ def stream_sse(format_type, seg_gen, msg_id, in_tokens, think_tags=None):
|
|
|
797
798
|
|
|
798
799
|
def make_handler(model_name, cache_dir, system, names, skips, gwt=None, parse_think=True):
|
|
799
800
|
model, tokenizer = mlx_lm.load(model_name)
|
|
801
|
+
if 'zmlx' in _EXPERIMENTAL:
|
|
802
|
+
try:
|
|
803
|
+
from zmlx.patch import patch
|
|
804
|
+
patch(model)
|
|
805
|
+
logger.info('zmlx enabled')
|
|
806
|
+
except:
|
|
807
|
+
logger.error('pip install "zmlx[lm]"')
|
|
800
808
|
pc = PromptCache(model, model_name=model_name, cache_dir=cache_dir)
|
|
801
809
|
if not isinstance(tokenizer, mlx_lm.tokenizer_utils.TokenizerWrapper):
|
|
802
810
|
tokenizer = mlx_lm.tokenizer_utils.TokenizerWrapper(tokenizer)
|
|
@@ -936,8 +944,10 @@ def main():
|
|
|
936
944
|
parser.add_argument('--bare', action='store_true', help='Use simple terminal REPL instead of TUI')
|
|
937
945
|
parser.add_argument('--web', action='store_true', help='Use web UI instead of TUI')
|
|
938
946
|
parser.add_argument('--web-port', type=int, default=None, help='Port for web UI (default: inference port + 80)')
|
|
947
|
+
parser.add_argument('--experimental', nargs='+', default=[], help='List of experimental features to enable')
|
|
939
948
|
args, leash_args = parser.parse_known_args()
|
|
940
949
|
logger.debug(f'args={args!r} leash_args={leash_args!r}')
|
|
950
|
+
_EXPERIMENTAL.extend(args.experimental)
|
|
941
951
|
if args.engine == 'batch' and args.leash not in ('none', 'noapi'):
|
|
942
952
|
parser.error('--engine batch only supports --leash none or --leash noapi for now')
|
|
943
953
|
cache = os.path.abspath(args.cache)
|
|
@@ -147,6 +147,15 @@ class Tab(Vertical):
|
|
|
147
147
|
self._cache_count: int = -1
|
|
148
148
|
self._rendered_cache: Table | None = None
|
|
149
149
|
self._tool_call_buf: str = ''
|
|
150
|
+
self._stream_dirty: bool = False
|
|
151
|
+
|
|
152
|
+
def on_mount(self) -> None:
|
|
153
|
+
self.set_interval(0.1, self._flush_stream)
|
|
154
|
+
|
|
155
|
+
def _flush_stream(self) -> None:
|
|
156
|
+
if self._stream_dirty:
|
|
157
|
+
self.refresh_stream()
|
|
158
|
+
self._stream_dirty = False
|
|
150
159
|
|
|
151
160
|
@property
|
|
152
161
|
def agent(self) -> Agent:
|
|
@@ -224,7 +233,7 @@ class Tab(Vertical):
|
|
|
224
233
|
self._stream_blocks[-1]['text'] += emit
|
|
225
234
|
else:
|
|
226
235
|
self._stream_blocks.append({'type': 'text', 'text': emit})
|
|
227
|
-
self.
|
|
236
|
+
self._stream_dirty = True
|
|
228
237
|
elif et == 'thinking_delta':
|
|
229
238
|
delta = payload.get('delta', '')
|
|
230
239
|
if delta:
|
|
@@ -232,7 +241,7 @@ class Tab(Vertical):
|
|
|
232
241
|
self._stream_blocks[-1]['text'] += delta
|
|
233
242
|
else:
|
|
234
243
|
self._stream_blocks.append({'type': 'thinking', 'text': delta})
|
|
235
|
-
self.
|
|
244
|
+
self._stream_dirty = True
|
|
236
245
|
elif et == 'tool_start':
|
|
237
246
|
self.refresh_stream()
|
|
238
247
|
elif et == 'tool_end':
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mlx-code
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.34
|
|
4
4
|
Summary: Coding Agent for Mac
|
|
5
5
|
Home-page: https://josefalbers.github.io/mlx-code/
|
|
6
6
|
Author: J Joe
|
|
@@ -107,7 +107,7 @@ result = await agent.run('refactor utils.py to use dataclasses')
|
|
|
107
107
|
|
|
108
108
|
```bash
|
|
109
109
|
# ephemeral run (no installation)
|
|
110
|
-
uvx --from mlx-code[all] mlc
|
|
110
|
+
uvx --from "mlx-code[all]" mlc
|
|
111
111
|
|
|
112
112
|
# or install into the current environment
|
|
113
113
|
pip install mlx-code[all]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|