Skip to content

275 pull ollama models gui#420

Open
ViliTajnic wants to merge 11 commits intomainfrom
275-pull-ollama-models-gui
Open

275 pull ollama models gui#420
ViliTajnic wants to merge 11 commits intomainfrom
275-pull-ollama-models-gui

Conversation

@ViliTajnic
Copy link
Contributor

Adds a Pull button to each Ollama model row in the Models config page, allowing users to download models directly from the GUI without needing to run ollama pull manually.

Changes:

  • POST /v1/models/pull/{provider}/{model_id} endpoint streams Ollama pull progress as NDJSON
  • Pull dialog shows live download progress (single updating line, not a flood of lines)
  • Enabling an Ollama model is blocked with a clear error if the model hasn't been pulled yet
  • Model list now always reflects current enabled/disabled state immediately after save

- POST /v1/models/pull/{provider}/{model_id} endpoint streams Ollama
  /api/pull progress as NDJSON via FastAPI StreamingResponse
- pull_ollama_model() async generator in utils/models.py uses httpx to
  stream from Ollama; yields error lines on connect/HTTP failure
- api_call.post_stream() in client for streaming POST requests
- Pull button added to Ollama model rows in the Models config tab;
  pull_model_dialog() shows live progress via st.status()

Signed-off-by: Vili Tajnic <vili.tajnic@oracle.com>
Use per-row st.columns() instead of shared column containers so the
Pull button always aligns with its model row regardless of whether
adjacent rows have a Pull button or not.

Signed-off-by: Vili Tajnic <vili.tajnic@oracle.com>
Using force=True in get_models() ensures the UI always reflects
current server state after enable/disable/delete operations.

Signed-off-by: Vili Tajnic <vili.tajnic@oracle.com>
Streamlit caches keyed widget values in session state and ignores
the value= parameter on reruns. Pre-set the session state keys from
the freshly-fetched model data before rendering the text_input
widgets so the correct enabled status is always displayed.

Signed-off-by: Vili Tajnic <vili.tajnic@oracle.com>
Use sub-columns within the action column so Edit | Pull appear
inline for Ollama models, matching the desired UI layout.

Signed-off-by: Vili Tajnic <vili.tajnic@oracle.com>
Signed-off-by: Vili Tajnic <vili.tajnic@oracle.com>
Signed-off-by: Vili Tajnic <vili.tajnic@oracle.com>
Signed-off-by: Vili Tajnic <vili.tajnic@oracle.com>
Use st.empty() so each progress update overwrites the previous
line in place instead of appending a new one.

Signed-off-by: Vili Tajnic <vili.tajnic@oracle.com>
Query Ollama's /api/tags endpoint in update() to verify the model
exists locally before allowing it to be enabled. Returns 422 with
a clear message directing the user to the Pull button.

Signed-off-by: Vili Tajnic <vili.tajnic@oracle.com>
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant