# deeparajasabeson/models-from-ollamastudio-dockerdesktop architecture

> Architecture diagram of the GitHub repository deeparajasabeson/models-from-ollamastudio-dockerdesktop, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/deeparajasabeson/models-from-ollamastudio-dockerdesktop
- Repository: https://github.com/deeparajasabeson/models-from-ollamastudio-dockerdesktop

## Overview

This repository is a small set of terminal chat demos for locally served language models. The main workflows are direct, streamed chat through Ollama; document-grounded chat that extracts PDF text, selects context, and sends it with the question to Ollama; and chat through Docker Desktop’s OpenAI-compatible endpoint. The PDF stages and model calls are visible in the excerpts. The README documents the local and Docker use cases; no separate service implementation is present in the tree.

Main entry points: [`chat-file.py`](https://github.com/deeparajasabeson/models-from-ollamastudio-dockerdesktop/blob/main/chat-file.py) (PDF chat loop), [`chat.py`](https://github.com/deeparajasabeson/models-from-ollamastudio-dockerdesktop/blob/main/chat.py) (Ollama chat), [`docker-chat.py`](https://github.com/deeparajasabeson/models-from-ollamastudio-dockerdesktop/blob/main/docker-chat.py) (Docker chat), [`data/Deepa-PythonAzureAIAgenticAIMCPDotNET.pdf`](https://github.com/deeparajasabeson/models-from-ollamastudio-dockerdesktop/blob/main/data/Deepa-PythonAzureAIAgenticAIMCPDotNET.pdf) (Reference PDF)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_chat["Terminal chat demos"]
  node_ollama_chat["Ollama chat<br/>[chat.py]"]
  node_docker_chat["Docker chat<br/>[docker-chat.py]"]
  node_package_stub["Package entry stub<br/>[__init__.py]"]
end

subgraph group_rag["PDF-grounded chat"]
  node_rag_loop["PDF chat loop<br/>[chat-file.py]"]
  node_pdf["Reference PDF"]
  node_extract["Text extraction<br/>[chat-file.py]"]
  node_chunk["Text chunking<br/>[chat-file.py]"]
  node_retrieve["Chunk retrieval<br/>[chat-file.py]"]
end

subgraph group_runtime["Model runtimes"]
  node_ollama{{"Ollama model"}}
  node_docker_endpoint{{"Docker model endpoint"}}
end

node_user(("Terminal user"))

node_user -->|"enters query"| node_ollama_chat
node_ollama_chat -->|"streams chat"| node_ollama
node_user -->|"enters query"| node_docker_chat
node_docker_chat -->|"requests completion"| node_docker_endpoint
node_user -->|"asks question"| node_rag_loop
node_rag_loop -->|"loads document"| node_pdf
node_rag_loop -->|"calls extraction"| node_extract
node_extract -->|"reads pages"| node_pdf
node_rag_loop -->|"chunks text"| node_chunk
node_rag_loop -->|"selects context"| node_retrieve
node_rag_loop -->|"sends context"| node_ollama

click node_ollama_chat "https://github.com/deeparajasabeson/models-from-ollamastudio-dockerdesktop/blob/main/chat.py"
click node_docker_chat "https://github.com/deeparajasabeson/models-from-ollamastudio-dockerdesktop/blob/main/docker-chat.py"
click node_rag_loop "https://github.com/deeparajasabeson/models-from-ollamastudio-dockerdesktop/blob/main/chat-file.py"
click node_pdf "https://github.com/deeparajasabeson/models-from-ollamastudio-dockerdesktop/blob/main/data/Deepa-PythonAzureAIAgenticAIMCPDotNET.pdf"
click node_extract "https://github.com/deeparajasabeson/models-from-ollamastudio-dockerdesktop/blob/main/chat-file.py"
click node_chunk "https://github.com/deeparajasabeson/models-from-ollamastudio-dockerdesktop/blob/main/chat-file.py"
click node_retrieve "https://github.com/deeparajasabeson/models-from-ollamastudio-dockerdesktop/blob/main/chat-file.py"
click node_package_stub "https://github.com/deeparajasabeson/models-from-ollamastudio-dockerdesktop/blob/main/src/ollamastudio/__init__.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ollama_chat,node_docker_chat,node_package_stub,node_user toneBlue
class node_rag_loop,node_pdf,node_extract,node_chunk,node_retrieve toneAmber
class node_ollama,node_docker_endpoint toneMint
```

## Components

### Terminal chat demos

- [Ollama chat](https://github.com/deeparajasabeson/models-from-ollamastudio-dockerdesktop/blob/main/chat.py): `chat.py`
- [Docker chat](https://github.com/deeparajasabeson/models-from-ollamastudio-dockerdesktop/blob/main/docker-chat.py): `docker-chat.py`
- [Package entry stub](https://github.com/deeparajasabeson/models-from-ollamastudio-dockerdesktop/blob/main/src/ollamastudio/__init__.py): `src/ollamastudio/__init__.py`

### PDF-grounded chat

- [PDF chat loop](https://github.com/deeparajasabeson/models-from-ollamastudio-dockerdesktop/blob/main/chat-file.py): `chat-file.py`
- [Reference PDF](https://github.com/deeparajasabeson/models-from-ollamastudio-dockerdesktop/blob/main/data/Deepa-PythonAzureAIAgenticAIMCPDotNET.pdf): `data/Deepa-PythonAzureAIAgenticAIMCPDotNET.pdf`
- [Text extraction](https://github.com/deeparajasabeson/models-from-ollamastudio-dockerdesktop/blob/main/chat-file.py): `chat-file.py`
- [Text chunking](https://github.com/deeparajasabeson/models-from-ollamastudio-dockerdesktop/blob/main/chat-file.py): `chat-file.py`
- [Chunk retrieval](https://github.com/deeparajasabeson/models-from-ollamastudio-dockerdesktop/blob/main/chat-file.py): `chat-file.py`

### Model runtimes

- **Ollama model**
- **Docker model endpoint**

### Other components

- **Terminal user**

## Connections

- Terminal user → Ollama chat: enters query (evidence: `chat.py`)
- Ollama chat → Ollama model: streams chat (evidence: `chat.py`)
- Terminal user → Docker chat: enters query (evidence: `docker-chat.py`)
- Docker chat → Docker model endpoint: requests completion (evidence: `docker-chat.py`)
- Terminal user → PDF chat loop: asks question (evidence: `chat-file.py`)
- PDF chat loop → Reference PDF: loads document (evidence: `chat-file.py`)
- PDF chat loop → Text extraction: calls extraction (evidence: `chat-file.py`)
- Text extraction → Reference PDF: reads pages (evidence: `chat-file.py`)
- PDF chat loop → Text chunking: chunks text (evidence: `chat-file.py`)
- PDF chat loop → Chunk retrieval: selects context (evidence: `chat-file.py`)
- PDF chat loop → Ollama model: sends context (evidence: `chat-file.py`)
