network-diagrams.mdx 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. ---
  2. sidebar_position: 3
  3. title: "🕸️ Network Diagrams"
  4. ---
  5. Here, we provide clear and structured diagrams to help you understand how various components of the network interact within different setups. This documentation is designed to assist both macOS/Windows and Linux users. Each scenario is illustrated using Mermaid diagrams to show how the interactions are set up depending on the different system configurations and deployment strategies.
  6. ## Mac OS/Windows Setup Options 🖥️
  7. ### Ollama on Host, Open WebUI in Container
  8. In this scenario, `Ollama` runs directly on the host machine while `Open WebUI` operates within a Docker container.
  9. ```mermaid
  10. C4Context
  11. Boundary(b0, "Hosting Machine - Mac OS/Windows") {
  12. Person(user, "User")
  13. Boundary(b1, "Docker Desktop's Linux VM") {
  14. Component(openwebui, "Open WebUI", "Listening on port 8080")
  15. }
  16. Component(ollama, "Ollama", "Listening on port 11434")
  17. }
  18. Rel(openwebui, ollama, "Makes API calls via Docker proxy", "http://host.docker.internal:11434")
  19. Rel(user, openwebui, "Makes requests via exposed port -p 3000:8080", "http://localhost:3000")
  20. UpdateRelStyle(user, openwebui, $offsetX="-100", $offsetY="-50")
  21. ```
  22. ### Ollama and Open WebUI in Compose Stack
  23. Both `Ollama` and `Open WebUI` are configured within the same Docker Compose stack, simplifying network communications.
  24. ```mermaid
  25. C4Context
  26. Boundary(b0, "Hosting Machine - Mac OS/Windows") {
  27. Person(user, "User")
  28. Boundary(b1, "Docker Desktop's Linux VM") {
  29. Boundary(b2, "Compose Stack") {
  30. Component(openwebui, "Open WebUI", "Listening on port 8080")
  31. Component(ollama, "Ollama", "Listening on port 11434")
  32. }
  33. }
  34. }
  35. Rel(openwebui, ollama, "Makes API calls via inter-container networking", "http://ollama:11434")
  36. Rel(user, openwebui, "Makes requests via exposed port -p 3000:8080", "http://localhost:3000")
  37. UpdateRelStyle(user, openwebui, $offsetX="-100", $offsetY="-50")
  38. ```
  39. ### Ollama and Open WebUI, Separate Networks
  40. Here, `Ollama` and `Open WebUI` are deployed in separate Docker networks, potentially leading to connectivity issues.
  41. ```mermaid
  42. C4Context
  43. Boundary(b0, "Hosting Machine - Mac OS/Windows") {
  44. Person(user, "User")
  45. Boundary(b1, "Docker Desktop's Linux VM") {
  46. Boundary(b2, "Network A") {
  47. Component(openwebui, "Open WebUI", "Listening on port 8080")
  48. }
  49. Boundary(b3, "Network B") {
  50. Component(ollama, "Ollama", "Listening on port 11434")
  51. }
  52. }
  53. }
  54. Rel(openwebui, ollama, "Unable to connect")
  55. Rel(user, openwebui, "Makes requests via exposed port -p 3000:8080", "http://localhost:3000")
  56. UpdateRelStyle(user, openwebui, $offsetX="-100", $offsetY="-50")
  57. ```
  58. ### Open WebUI in Host Network
  59. In this configuration, `Open WebUI` utilizes the host network, which impacts its ability to connect in certain environments.
  60. ```mermaid
  61. C4Context
  62. Boundary(b0, "Hosting Machine - Mac OS/Windows") {
  63. Person(user, "User")
  64. Boundary(b1, "Docker Desktop's Linux VM") {
  65. Component(openwebui, "Open WebUI", "Listening on port 8080")
  66. }
  67. }
  68. Rel(user, openwebui, "Unable to connect, host network is the VM's network")
  69. UpdateRelStyle(user, openwebui, $offsetX="-100", $offsetY="-50")
  70. ```
  71. ## Linux Setup Options 🐧
  72. ### Ollama on Host, Open WebUI in Container (Linux)
  73. This diagram is specific to the Linux platform, with `Ollama` running on the host and `Open WebUI` deployed inside a Docker container.
  74. ```mermaid
  75. C4Context
  76. Boundary(b0, "Hosting Machine - Linux") {
  77. Person(user, "User")
  78. Boundary(b1, "Container Network") {
  79. Component(openwebui, "Open WebUI", "Listening on port 8080")
  80. }
  81. Component(ollama, "Ollama", "Listening on port 11434")
  82. }
  83. Rel(openwebui, ollama, "Makes API calls via Docker proxy", "http://host.docker.internal:11434")
  84. Rel(user, openwebui, "Makes requests via exposed port -p 3000:8080", "http://localhost:3000")
  85. UpdateRelStyle(user, openwebui, $offsetX="-100", $offsetY="-50")
  86. ```
  87. ### Ollama and Open WebUI in Compose Stack (Linux)
  88. A set-up where both `Ollama` and `Open WebUI` reside within the same Docker Compose stack, allowing for straightforward networking on Linux.
  89. ```mermaid
  90. C4Context
  91. Boundary(b0, "Hosting Machine - Linux") {
  92. Person(user, "User")
  93. Boundary(b1, "Container Network") {
  94. Boundary(b2, "Compose Stack") {
  95. Component(openwebui, "Open WebUI", "Listening on port 8080")
  96. Component(ollama, "Ollama", "Listening on port 11434")
  97. }
  98. }
  99. }
  100. Rel(openwebui, ollama, "Makes API calls via inter-container networking", "http://ollama:11434")
  101. Rel(user, openwebui, "Makes requests via exposed port -p 3000:8080", "http://localhost:3000")
  102. UpdateRelStyle(user, openwebui, $offsetX="-100", $offsetY="-50")
  103. ```
  104. ### Ollama and Open WebUI, Separate Networks (Linux)
  105. A scenario in which `Ollama` and `Open WebUI` are in different Docker networks under a Linux environment, which could hinder connectivity.
  106. ```mermaid
  107. C4Context
  108. Boundary(b0, "Hosting Machine - Linux") {
  109. Person(user, "User")
  110. Boundary(b2, "Container Network A") {
  111. Component(openwebui, "Open WebUI", "Listening on port 8080")
  112. }
  113. Boundary(b3, "Container Network B") {
  114. Component(ollama, "Ollama", "Listening on port 11434")
  115. }
  116. }
  117. Rel(openwebui, ollama, "Unable to connect")
  118. Rel(user, openwebui, "Makes requests via exposed port -p 3000:8080", "http://localhost:3000")
  119. UpdateRelStyle(user, openwebui, $offsetX="-100", $offsetY="-50")
  120. ```
  121. ### Open WebUI in Host Network, Ollama on Host (Linux)
  122. An optimal layout where both `Open WebUI` and `Ollama` use the host’s network, facilitating seamless interaction on Linux systems.
  123. ```mermaid
  124. C4Context
  125. Boundary(b0, "Hosting Machine - Linux") {
  126. Person(user, "User")
  127. Component(openwebui, "Open WebUI", "Listening on port 8080")
  128. Component(ollama, "Ollama", "Listening on port 11434")
  129. }
  130. Rel(openwebui, ollama, "Makes API calls via localhost", "http://localhost:11434")
  131. Rel(user, openwebui, "Makes requests via listening port", "http://localhost:8080")
  132. UpdateRelStyle(user, openwebui, $offsetX="-100", $offsetY="-50")
  133. ```
  134. Each setup addresses different deployment strategies and networking configurations to help you choose the best layout for your requirements.