Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e072a12
This is a first example of using fastapi-auth. Test instructions are …
aliasaria Nov 13, 2025
d634d83
first auth support
aliasaria Nov 14, 2025
4481d2d
add more logging
aliasaria Nov 17, 2025
29f6567
placeholder to get a user's teams
aliasaria Nov 17, 2025
2b58276
Add fastapi-users[sqlalchemy]
mina-parham Nov 17, 2025
f29275e
Add python-jose
mina-parham Nov 17, 2025
c1572e1
Merge branch 'add/fastapi-users-addition' of https://github.com/trans…
mina-parham Nov 17, 2025
fe58699
Create team and user_team table
mina-parham Nov 17, 2025
ae487f6
Add endpoint for team create update and delete
mina-parham Nov 17, 2025
42b773b
Update get_user_teams
mina-parham Nov 17, 2025
c710521
Add default team creation and auto-assignment for new user registrations
mina-parham Nov 17, 2025
5c6bd9f
Add teams router to main API router
mina-parham Nov 17, 2025
cffeec5
Ruff
mina-parham Nov 17, 2025
ae755dc
Bug
mina-parham Nov 17, 2025
9179078
Ruff
mina-parham Nov 17, 2025
6594be6
Fix the bug in get_user_teams
mina-parham Nov 17, 2025
3a448e9
Move teams and user_teams into shared/models
mina-parham Nov 17, 2025
5ecf50e
Update authenticated_route
mina-parham Nov 17, 2025
357279b
Renaming
mina-parham Nov 17, 2025
4cf4ea5
Add role to the user_team
mina-parham Nov 17, 2025
b30e6be
Add Added require_team_owner()
mina-parham Nov 17, 2025
f8c27a7
Add new member management, invite, list all memebers, remove members
mina-parham Nov 17, 2025
cee92d2
Ruff
mina-parham Nov 17, 2025
6512e0b
Add test for team endpoints
mina-parham Nov 17, 2025
aa12552
Merge branch 'main' into add/fastapi-users-addition
mina-parham Nov 17, 2025
c47ac3b
Remove foreign key
mina-parham Nov 18, 2025
51690dd
add create user script
aliasaria Nov 18, 2025
249f0f2
create user script
aliasaria Nov 18, 2025
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
8 changes: 8 additions & 0 deletions api.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
batched_prompts,
recipes,
remote,
auth2,
teams,
)
import torch

Expand Down Expand Up @@ -82,6 +84,9 @@

from dotenv import load_dotenv


from transformerlab.shared.models.user_model import create_db_and_tables

load_dotenv()

# The following environment variable can be used by other scripts
Expand Down Expand Up @@ -110,6 +115,7 @@ async def lifespan(app: FastAPI):
galleries.update_gallery_cache()
spawn_fastchat_controller_subprocess()
await db.init()
await create_db_and_tables()
print("✅ SEED DATA")
# Initialize experiments and cancel any running jobs
seed_default_experiments()
Expand Down Expand Up @@ -230,6 +236,8 @@ async def validation_exception_handler(request, exc):
app.include_router(batched_prompts.router)
app.include_router(remote.router)
app.include_router(fastchat_openai_api.router)
app.include_router(teams.router)
app.include_router(auth2.router)

# Authentication and session management routes
if os.getenv("TFL_MULTITENANT") == "true":
Expand Down
43 changes: 41 additions & 2 deletions requirements-no-gpu-uv.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file was autogenerated by uv via the following command:
# uv pip compile requirements.in -o requirements-no-gpu-uv.txt --index-strategy unsafe-best-match
# uv pip compile requirements.in -o requirements-no-gpu-uv.txt
absl-py==2.1.0
# via tensorboard
accelerate==1.3.0
Expand Down Expand Up @@ -27,6 +27,10 @@ anyio==4.8.0
# sse-starlette
# starlette
# watchfiles
argon2-cffi==23.1.0
# via pwdlib
argon2-cffi-bindings==25.1.0
# via argon2-cffi
attrs==25.1.0
# via aiohttp
audioread==3.0.1
Expand All @@ -39,6 +43,8 @@ azure-core==1.33.0
# azure-identity
azure-identity==1.21.0
# via markitdown
bcrypt==4.3.0
# via pwdlib
beautifulsoup4==4.13.3
# via
# markdownify
Expand All @@ -51,6 +57,7 @@ certifi==2022.12.7
# sentry-sdk
cffi==1.17.1
# via
# argon2-cffi-bindings
# cryptography
# soundfile
charset-normalizer==2.1.1
Expand All @@ -77,6 +84,7 @@ cryptography==44.0.2
# msal
# pdfminer-six
# pyjwt
# python-jose
# workos
datasets==3.6.0
# via
Expand All @@ -93,20 +101,33 @@ dill==0.3.8
# datasets
# evaluate
# multiprocess
dnspython==2.8.0
# via email-validator
docker-pycreds==0.4.0
# via wandb
ecdsa==0.19.1
# via python-jose
einops==0.8.0
# via
# -r requirements.in
# controlnet-aux
email-validator==2.3.0
# via fastapi-users
et-xmlfile==2.0.0
# via openpyxl
evaluate==0.4.3
# via -r requirements.in
fastapi==0.115.7
# via
# -r requirements.in
# fastapi-users
# transformerlab-inference
fastapi-users==15.0.1
# via
# -r requirements.in
# fastapi-users-db-sqlalchemy
fastapi-users-db-sqlalchemy==7.0.0
# via fastapi-users
filelock==3.13.1
# via
# controlnet-aux
Expand Down Expand Up @@ -169,6 +190,7 @@ humanfriendly==10.0
idna==3.4
# via
# anyio
# email-validator
# httpx
# requests
# yarl
Expand Down Expand Up @@ -205,6 +227,8 @@ macmon-python==0.1.2
# via -r requirements.in
magika==0.6.1
# via markitdown
makefun==1.16.0
# via fastapi-users
mammoth==1.9.0
# via markitdown
markdown==3.7
Expand Down Expand Up @@ -352,8 +376,14 @@ psutil==6.1.1
# peft
# transformerlab-inference
# wandb
pwdlib==0.2.1
# via fastapi-users
pyarrow==19.0.0
# via datasets
pyasn1==0.6.1
# via
# python-jose
# rsa
pycparser==2.22
# via cffi
pydantic==2.11.7
Expand Down Expand Up @@ -381,6 +411,7 @@ pygments==2.19.1
# rich
pyjwt==2.10.1
# via
# fastapi-users
# msal
# workos
pytest==8.4.2
Expand All @@ -393,9 +424,12 @@ python-dotenv==1.0.1
# magika
# mcp
# pydantic-settings
python-jose==3.5.0
# via -r requirements.in
python-multipart==0.0.20
# via
# -r requirements.in
# fastapi-users
# mcp
python-pptx==1.0.2
# via markitdown
Expand Down Expand Up @@ -436,6 +470,8 @@ rich==13.9.4
# via
# transformerlab-inference
# typer
rsa==4.9.1
# via python-jose
safetensors==0.5.3
# via
# accelerate
Expand Down Expand Up @@ -477,6 +513,7 @@ six==1.17.0
# via
# azure-core
# docker-pycreds
# ecdsa
# markdownify
# python-dateutil
# tensorboard
Expand All @@ -496,7 +533,9 @@ soxr==0.5.0.post1
speechrecognition==3.14.2
# via markitdown
sqlalchemy==2.0.38
# via -r requirements.in
# via
# -r requirements.in
# fastapi-users-db-sqlalchemy
sse-starlette==2.3.5
# via mcp
starlette==0.45.3
Expand Down
43 changes: 41 additions & 2 deletions requirements-rocm-uv.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file was autogenerated by uv via the following command:
# uv pip compile requirements-rocm.in -o requirements-rocm-uv.txt --index-strategy unsafe-best-match
# uv pip compile requirements-rocm.in -o requirements-rocm-uv.txt --index-strategy unsafe-best-match --python-platform linux
absl-py==2.2.2
# via tensorboard
accelerate==1.6.0
Expand Down Expand Up @@ -27,6 +27,10 @@ anyio==4.9.0
# sse-starlette
# starlette
# watchfiles
argon2-cffi==23.1.0
# via pwdlib
argon2-cffi-bindings==25.1.0
# via argon2-cffi
attrs==25.3.0
# via aiohttp
audioread==3.0.1
Expand All @@ -39,6 +43,8 @@ azure-core==1.33.0
# azure-identity
azure-identity==1.21.0
# via markitdown
bcrypt==4.3.0
# via pwdlib
beautifulsoup4==4.13.4
# via
# markdownify
Expand All @@ -51,6 +57,7 @@ certifi==2022.12.7
# sentry-sdk
cffi==1.17.1
# via
# argon2-cffi-bindings
# cryptography
# soundfile
charset-normalizer==2.1.1
Expand All @@ -77,6 +84,7 @@ cryptography==44.0.2
# msal
# pdfminer-six
# pyjwt
# python-jose
# workos
datasets==3.6.0
# via
Expand All @@ -93,20 +101,33 @@ dill==0.3.8
# datasets
# evaluate
# multiprocess
dnspython==2.8.0
# via email-validator
docker-pycreds==0.4.0
# via wandb
ecdsa==0.19.1
# via python-jose
einops==0.8.1
# via
# -r requirements-rocm.in
# controlnet-aux
email-validator==2.3.0
# via fastapi-users
et-xmlfile==2.0.0
# via openpyxl
evaluate==0.4.3
# via -r requirements-rocm.in
fastapi==0.115.12
# via
# -r requirements-rocm.in
# fastapi-users
# transformerlab-inference
fastapi-users==15.0.1
# via
# -r requirements-rocm.in
# fastapi-users-db-sqlalchemy
fastapi-users-db-sqlalchemy==7.0.0
# via fastapi-users
filelock==3.13.1
# via
# controlnet-aux
Expand Down Expand Up @@ -169,6 +190,7 @@ humanfriendly==10.0
idna==3.4
# via
# anyio
# email-validator
# httpx
# requests
# yarl
Expand Down Expand Up @@ -205,6 +227,8 @@ macmon-python==0.1.2
# via -r requirements-rocm.in
magika==0.6.1
# via markitdown
makefun==1.16.0
# via fastapi-users
mammoth==1.9.0
# via markitdown
markdown==3.8
Expand Down Expand Up @@ -350,8 +374,14 @@ psutil==7.0.0
# peft
# transformerlab-inference
# wandb
pwdlib==0.2.1
# via fastapi-users
pyarrow==20.0.0
# via datasets
pyasn1==0.6.1
# via
# python-jose
# rsa
pycparser==2.22
# via cffi
pydantic==2.11.7
Expand Down Expand Up @@ -379,6 +409,7 @@ pygments==2.19.1
# rich
pyjwt==2.10.1
# via
# fastapi-users
# msal
# workos
pyrsmi==0.2.0
Expand All @@ -393,9 +424,12 @@ python-dotenv==1.1.0
# magika
# mcp
# pydantic-settings
python-jose==3.5.0
# via -r requirements-rocm.in
python-multipart==0.0.20
# via
# -r requirements-rocm.in
# fastapi-users
# mcp
python-pptx==1.0.2
# via markitdown
Expand Down Expand Up @@ -438,6 +472,8 @@ rich==14.0.0
# via
# transformerlab-inference
# typer
rsa==4.9.1
# via python-jose
safetensors==0.5.3
# via
# accelerate
Expand Down Expand Up @@ -480,6 +516,7 @@ six==1.17.0
# via
# azure-core
# docker-pycreds
# ecdsa
# markdownify
# python-dateutil
# tensorboard
Expand All @@ -499,7 +536,9 @@ soxr==0.5.0.post1
speechrecognition==3.14.2
# via markitdown
sqlalchemy==2.0.40
# via -r requirements-rocm.in
# via
# -r requirements-rocm.in
# fastapi-users-db-sqlalchemy
sse-starlette==2.3.5
# via mcp
starlette==0.46.2
Expand Down
2 changes: 2 additions & 0 deletions requirements-rocm.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ datasets==3.6.0
einops
evaluate
fastapi
fastapi-users[sqlalchemy]
packaging
psutil
python-multipart
python-dotenv
python-jose[cryptography]
pydantic>= 2.0
nltk==3.9.1
scipy
Expand Down
Loading
Loading