diff --git a/backend/apps/ollama/main.py b/backend/apps/ollama/main.py index 7288f3467..09c50286a 100644 --- a/backend/apps/ollama/main.py +++ b/backend/apps/ollama/main.py @@ -29,8 +29,8 @@ import time from urllib.parse import urlparse from typing import Optional, List, Union -from apps.web.models.models import Models -from apps.web.models.users import Users +from apps.webui.models.models import Models +from apps.webui.models.users import Users from constants import ERROR_MESSAGES from utils.utils import ( decode_token, diff --git a/backend/apps/openai/main.py b/backend/apps/openai/main.py index ded7e6626..74ac18a12 100644 --- a/backend/apps/openai/main.py +++ b/backend/apps/openai/main.py @@ -10,8 +10,8 @@ import logging from pydantic import BaseModel -from apps.web.models.models import Models -from apps.web.models.users import Users +from apps.webui.models.models import Models +from apps.webui.models.users import Users from constants import ERROR_MESSAGES from utils.utils import ( decode_token, diff --git a/backend/apps/web/internal/db.py b/backend/apps/webui/internal/db.py similarity index 100% rename from backend/apps/web/internal/db.py rename to backend/apps/webui/internal/db.py diff --git a/backend/apps/web/internal/migrations/001_initial_schema.py b/backend/apps/webui/internal/migrations/001_initial_schema.py similarity index 100% rename from backend/apps/web/internal/migrations/001_initial_schema.py rename to backend/apps/webui/internal/migrations/001_initial_schema.py diff --git a/backend/apps/web/internal/migrations/002_add_local_sharing.py b/backend/apps/webui/internal/migrations/002_add_local_sharing.py similarity index 100% rename from backend/apps/web/internal/migrations/002_add_local_sharing.py rename to backend/apps/webui/internal/migrations/002_add_local_sharing.py diff --git a/backend/apps/web/internal/migrations/003_add_auth_api_key.py b/backend/apps/webui/internal/migrations/003_add_auth_api_key.py similarity index 100% rename from backend/apps/web/internal/migrations/003_add_auth_api_key.py rename to backend/apps/webui/internal/migrations/003_add_auth_api_key.py diff --git a/backend/apps/web/internal/migrations/004_add_archived.py b/backend/apps/webui/internal/migrations/004_add_archived.py similarity index 100% rename from backend/apps/web/internal/migrations/004_add_archived.py rename to backend/apps/webui/internal/migrations/004_add_archived.py diff --git a/backend/apps/web/internal/migrations/005_add_updated_at.py b/backend/apps/webui/internal/migrations/005_add_updated_at.py similarity index 100% rename from backend/apps/web/internal/migrations/005_add_updated_at.py rename to backend/apps/webui/internal/migrations/005_add_updated_at.py diff --git a/backend/apps/web/internal/migrations/006_migrate_timestamps_and_charfields.py b/backend/apps/webui/internal/migrations/006_migrate_timestamps_and_charfields.py similarity index 100% rename from backend/apps/web/internal/migrations/006_migrate_timestamps_and_charfields.py rename to backend/apps/webui/internal/migrations/006_migrate_timestamps_and_charfields.py diff --git a/backend/apps/web/internal/migrations/007_add_user_last_active_at.py b/backend/apps/webui/internal/migrations/007_add_user_last_active_at.py similarity index 100% rename from backend/apps/web/internal/migrations/007_add_user_last_active_at.py rename to backend/apps/webui/internal/migrations/007_add_user_last_active_at.py diff --git a/backend/apps/web/internal/migrations/008_add_memory.py b/backend/apps/webui/internal/migrations/008_add_memory.py similarity index 100% rename from backend/apps/web/internal/migrations/008_add_memory.py rename to backend/apps/webui/internal/migrations/008_add_memory.py diff --git a/backend/apps/web/internal/migrations/009_add_models.py b/backend/apps/webui/internal/migrations/009_add_models.py similarity index 100% rename from backend/apps/web/internal/migrations/009_add_models.py rename to backend/apps/webui/internal/migrations/009_add_models.py diff --git a/backend/apps/web/internal/migrations/010_migrate_modelfiles_to_models.py b/backend/apps/webui/internal/migrations/010_migrate_modelfiles_to_models.py similarity index 100% rename from backend/apps/web/internal/migrations/010_migrate_modelfiles_to_models.py rename to backend/apps/webui/internal/migrations/010_migrate_modelfiles_to_models.py diff --git a/backend/apps/web/internal/migrations/README.md b/backend/apps/webui/internal/migrations/README.md similarity index 84% rename from backend/apps/web/internal/migrations/README.md rename to backend/apps/webui/internal/migrations/README.md index 63d92e802..260214113 100644 --- a/backend/apps/web/internal/migrations/README.md +++ b/backend/apps/webui/internal/migrations/README.md @@ -14,7 +14,7 @@ You will need to create a migration file to ensure that existing databases are u 2. Make your changes to the models. 3. From the `backend` directory, run the following command: ```bash - pw_migrate create --auto --auto-source apps.web.models --database sqlite:///${SQLITE_DB} --directory apps/web/internal/migrations ${MIGRATION_NAME} + pw_migrate create --auto --auto-source apps.webui.models --database sqlite:///${SQLITE_DB} --directory apps/web/internal/migrations ${MIGRATION_NAME} ``` - `$SQLITE_DB` should be the path to the database file. - `$MIGRATION_NAME` should be a descriptive name for the migration. diff --git a/backend/apps/web/main.py b/backend/apps/webui/main.py similarity index 98% rename from backend/apps/web/main.py rename to backend/apps/webui/main.py index 9704cde77..d736cef9a 100644 --- a/backend/apps/web/main.py +++ b/backend/apps/webui/main.py @@ -1,7 +1,7 @@ from fastapi import FastAPI, Depends from fastapi.routing import APIRoute from fastapi.middleware.cors import CORSMiddleware -from apps.web.routers import ( +from apps.webui.routers import ( auths, users, chats, diff --git a/backend/apps/web/models/auths.py b/backend/apps/webui/models/auths.py similarity index 98% rename from backend/apps/web/models/auths.py rename to backend/apps/webui/models/auths.py index dfa0c4395..e3b659e43 100644 --- a/backend/apps/web/models/auths.py +++ b/backend/apps/webui/models/auths.py @@ -5,10 +5,10 @@ import uuid import logging from peewee import * -from apps.web.models.users import UserModel, Users +from apps.webui.models.users import UserModel, Users from utils.utils import verify_password -from apps.web.internal.db import DB +from apps.webui.internal.db import DB from config import SRC_LOG_LEVELS diff --git a/backend/apps/web/models/chats.py b/backend/apps/webui/models/chats.py similarity index 99% rename from backend/apps/web/models/chats.py rename to backend/apps/webui/models/chats.py index 891151b94..a07ec5e30 100644 --- a/backend/apps/web/models/chats.py +++ b/backend/apps/webui/models/chats.py @@ -7,7 +7,7 @@ import json import uuid import time -from apps.web.internal.db import DB +from apps.webui.internal.db import DB #################### # Chat DB Schema diff --git a/backend/apps/web/models/documents.py b/backend/apps/webui/models/documents.py similarity index 99% rename from backend/apps/web/models/documents.py rename to backend/apps/webui/models/documents.py index 42b99596c..3b730535f 100644 --- a/backend/apps/web/models/documents.py +++ b/backend/apps/webui/models/documents.py @@ -8,7 +8,7 @@ import logging from utils.utils import decode_token from utils.misc import get_gravatar_url -from apps.web.internal.db import DB +from apps.webui.internal.db import DB import json diff --git a/backend/apps/web/models/memories.py b/backend/apps/webui/models/memories.py similarity index 97% rename from backend/apps/web/models/memories.py rename to backend/apps/webui/models/memories.py index 8382b3e52..70e5577e9 100644 --- a/backend/apps/web/models/memories.py +++ b/backend/apps/webui/models/memories.py @@ -3,8 +3,8 @@ from peewee import * from playhouse.shortcuts import model_to_dict from typing import List, Union, Optional -from apps.web.internal.db import DB -from apps.web.models.chats import Chats +from apps.webui.internal.db import DB +from apps.webui.models.chats import Chats import time import uuid diff --git a/backend/apps/web/models/models.py b/backend/apps/webui/models/models.py similarity index 98% rename from backend/apps/web/models/models.py rename to backend/apps/webui/models/models.py index bf835c8fd..851352398 100644 --- a/backend/apps/web/models/models.py +++ b/backend/apps/webui/models/models.py @@ -8,7 +8,7 @@ from peewee import * from playhouse.shortcuts import model_to_dict from pydantic import BaseModel, ConfigDict -from apps.web.internal.db import DB, JSONField +from apps.webui.internal.db import DB, JSONField from typing import List, Union, Optional from config import SRC_LOG_LEVELS diff --git a/backend/apps/web/models/prompts.py b/backend/apps/webui/models/prompts.py similarity index 98% rename from backend/apps/web/models/prompts.py rename to backend/apps/webui/models/prompts.py index bc4e3e58b..c4ac6be14 100644 --- a/backend/apps/web/models/prompts.py +++ b/backend/apps/webui/models/prompts.py @@ -7,7 +7,7 @@ import time from utils.utils import decode_token from utils.misc import get_gravatar_url -from apps.web.internal.db import DB +from apps.webui.internal.db import DB import json diff --git a/backend/apps/web/models/tags.py b/backend/apps/webui/models/tags.py similarity index 99% rename from backend/apps/web/models/tags.py rename to backend/apps/webui/models/tags.py index d9a967ff7..4c4fa82e6 100644 --- a/backend/apps/web/models/tags.py +++ b/backend/apps/webui/models/tags.py @@ -8,7 +8,7 @@ import uuid import time import logging -from apps.web.internal.db import DB +from apps.webui.internal.db import DB from config import SRC_LOG_LEVELS diff --git a/backend/apps/web/models/users.py b/backend/apps/webui/models/users.py similarity index 98% rename from backend/apps/web/models/users.py rename to backend/apps/webui/models/users.py index 450dd9187..8f600c6d5 100644 --- a/backend/apps/web/models/users.py +++ b/backend/apps/webui/models/users.py @@ -5,8 +5,8 @@ from typing import List, Union, Optional import time from utils.misc import get_gravatar_url -from apps.web.internal.db import DB -from apps.web.models.chats import Chats +from apps.webui.internal.db import DB +from apps.webui.models.chats import Chats #################### # User DB Schema diff --git a/backend/apps/web/routers/auths.py b/backend/apps/webui/routers/auths.py similarity index 99% rename from backend/apps/web/routers/auths.py rename to backend/apps/webui/routers/auths.py index 998e74659..ce9b92061 100644 --- a/backend/apps/web/routers/auths.py +++ b/backend/apps/webui/routers/auths.py @@ -10,7 +10,7 @@ import uuid import csv -from apps.web.models.auths import ( +from apps.webui.models.auths import ( SigninForm, SignupForm, AddUserForm, @@ -21,7 +21,7 @@ from apps.web.models.auths import ( Auths, ApiKey, ) -from apps.web.models.users import Users +from apps.webui.models.users import Users from utils.utils import ( get_password_hash, diff --git a/backend/apps/web/routers/chats.py b/backend/apps/webui/routers/chats.py similarity index 99% rename from backend/apps/web/routers/chats.py rename to backend/apps/webui/routers/chats.py index aaf173521..e0c824a8e 100644 --- a/backend/apps/web/routers/chats.py +++ b/backend/apps/webui/routers/chats.py @@ -7,8 +7,8 @@ from pydantic import BaseModel import json import logging -from apps.web.models.users import Users -from apps.web.models.chats import ( +from apps.webui.models.users import Users +from apps.webui.models.chats import ( ChatModel, ChatResponse, ChatTitleForm, @@ -18,7 +18,7 @@ from apps.web.models.chats import ( ) -from apps.web.models.tags import ( +from apps.webui.models.tags import ( TagModel, ChatIdTagModel, ChatIdTagForm, diff --git a/backend/apps/web/routers/configs.py b/backend/apps/webui/routers/configs.py similarity index 97% rename from backend/apps/web/routers/configs.py rename to backend/apps/webui/routers/configs.py index 143ed5e0a..00feafb18 100644 --- a/backend/apps/web/routers/configs.py +++ b/backend/apps/webui/routers/configs.py @@ -8,7 +8,7 @@ from pydantic import BaseModel import time import uuid -from apps.web.models.users import Users +from apps.webui.models.users import Users from utils.utils import ( get_password_hash, diff --git a/backend/apps/web/routers/documents.py b/backend/apps/webui/routers/documents.py similarity index 98% rename from backend/apps/web/routers/documents.py rename to backend/apps/webui/routers/documents.py index 7c69514fe..c5447a3fe 100644 --- a/backend/apps/web/routers/documents.py +++ b/backend/apps/webui/routers/documents.py @@ -6,7 +6,7 @@ from fastapi import APIRouter from pydantic import BaseModel import json -from apps.web.models.documents import ( +from apps.webui.models.documents import ( Documents, DocumentForm, DocumentUpdateForm, diff --git a/backend/apps/web/routers/memories.py b/backend/apps/webui/routers/memories.py similarity index 98% rename from backend/apps/web/routers/memories.py rename to backend/apps/webui/routers/memories.py index f20e02601..6448ebe1e 100644 --- a/backend/apps/web/routers/memories.py +++ b/backend/apps/webui/routers/memories.py @@ -7,7 +7,7 @@ from fastapi import APIRouter from pydantic import BaseModel import logging -from apps.web.models.memories import Memories, MemoryModel +from apps.webui.models.memories import Memories, MemoryModel from utils.utils import get_verified_user from constants import ERROR_MESSAGES diff --git a/backend/apps/web/routers/models.py b/backend/apps/webui/routers/models.py similarity index 97% rename from backend/apps/web/routers/models.py rename to backend/apps/webui/routers/models.py index 81140c861..363737e25 100644 --- a/backend/apps/web/routers/models.py +++ b/backend/apps/webui/routers/models.py @@ -5,7 +5,7 @@ from typing import List, Union, Optional from fastapi import APIRouter from pydantic import BaseModel import json -from apps.web.models.models import Models, ModelModel, ModelForm, ModelResponse +from apps.webui.models.models import Models, ModelModel, ModelForm, ModelResponse from utils.utils import get_verified_user, get_admin_user from constants import ERROR_MESSAGES diff --git a/backend/apps/web/routers/prompts.py b/backend/apps/webui/routers/prompts.py similarity index 97% rename from backend/apps/web/routers/prompts.py rename to backend/apps/webui/routers/prompts.py index db7619676..47d8c7012 100644 --- a/backend/apps/web/routers/prompts.py +++ b/backend/apps/webui/routers/prompts.py @@ -6,7 +6,7 @@ from fastapi import APIRouter from pydantic import BaseModel import json -from apps.web.models.prompts import Prompts, PromptForm, PromptModel +from apps.webui.models.prompts import Prompts, PromptForm, PromptModel from utils.utils import get_current_user, get_admin_user from constants import ERROR_MESSAGES diff --git a/backend/apps/web/routers/users.py b/backend/apps/webui/routers/users.py similarity index 96% rename from backend/apps/web/routers/users.py rename to backend/apps/webui/routers/users.py index d77475d8d..bb9c557db 100644 --- a/backend/apps/web/routers/users.py +++ b/backend/apps/webui/routers/users.py @@ -9,9 +9,9 @@ import time import uuid import logging -from apps.web.models.users import UserModel, UserUpdateForm, UserRoleUpdateForm, Users -from apps.web.models.auths import Auths -from apps.web.models.chats import Chats +from apps.webui.models.users import UserModel, UserUpdateForm, UserRoleUpdateForm, Users +from apps.webui.models.auths import Auths +from apps.webui.models.chats import Chats from utils.utils import get_verified_user, get_password_hash, get_admin_user from constants import ERROR_MESSAGES diff --git a/backend/apps/web/routers/utils.py b/backend/apps/webui/routers/utils.py similarity index 98% rename from backend/apps/web/routers/utils.py rename to backend/apps/webui/routers/utils.py index 12805873d..b95fe8834 100644 --- a/backend/apps/web/routers/utils.py +++ b/backend/apps/webui/routers/utils.py @@ -8,7 +8,7 @@ from pydantic import BaseModel from fpdf import FPDF import markdown -from apps.web.internal.db import DB +from apps.webui.internal.db import DB from utils.utils import get_admin_user from utils.misc import calculate_sha256, get_gravatar_url diff --git a/backend/main.py b/backend/main.py index d9ebe922c..135676f1a 100644 --- a/backend/main.py +++ b/backend/main.py @@ -25,13 +25,13 @@ from apps.openai.main import app as openai_app, get_all_models as get_openai_mod from apps.audio.main import app as audio_app from apps.images.main import app as images_app from apps.rag.main import app as rag_app -from apps.web.main import app as webui_app +from apps.webui.main import app as webui_app import asyncio from pydantic import BaseModel from typing import List, Optional -from apps.web.models.models import Models, ModelModel +from apps.webui.models.models import Models, ModelModel from utils.utils import get_admin_user, get_verified_user from apps.rag.utils import rag_messages diff --git a/backend/utils/models.py b/backend/utils/models.py index 7a57b4fdb..c4d675d29 100644 --- a/backend/utils/models.py +++ b/backend/utils/models.py @@ -1,4 +1,4 @@ -from apps.web.models.models import Models, ModelModel, ModelForm, ModelResponse +from apps.webui.models.models import Models, ModelModel, ModelForm, ModelResponse def get_model_id_from_custom_model_id(id: str): diff --git a/backend/utils/utils.py b/backend/utils/utils.py index af4fd85c0..cc6bb06b8 100644 --- a/backend/utils/utils.py +++ b/backend/utils/utils.py @@ -1,7 +1,7 @@ from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials from fastapi import HTTPException, status, Depends -from apps.web.models.users import Users +from apps.webui.models.users import Users from pydantic import BaseModel from typing import Union, Optional