parllama
parllama copied to clipboard
parllama crashes on model creation
When trying to create a model, parllama crashes with a TypeError. I'm using parllama version 0.3.24.
To reproduce the issue:
- Start parllama
- Navigate to the "Create" tab
- Set the name and model code
- Hit create, and see the crash
Exception Details
Settings folder /home/steiner/.local/share/parllama
╭──────────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────────────────────────────────────────╮
│ /home/steiner/.local/share/uv/tools/parllama/lib64/python3.13/site-packages/textual/worker.py:368 in _run │
│ │
│ 365 │ │ │ self.state = WorkerState.RUNNING │
│ 366 │ │ │ app.log.worker(self) │
│ 367 │ │ │ try: │
│ ❱ 368 │ │ │ │ self._result = await self.run() │
│ 369 │ │ │ except asyncio.CancelledError as error: │
│ 370 │ │ │ │ self.state = WorkerState.CANCELLED │
│ 371 │ │ │ │ self._error = error │
│ │
│ ╭──────────────────────────────────────────────────────────────── locals ────────────────────────────────────────────────────────────────╮ │
│ │ app = ParLlamaApp(title='PAR LLAMA', classes={'-dark-mode'}, pseudo_classes={'dark', 'focus'}) │ │
│ │ error = TypeError("Client.create() got an unexpected keyword argument 'modelfile'") │ │
│ │ self = <Worker ERROR name='do_jobs' group='do_jobs' description='do_jobs()'> │ │
│ │ worker_failed = WorkerFailed('Worker raised exception: TypeError("Client.create() got an unexpected keyword argument \'modelfile\'")') │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /home/steiner/.local/share/uv/tools/parllama/lib64/python3.13/site-packages/textual/worker.py:352 in run │
│ │
│ 349 │ │ Returns: ╭─────────────────────────────────── locals ───────────────────────────────────╮ │
│ 350 │ │ │ Return value of the work. │ self = <Worker ERROR name='do_jobs' group='do_jobs' description='do_jobs()'> │ │
│ 351 │ │ """ ╰──────────────────────────────────────────────────────────────────────────────╯ │
│ ❱ 352 │ │ return await ( │
│ 353 │ │ │ self._run_threaded() if self._thread_worker else self._run_async() │
│ 354 │ │ ) │
│ 355 │
│ │
│ /home/steiner/.local/share/uv/tools/parllama/lib64/python3.13/site-packages/textual/worker.py:324 in _run_threaded │
│ │
│ 321 │ │ ╭─────────────────────────────────── locals ───────────────────────────────────╮ │
│ 322 │ │ loop = asyncio.get_running_loop() │ loop = <_UnixSelectorEventLoop running=True closed=False debug=False> │ │
│ 323 │ │ assert loop is not None │ self = <Worker ERROR name='do_jobs' group='do_jobs' description='do_jobs()'> │ │
│ ❱ 324 │ │ return await loop.run_in_executor(None, runner, self._work) ╰──────────────────────────────────────────────────────────────────────────────╯ │
│ 325 │ │
│ 326 │ async def _run_async(self) -> ResultType: │
│ 327 │ │ """Run an async worker. │
│ │
│ /usr/lib64/python3.13/asyncio/futures.py:286 in __await__ │
│ │
│ 283 │ def __await__(self): │
│ 284 │ │ if not self.done(): │
│ 285 │ │ │ self._asyncio_future_blocking = True │
│ ❱ 286 │ │ │ yield self # This tells Task to wait for completion. │
│ 287 │ │ if not self.done(): │
│ 288 │ │ │ raise RuntimeError("await wasn't used with future") │
│ 289 │ │ return self.result() # May raise too. │
│ │
│ ╭──────────────────────────────────────────────────── locals ────────────────────────────────────────────────────╮ │
│ │ self = <Future finished exception=TypeError("Client.create() got an unexpected keyword argument 'modelfile'")> │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/lib64/python3.13/asyncio/tasks.py:375 in __wakeup │
│ │
│ 372 │ │
│ 373 │ def __wakeup(self, future): │
│ 374 │ │ try: │
│ ❱ 375 │ │ │ future.result() │
│ 376 │ │ except BaseException as exc: │
│ 377 │ │ │ # This may also be a cancellation. │
│ 378 │ │ │ self.__step(exc) │
│ │
│ ╭──────────────────────────────────────────────────────────────────────────────────────── locals ────────────────────────────────────────────────────────────────────────────────────────╮ │
│ │ exc = TypeError("Client.create() got an unexpected keyword argument 'modelfile'") │ │
│ │ future = <Future finished exception=TypeError("Client.create() got an unexpected keyword argument 'modelfile'")> │ │
│ │ self = <Task pending name='Task-14' coro=<Worker._run() running at /home/steiner/.local/share/uv/tools/parllama/lib64/python3.13/site-packages/textual/worker.py:382> │ │
│ │ cb=[Worker._start.<locals>.task_done_callback() at /home/steiner/.local/share/uv/tools/parllama/lib64/python3.13/site-packages/textual/worker.py:401]> │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/lib64/python3.13/asyncio/futures.py:199 in result │
│ │
│ 196 │ │ │ raise exceptions.InvalidStateError('Result is not ready.') │
│ 197 │ │ self.__log_traceback = False │
│ 198 │ │ if self._exception is not None: │
│ ❱ 199 │ │ │ raise self._exception.with_traceback(self._exception_tb) │
│ 200 │ │ return self._result │
│ 201 │ │
│ 202 │ def exception(self): │
│ │
│ ╭──────────────────────────────────────────────────── locals ────────────────────────────────────────────────────╮ │
│ │ self = <Future finished exception=TypeError("Client.create() got an unexpected keyword argument 'modelfile'")> │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/lib64/python3.13/concurrent/futures/thread.py:59 in run │
│ │
│ 56 │ │ │ return ╭── locals ───╮ │
│ 57 │ │ │ self = None │ │
│ 58 │ │ try: ╰─────────────╯ │
│ ❱ 59 │ │ │ result = self.fn(*self.args, **self.kwargs) │
│ 60 │ │ except BaseException as exc: │
│ 61 │ │ │ self.future.set_exception(exc) │
│ 62 │ │ │ # Break a reference cycle with the exception 'exc' │
│ │
│ /home/steiner/.local/share/uv/tools/parllama/lib64/python3.13/site-packages/textual/worker.py:302 in run_coroutine │
│ │
│ 299 │ │ │ work: Callable[[], Coroutine[None, None, ResultType]], │
│ 300 │ │ ) -> ResultType: │
│ 301 │ │ │ """Set the active worker and await coroutine.""" │
│ ❱ 302 │ │ │ return run_awaitable(work()) │
│ 303 │ │ │
│ 304 │ │ def run_callable(work: Callable[[], ResultType]) -> ResultType: │
│ 305 │ │ │ """Set the active worker, and call the callable.""" │
│ │
│ ╭─────────────────────────────────────────────────────────────────────────────── locals ───────────────────────────────────────────────────────────────────────────────╮ │
│ │ work = functools.partial(<function ParLlamaApp.do_jobs at 0x7f432d0b84a0>, ParLlamaApp(title='PAR LLAMA', classes={'-dark-mode'}, pseudo_classes={'dark', 'focus'})) │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /home/steiner/.local/share/uv/tools/parllama/lib64/python3.13/site-packages/textual/worker.py:296 in run_awaitable │
│ │
│ 293 │ │ │ │ active_worker.set(self) ╭─────────────────────────────────── locals ───────────────────────────────────╮ │
│ 294 │ │ │ │ return await work │ self = <Worker ERROR name='do_jobs' group='do_jobs' description='do_jobs()'> │ │
│ 295 │ │ │ │ work = <coroutine object ParLlamaApp.do_jobs at 0x7f4325037ca0> │ │
│ ❱ 296 │ │ │ return asyncio.run(do_work()) ╰──────────────────────────────────────────────────────────────────────────────╯ │
│ 297 │ │ │
│ 298 │ │ def run_coroutine( │
│ 299 │ │ │ work: Callable[[], Coroutine[None, None, ResultType]], │
│ │
│ /home/steiner/.local/share/uv/tools/parllama/lib64/python3.13/site-packages/nest_asyncio.py:30 in run │
│ │
│ 27 │ │ loop.set_debug(debug) │
│ 28 │ │ task = asyncio.ensure_future(main) │
│ 29 │ │ try: │
│ ❱ 30 │ │ │ return loop.run_until_complete(task) │
│ 31 │ │ finally: │
│ 32 │ │ │ if not task.done(): │
│ 33 │ │ │ │ task.cancel() │
│ │
│ ╭──────────────────────────────────────────────────────────────────────────────────────── locals ────────────────────────────────────────────────────────────────────────────────────────╮ │
│ │ debug = False │ │
│ │ loop = <_UnixSelectorEventLoop running=False closed=False debug=False> │ │
│ │ main = <coroutine object Worker._run_threaded.<locals>.run_awaitable.<locals>.do_work at 0x7f43253171d0> │ │
│ │ task = <Task finished name='Task-16' coro=<Worker._run_threaded.<locals>.run_awaitable.<locals>.do_work() done, defined at │ │
│ │ /home/steiner/.local/share/uv/tools/parllama/lib64/python3.13/site-packages/textual/worker.py:292> exception=TypeError("Client.create() got an unexpected keyword argument │ │
│ │ 'modelfile'")> │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /home/steiner/.local/share/uv/tools/parllama/lib64/python3.13/site-packages/nest_asyncio.py:98 in run_until_complete │
│ │
│ 95 │ │ │ if not f.done(): │
│ 96 │ │ │ │ raise RuntimeError( │
│ 97 │ │ │ │ │ 'Event loop stopped before Future completed.') │
│ ❱ 98 │ │ │ return f.result() │
│ 99 │ │
│ 100 │ def _run_once(self): │
│ 101 │ │ """ │
│ │
│ ╭──────────────────────────────────────────────────────────────────────────────────────── locals ────────────────────────────────────────────────────────────────────────────────────────╮ │
│ │ f = <Task finished name='Task-16' coro=<Worker._run_threaded.<locals>.run_awaitable.<locals>.do_work() done, defined at │ │
│ │ /home/steiner/.local/share/uv/tools/parllama/lib64/python3.13/site-packages/textual/worker.py:292> exception=TypeError("Client.create() got an unexpected keyword argument │ │
│ │ 'modelfile'")> │ │
│ │ future = <Task finished name='Task-16' coro=<Worker._run_threaded.<locals>.run_awaitable.<locals>.do_work() done, defined at │ │
│ │ /home/steiner/.local/share/uv/tools/parllama/lib64/python3.13/site-packages/textual/worker.py:292> exception=TypeError("Client.create() got an unexpected keyword argument │ │
│ │ 'modelfile'")> │ │
│ │ self = <_UnixSelectorEventLoop running=False closed=False debug=False> │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/lib64/python3.13/asyncio/futures.py:199 in result │
│ │
│ 196 │ │ │ raise exceptions.InvalidStateError('Result is not ready.') │
│ 197 │ │ self.__log_traceback = False │
│ 198 │ │ if self._exception is not None: │
│ ❱ 199 │ │ │ raise self._exception.with_traceback(self._exception_tb) │
│ 200 │ │ return self._result │
│ 201 │ │
│ 202 │ def exception(self): │
│ │
│ ╭──────────────────────────────────────────────────────────────────────────────────────── locals ────────────────────────────────────────────────────────────────────────────────────────╮ │
│ │ self = <Task finished name='Task-16' coro=<Worker._run_threaded.<locals>.run_awaitable.<locals>.do_work() done, defined at │ │
│ │ /home/steiner/.local/share/uv/tools/parllama/lib64/python3.13/site-packages/textual/worker.py:292> exception=TypeError("Client.create() got an unexpected keyword argument │ │
│ │ 'modelfile'")> │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/lib64/python3.13/asyncio/tasks.py:304 in __step_run_and_handle_result │
│ │
│ 301 │ │ │ if exc is None: │
│ 302 │ │ │ │ # We use the `send` method directly, because coroutines │
│ 303 │ │ │ │ # don't have `__iter__` and `__next__` methods. │
│ ❱ 304 │ │ │ │ result = coro.send(None) │
│ 305 │ │ │ else: │
│ 306 │ │ │ │ result = coro.throw(exc) │
│ 307 │ │ except StopIteration as exc: │
│ │
│ ╭───────────────────────────────────────────────── locals ─────────────────────────────────────────────────╮ │
│ │ coro = <coroutine object Worker._run_threaded.<locals>.run_awaitable.<locals>.do_work at 0x7f43253171d0> │ │
│ │ self = None │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /home/steiner/.local/share/uv/tools/parllama/lib64/python3.13/site-packages/textual/worker.py:294 in do_work │
│ │
│ 291 │ │ │ ╭─────────────────────────────────── locals ───────────────────────────────────╮ │
│ 292 │ │ │ async def do_work() -> ResultType: │ self = <Worker ERROR name='do_jobs' group='do_jobs' description='do_jobs()'> │ │
│ 293 │ │ │ │ active_worker.set(self) │ work = <coroutine object ParLlamaApp.do_jobs at 0x7f4325037ca0> │ │
│ ❱ 294 │ │ │ │ return await work ╰──────────────────────────────────────────────────────────────────────────────╯ │
│ 295 │ │ │ │
│ 296 │ │ │ return asyncio.run(do_work()) │
│ 297 │
│ │
│ /home/steiner/.local/share/uv/tools/parllama/lib64/python3.13/site-packages/parllama/app.py:436 in do_jobs │
│ │
│ 433 │ │ │ │ elif isinstance(job, CopyModelJob): │
│ 434 │ │ │ │ │ await self.do_copy_local_model(job) │
│ 435 │ │ │ │ elif isinstance(job, CreateModelJob): │
│ ❱ 436 │ │ │ │ │ await self.do_create_model(job) │
│ 437 │ │ │ │ else: │
│ 438 │ │ │ │ │ self.status_notify( │
│ 439 │ │ │ │ │ │ f"Unknown job type {type(job)}", │
│ │
│ ╭──────────────────────────────────────────────────── locals ────────────────────────────────────────────────────╮ │
│ │ job = CreateModelJob( │ │
│ │ │ id=UUID('73162de9-860b-4b3a-b99a-c3b27160b780'), │ │
│ │ │ modelName='alice', │ │
│ │ │ modelCode='FROM gemma2\n\nSYSTEM = """\nYour name is Alice and you are a helpful assistant.\n""'+1, │ │
│ │ │ quantizationLevel='' │ │
│ │ ) │ │
│ │ self = ParLlamaApp(title='PAR LLAMA', classes={'-dark-mode'}, pseudo_classes={'dark', 'focus'}) │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /home/steiner/.local/share/uv/tools/parllama/lib64/python3.13/site-packages/parllama/app.py:397 in do_create_model │
│ │
│ 394 │ │ """Create a new local model""" │
│ 395 │ │ try: │
│ 396 │ │ │ self.main_screen.log_view.richlog.write(job.modelCode) │
│ ❱ 397 │ │ │ res = ollama_dm.create_model(job.modelName, job.modelCode, job.quantizationL │
│ 398 │ │ │ last_status = await self.do_progress(job, res) │
│ 399 │ │ │ │
│ 400 │ │ │ self.main_screen.local_view.post_message( │
│ │
│ ╭──────────────────────────────────────────────────── locals ────────────────────────────────────────────────────╮ │
│ │ job = CreateModelJob( │ │
│ │ │ id=UUID('73162de9-860b-4b3a-b99a-c3b27160b780'), │ │
│ │ │ modelName='alice', │ │
│ │ │ modelCode='FROM gemma2\n\nSYSTEM = """\nYour name is Alice and you are a helpful assistant.\n""'+1, │ │
│ │ │ quantizationLevel='' │ │
│ │ ) │ │
│ │ self = ParLlamaApp(title='PAR LLAMA', classes={'-dark-mode'}, pseudo_classes={'dark', 'focus'}) │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /home/steiner/.local/share/uv/tools/parllama/lib64/python3.13/site-packages/parllama/ollama_data_manager.py:297 in create_model │
│ │
│ 294 │ │ quantize_level: str | None = None, │
│ 295 │ ) -> Iterator[ProgressResponse]: │
│ 296 │ │ """Create a new model.""" │
│ ❱ 297 │ │ return ollama.Client(host=settings.ollama_host).create( │
│ 298 │ │ │ model=model_name, │
│ 299 │ │ │ modelfile=model_code, │
│ 300 │ │ │ quantize=quantize_level, │
│ │
│ ╭───────────────────────────────────────────────── locals ──────────────────────────────────────────────────╮ │
│ │ model_code = 'FROM gemma2\n\nSYSTEM = """\nYour name is Alice and you are a helpful assistant.\n""'+1 │ │
│ │ model_name = 'alice' │ │
│ │ quantize_level = '' │ │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: Client.create() got an unexpected keyword argument 'modelfile'