Skip to content

Report approximate task progress to the Assistant while generating #241

Description

@oleksandr-nc

Background

llm2 is a Nextcloud External App (ExApp) that runs a local language model and answers AI requests -summarize, free prompt, reformulate, etc. - through Nextcloud's Task Processing framework: a user triggers an action, Nextcloud creates a task, llm2 picks it up, runs the model, and returns the result

Task Processing supports a progress value (0–100%) that a provider can report while it works, and the Assistant renders it as a progress bar. llm2 never reports it, so while the model generates the user sees no real progress - for a long summary the app can look frozen

Proposed change

Make llm2 report an approximate progress while it processes a task, so the Assistant's progress bar advances instead of staying at 0 until the result is suddenly ready. Reporting progress for at least one task type is a good starting point.

"Approximate" is deliberate: a language model generates text token by token and has no inherent notion of percent-complete, so a reasonable estimate — with its limitations understood - is what we are after.

Pointers

  • llm2's task handling - its main loop and the per-task processors - lives in this repo.
  • The library llm2 uses to talk to Nextcloud is
    nc_py_api; look at how a provider reports task
    results, and what else a provider can report back while a task runs.
  • Nextcloud's developer documentation has a Task Processing section worth reading.
  • Under the hood the model runs via llama.cpp (through llama-cpp-python / LangChain); text
    generation is where any real progress signal would come from.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions