-
-
Notifications
You must be signed in to change notification settings - Fork 498
Make config multiuser #999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
deep1401
commented
Dec 4, 2025
- Allows setting a config per-user per-team or per-team
- Verified downloading and training models across different teams (one with set tokens and one without)
…lab/transformerlab-app into fix/config-multiuser
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
…lab/transformerlab-app into fix/config-multiuser
api/transformerlab/db/db.py
Outdated
| stmt = insert(Config).values(key=key, value=value) | ||
| stmt = stmt.on_conflict_do_update(index_elements=["key"], set_={"value": value}) | ||
| async def config_set( | ||
| key: str, value: str, user_id: str | None = None, team_id: str | None = None, team_wide: bool = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the team_wide bool as a parameter? Isn't team_wide implicit if user_id is null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed now. It was essentially for global configs but we're saying those dont exist right now so I removed this
dadmobile
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't dig into it but I got an error running the migration (only included relevant lines):
INFO [alembic.runtime.migration] Running upgrade 1f7cb465d15a -> c78d76a6d65c, add_team_id_to_config_table
...
File "/Users/tony/.transformerlab/envs/transformerlab/lib/python3.11/site-packages/sqlalchemy/sql/compiler.py", line 7262, in visit_null
raise exc.CompileError(
sqlalchemy.exc.CompileError: Can't generate DDL for NullType(); did you forget to specify a type on this Column?
The above exception was the direct cause of the following exception:
...
File "/Users/tony/workspace/transformerlab-app/api/alembic/versions/c78d76a6d65c_add_team_id_to_config_table.py", line 45, in upgrade
with op.batch_alter_table("config", schema=None) as batch_op:
...
raise exc.CompileError(
sqlalchemy.exc.CompileError: (in table '_alembic_tmp_config', column 'key'): Can't generate DDL for NullType(); did you forget to specify a type on this Column?
Migration output: Using default home directory: /Users/tony/.transformerlab
…lab/transformerlab-app into fix/config-multiuser
I cant reproduce but the error seems to come from doing alter_table in a batch op. I tried to fix, could you try again once? |
This is fixed! |
dadmobile
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like weights and biases key always saves as a team-wide key. I think you are already looking into this.
deep1401
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like weights and biases key always saves as a team-wide key. I think you are already looking into this.
Fixed now it was there for everything
OK this works! A funny thing is it gives you the option to set user or team even when you are in single user mode. But let's not worry about that right now and maybe fix in a followup or something. |