{"id":27293312,"url":"https://github.com/chaunceyt/aichat-workspace-operator","last_synced_at":"2026-04-30T09:36:10.192Z","repository":{"id":267520595,"uuid":"886927999","full_name":"chaunceyt/aichat-workspace-operator","owner":"chaunceyt","description":"AIChat Workspace Operator","archived":false,"fork":false,"pushed_at":"2025-01-16T23:04:56.000Z","size":1035,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T22:43:41.631Z","etag":null,"topics":["llms","ollama","open-webui"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chaunceyt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-11T21:30:20.000Z","updated_at":"2024-12-26T05:50:42.000Z","dependencies_parsed_at":"2024-12-10T20:36:56.379Z","dependency_job_id":"29fa4f6f-a48b-4e43-b6b5-a1c4acb16ce9","html_url":"https://github.com/chaunceyt/aichat-workspace-operator","commit_stats":null,"previous_names":["chaunceyt/aichat-workspace-operator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chaunceyt/aichat-workspace-operator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaunceyt%2Faichat-workspace-operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaunceyt%2Faichat-workspace-operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaunceyt%2Faichat-workspace-operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaunceyt%2Faichat-workspace-operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chaunceyt","download_url":"https://codeload.github.com/chaunceyt/aichat-workspace-operator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaunceyt%2Faichat-workspace-operator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32460781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["llms","ollama","open-webui"],"created_at":"2025-04-11T22:43:40.674Z","updated_at":"2026-04-30T09:36:10.171Z","avatar_url":"https://github.com/chaunceyt.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AIChat Workspace Operator\n\n**Disclaimer**: This project is currently under development and may change rapidly, including breaking changes. Use with caution in production environments.\n\nCreate AIChat Workspaces powered by [Open WebUI](https://openwebui.com/) and [Ollama](https://ollama.com/)\n\n## Objectives\n\nCreate a **LLM as a Service** using Ollama to provide the API for interacting with LLMs. \n\nCreate a Kubernetes Operator that creates the `control-plane` for the **LLM as a Service**. The operator should manage the lifecycle of each Kubernetes resource needed to run the selected service in a namespace. By dynamically creating, and managing the resources needed to run the AIChat Workspace. The resources for each AIChat Workspace should be separated, reducing interference between tenants and optimizing resource utilization.\n\nCreate a Model from a modelfile that sets the `SYSTEM` prompt for the model using one-to-many [fabric/patterns](https://github.com/danielmiessler/fabric/tree/main/patterns) `SYSTEM` prompts. \n\n\n## Design and Implementation\n\n### Design\n\n\nThe purpose of this design is to support running AIChat Workspaces within a Namespace as a Service offering.\n\n\n![image](diagrams/aichatworkspace-operator-components.png)\n\nPersonas that will interact with the environment. Platform Engineers, and AIChatWorkspace owners\n\n![image](diagrams/simple-persona-workflow.png)\n\n## Implementation\n\n* Used go version `1.23`\n* Used Kubebuilder `v4.3.1` to generate most of the code.\n* Used Kind to create the K8s cluster running `v1.31.0`.\n* KEDA's `HTTPScaledObject` is being used to address the **scale-to-zero** requirement.\n* Defaulted to xSmall LLMs i.e. `gemma2:2b`, `llama3.2:1b`, or `qwen2.5-coder:1.5b` in custom resource manifests. \n\nLegend: ❌ roadmap ✅ completed initial implementation\n\n* ✅ Controller for `AIChatWorkspace` resources\n* ✅ The `AIChatWorkspace` represents the resources needed to run [Open WebUI](https://openwebui.com/) and [Ollama](https://ollama.com/) in a namespace.\n* ✅ When a new `AIChatWorkspace` is created. Create each Kubernetes resource located [here]](https://github.com/open-webui/open-webui/tree/main/kubernetes/manifest/base) as the base.\n* ✅ Handle updates to `AIChatWorkspace` and owned resources\n* ✅ Handle deletions of `AIChatWorkspace` ensuring the associated resources are also deleted.\n* ✅ Handle pulling in requested models\n* ✅ Create model from modelfile using a SYSTEM prompts from [fabric/patterns](https://github.com/danielmiessler/fabric/tree/main/patterns)\n* ✅ API endpoint for register and login and calling a protected endpoint. (use: curl, postman, etc)\n* Manage the lifecycle of each application (Open WebUI and Ollama)\n* ✅ e2e testing (using Kyverno Chainsaw)\n* ❌ Scale-to-Zero after no request are received for a period of time. (scale up on new requests) [testing](hack/scale-to-zero/)\n* ❌ Add auth to the Ollama endpoint, consider envoy sidecar proxy providing auth or use basic-auth for ingress-nginx. (basic-auth, jwt) [testing](hack/envoy-sidecar/)\n* ❌ List of resource in the describe of the aichatworkspace object. (pods, pvc, svc, models running, etc)\n* ✅ Support for most of the `system.md` located under [fabric/patterns](https://github.com/danielmiessler/fabric/tree/main/patterns)\n* ❌ API endpoint to manage AIChat workspace. (use: curl, postman, etc)\n* ❌ Built in SRE that monitors the events of AIChat Workspace workloads and interact with LLM to identify a solution.\n* ❌ Observability (i.e, grafana, loki, prometheus, promtail, and tempo)\n* ❌ Helm chart (with unittest)\n* ❌ Web Frontend\n\n### Components that will be dynamically created and managed:\n\n* ✅ Namespace - for isolation\n* ✅ ResourceQuota - optimizing resource usage\n* ✅ ServiceAccount - one per service (to ensure the workloads are not using the default)\n* ✅ Statefulset - running Ollama\n* ✅ Deployment - running Open WebUI\n* ✅ PVC to store the downloaded LLMs\n* ✅ Kubernetes Service for Ollama\n* ✅ Kubernetes Service for Open WebUI\n* ✅ Ingress object for Ollama\n* ✅ Ingress object for Open WebUI\n* ❌ KEDA HTTPScaledObject to scale the Open WebUI to zero after no requests are received based on `scaledownPeriod`.\n* ❌ K8s ExternalService for open-webui scale-to-zero functionality\n* ❌ NetworkPolicy allow traffic from ingress controller namespace to Open WebUI and Ollama\n\n### Dependencies\n\nThis project has a number of external dependencies that contribute to the **LLM as a Service** solution\n\n* ✅ Database for the AIChat Workspace API. User information\n* ✅ Ingress controller\n* ❌ CNI that supports network policies (optional)\n* ❌ Statefulset running Ollama (will be used for SRE features)\n* ❌ Vault to manage secrets for the API database\n* ✅ KEDA for scale-to-zero of AIChat Workspaces\n\n### Features before considered feature complete\n\n# Getting Started\n\n### Prerequisites\n* go version v1.23.0+\n* kubectl version v1.31.0+.\n* A KinD Kubernetes cluster. (Developed/Tested using Kind v1.31.0+)\n\n\n### To Test this project\n\n* To run unit tests.\n\n```sh\nmake test\n```\n\n* To run chainsaw e2e tests.\n\n```sh\nmake chainsaw\n```\n\n### Run the project\n\nRunning the script below will create install everything needed to run this locally using a kind create cluster.\n\n```sh\n# Setup KinD cluster and install needed dependencies.\n./from-scratch.sh\n\n# Run the sample\nkustomize build config/samples/ | kubectl -n aichat-workspace-operator-system apply -f -\nkubectl rollout status deploy team-a-aichat-openwebui -n team-a-aichat\nkubectl rollout status sts team-a-aichat-ollama -n team-a-aichat\n\n# \nkubectl get all,ing,pvc,resourcequota -n team-a-aichat\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaunceyt%2Faichat-workspace-operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchaunceyt%2Faichat-workspace-operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaunceyt%2Faichat-workspace-operator/lists"}