Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# OPEN_WEBUI ENV VARS

# Ollama URL for the backend to connect
# The path '/ollama' will be redirected to the specified backend URL
OLLAMA_BASE_URL='http://localhost:11434'
OLLAMA_BASE_URL='https://<WORKSPACE_ID>-3000.2.codesphere.com' # insert your workspace ID

ENABLE_OLLAMA_API='True'
ENABLE_WEBSOCKET_SUPPORT='True'

OPENAI_API_BASE_URL=''
OPENAI_API_KEY=''
Expand All @@ -10,4 +15,17 @@ OPENAI_API_KEY=''
# DO NOT TRACK
SCARF_NO_ANALYTICS=true
DO_NOT_TRACK=true
ANONYMIZED_TELEMETRY=false
ANONYMIZED_TELEMETRY=false


# OLLAMA ENV VARS
OLLAMA_HOST='0.0.0.0:3000'
OLLAMA_MODELS='/home/user/app/models'


# UV ENV VARS
UV_BIN_DIR='/home/user/app/.codesphere-internal/.uv'
UV_PYTHON_INSTALL_DIR='/home/user/app/.codesphere-internal/.uv/python'



3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -307,3 +307,6 @@ dist
cypress/videos
cypress/screenshots
.vscode/settings.json

# Ollama
models/
76 changes: 76 additions & 0 deletions ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
schemaVersion: v0.2
prepare:
steps:
- name: Install codesphere-cli
command: nix build --extra-experimental-features nix-command
--extra-experimental-features flakes github:datata1/codesphere-cli &&
nix-env -i ./result && rm -rf ./result
- name: Copy .env.codesphere to .env when .env not exists
command: cp -n .env.codesphere .env
- name: Set EnvVars
command: codesphere-cli set-env-vars
- name: Install Ollama
command: nix-env -iA nixpkgs.ollama
- name: Download llms
command: nohup ollama serve & sleep 5 && ollama pull llama3.2
- name: Install uv and create Python venv
command: cd backend && if [ ! -d ".venv" ]; then nix-env -iA nixpkgs.uv && uv
venv --python 3.11; fi;
- name: Install Python dependencies
command: cd backend && uv pip install -r requirements.txt
- name: Update node
command: sudo n 22.10
- name: Install node dependencies
command: npm i
- name: Build frontend
command: true || (export NODE_OPTIONS="--max-old-space-size=4096" && npm run
build)
test:
steps: []
run:
frontend:
steps:
- name: update node
command: sudo n 22.10 && node --version
- name: Start frontend
command: export NODE_OPTIONS="--max-old-space-size=4096" && npm run preview --
--host 0.0.0.0 --port 3000
plan: 22
replicas: 1
isPublic: true
network:
path: /
stripPath: false
backend:
steps:
- name: Start Backend
command: npx serve & cd backend && source .venv/bin/activate && ./start.sh
plan: 22
replicas: 1
isPublic: true
network:
ports:
- port: 3000
isPublic: true
- port: 8080
isPublic: true
paths:
- port: 8080
path: /api
stripPath: false
- port: 8080
path: /ws
stripPath: false
- port: 8080
path: /ollama
stripPath: false
- port: 8080
path: /openai
stripPath: false
ollama:
steps:
- name: Run ollama
command: ollama serve
plan: 22
replicas: 1
isPublic: false
3 changes: 3 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ export default defineConfig({
]
})
],
preview: {
allowedHosts: ['.2.codesphere.com'],
},
define: {
APP_VERSION: JSON.stringify(process.env.npm_package_version),
APP_BUILD_HASH: JSON.stringify(process.env.APP_BUILD_HASH || 'dev-build')
Expand Down