Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
7757f50
use keyring to store credentials
maxjeblick Aug 9, 2023
e4a4d52
use keyring migration
maxjeblick Aug 9, 2023
dfd5238
update pipfile
maxjeblick Aug 9, 2023
5adb0f2
switch to yaml
maxjeblick Aug 9, 2023
f5b9514
try to fix ssh keyring
maxjeblick Aug 9, 2023
419689d
Merge branch 'max/use_keyring_storage' of github.com:h2oai/h2o-llmstu…
maxjeblick Aug 9, 2023
1a6a662
switch to DBUSkeyring
maxjeblick Aug 9, 2023
03d84f2
undo switch to DBUSkeyring
maxjeblick Aug 9, 2023
55c8a88
switch to DBUSkeyring
maxjeblick Aug 9, 2023
26ba4f7
set SecretService in make wave
maxjeblick Aug 9, 2023
75377d0
pop up if secret cannot be saved
maxjeblick Aug 9, 2023
340dfce
pop up if secret cannot be saved
maxjeblick Aug 9, 2023
1b641b6
pop up if secret cannot be saved
maxjeblick Aug 9, 2023
e86c4e2
show traceback
maxjeblick Aug 9, 2023
858860a
add factory method for credentials
maxjeblick Aug 10, 2023
449934b
add factory method for credentials
maxjeblick Aug 10, 2023
8023c7a
fix keyring deletion
maxjeblick Aug 10, 2023
24db4a8
fix format
maxjeblick Aug 10, 2023
351e9c6
fix format
maxjeblick Aug 10, 2023
a0ecff5
add tests for settings
maxjeblick Aug 10, 2023
a1cdb20
refact settings
maxjeblick Aug 10, 2023
4a07912
add readme with updates
maxjeblick Aug 10, 2023
a02a1cc
remove make keyring variable
maxjeblick Aug 10, 2023
fcdcf0c
fix format
maxjeblick Aug 10, 2023
bf4c673
better wording
maxjeblick Aug 10, 2023
95ff87b
better wording
maxjeblick Aug 10, 2023
0c0a0e6
update pipfile
maxjeblick Aug 10, 2023
1630aac
fix pr number
maxjeblick Aug 10, 2023
d59f483
Update requirements.txt
maxjeblick Aug 10, 2023
cc467f5
Merge branch 'main' into max/use_keyring_storage
maxjeblick Aug 10, 2023
105c209
remove uneeded variables
maxjeblick Aug 10, 2023
29ae38f
Merge branch 'main' into max/use_keyring_storage
maxjeblick Aug 14, 2023
3056be5
Merge branch 'max/use_keyring_storage' of github.com:h2oai/h2o-llmstu…
maxjeblick Aug 14, 2023
ebef445
Merge branch 'main' into max/use_keyring_storage
maxjeblick Aug 16, 2023
8efb651
fix merge conflicts
maxjeblick Aug 16, 2023
fcda030
refact saveing of user settings
maxjeblick Aug 16, 2023
ea1340f
refact saveing of user settings
maxjeblick Aug 16, 2023
33aad0c
add button for no setting error pop up
maxjeblick Aug 16, 2023
6e8a829
Merge branch 'main' into max/use_keyring_storage
maxjeblick Aug 16, 2023
512ad37
Merge branch 'main' into max/use_keyring_storage
maxjeblick Aug 17, 2023
e081e3c
first save/load secrets
maxjeblick Aug 17, 2023
a95cb5a
more type annotations
maxjeblick Aug 17, 2023
7581249
Merge branch 'main' into max/use_keyring_storage
maxjeblick Aug 17, 2023
037aadc
Merge branch 'main' into max/use_keyring_storage
maxjeblick Aug 17, 2023
e965ffc
Merge branch 'max/use_keyring_storage' of github.com:h2oai/h2o-llmstu…
maxjeblick Aug 17, 2023
a494812
fix merge conflicts
maxjeblick Sep 12, 2023
97faf73
add keyring dependency
maxjeblick Sep 12, 2023
051d006
Update requirements.txt
maxjeblick Sep 12, 2023
76d06bb
use env file as default
maxjeblick Sep 12, 2023
58a9359
disable keyring if it is not working
maxjeblick Sep 12, 2023
f14523d
disable keyring after 3 seconds
maxjeblick Sep 12, 2023
ae91449
disable keyring after 3 seconds
maxjeblick Sep 12, 2023
35a1a98
use timeout for keyring credential saver
maxjeblick Sep 12, 2023
4ba47a6
fix timeout
maxjeblick Sep 12, 2023
02f1bf6
fix timeout
maxjeblick Sep 12, 2023
6d12cfb
fix timeout
maxjeblick Sep 12, 2023
691e033
fix format
maxjeblick Sep 12, 2023
d6dc681
update readme comment
maxjeblick Sep 12, 2023
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
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ tiktoken = "==0.4.0"
hf-transfer = "==0.1.3"
peft = "==0.5.0"
azure-storage-file-datalake = ">=12.12.0"
keyring = "==24.2.0"

[dev-packages]
black = "==23.7.0"
Expand Down
110 changes: 83 additions & 27 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Using CLI for fine-tuning LLMs:

## What's New

- [PR 364](https://github.com/h2oai/h2o-llmstudio/pull/364) User secrets are now handled more securely and flexible. Support for handling secrets using the 'keyring' library was added. User settings are tried to be migrated automatically.
- [PR 328](https://github.com/h2oai/h2o-llmstudio/pull/328) RLHF is now a separate problem type. Note that starting a new RLHF experiment from an old experiment that used RLHF is no longer supported. To continue from a previous experiment, please start a new experiment and enter the settings from the previous experiment manually.
- [PR 308](https://github.com/h2oai/h2o-llmstudio/pull/308) Sequence to sequence models have been added as a new problem type.
- [PR 152](https://github.com/h2oai/h2o-llmstudio/pull/152) Add RLHF functionality for fine-tuning LLMs.
Expand Down
1 change: 1 addition & 0 deletions llm_studio/app_utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def get_size(x):
],
"user_settings": {
"theme_dark": True,
"credential_saver": ".env File",
"default_aws_bucket_name": f"{os.getenv('AWS_BUCKET', 'bucket_name')}",
"default_aws_access_key": os.getenv("AWS_ACCESS_KEY_ID", ""),
"default_aws_secret_key": os.getenv("AWS_SECRET_ACCESS_KEY", ""),
Expand Down
15 changes: 8 additions & 7 deletions llm_studio/app_utils/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@
list_current_experiments,
)
from llm_studio.app_utils.sections.settings import settings
from llm_studio.app_utils.utils import (
add_model_type,
load_user_settings,
save_user_settings,
from llm_studio.app_utils.setting_utils import (
load_default_user_settings,
load_user_settings_and_secrets,
save_user_settings_and_secrets,
)
from llm_studio.app_utils.utils import add_model_type
from llm_studio.app_utils.wave_utils import report_error, wave_utils_handle_error

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -77,13 +78,13 @@ async def handle(q: Q) -> None:
await settings(q)
elif q.args["save_settings"]:
logger.info("Saving user settings")
save_user_settings(q)
await save_user_settings_and_secrets(q)
await settings(q)
elif q.args["load_settings"]:
load_user_settings(q)
load_user_settings_and_secrets(q)
await settings(q)
elif q.args["restore_default_settings"]:
load_user_settings(q, force_defaults=True)
load_default_user_settings(q)
await settings(q)

elif q.args["report_error"]:
Expand Down
13 changes: 6 additions & 7 deletions llm_studio/app_utils/initializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,20 @@
from bokeh.resources import Resources as BokehResources
from h2o_wave import Q

from llm_studio.app_utils.config import default_cfg
from llm_studio.app_utils.db import Database, Dataset
from llm_studio.app_utils.sections.common import interface
from llm_studio.src.utils.config_utils import load_config_py, save_config_yaml

from .config import default_cfg
from .db import Database, Dataset
from .utils import (
from llm_studio.app_utils.setting_utils import load_user_settings_and_secrets
from llm_studio.app_utils.utils import (
get_data_dir,
get_database_dir,
get_download_dir,
get_output_dir,
get_user_db_path,
get_user_name,
load_user_settings,
prepare_default_dataset,
)
from llm_studio.src.utils.config_utils import load_config_py, save_config_yaml

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -97,7 +96,7 @@ async def initialize_client(q: Q) -> None:

import_data(q)

load_user_settings(q)
load_user_settings_and_secrets(q)

await interface(q)

Expand Down
29 changes: 29 additions & 0 deletions llm_studio/app_utils/sections/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from h2o_wave import Q, ui

from llm_studio.app_utils.sections.common import clean_dashboard
from llm_studio.app_utils.setting_utils import Secrets
from llm_studio.src.loggers import Loggers


Expand All @@ -24,6 +25,34 @@ async def settings(q: Q) -> None:
'Save settings persistently' button below. To reload \
the persistently saved settings, use the 'Load settings' button.",
),
ui.separator("Credential Storage"),
ui.inline(
items=[
ui.label("Credential Handler", width=label_width),
ui.dropdown(
name="credential_saver",
value=q.client["credential_saver"],
choices=[ui.choice(name, name) for name in Secrets.names()],
trigger=False,
width="300px",
),
]
),
ui.message_bar(
type="info",
text="""Method used to save credentials (passwords) \
for 'Save settings persistently'. \
The recommended approach for saving credentials (passwords) is to \
use either Keyring or to avoid permanent storage \
(requiring re-entry upon app restart). \
Keyring will be disabled if it is not set up on the host machine. \
Only resort to local .env if your machine's \
accessibility is restricted to you.\n\
When you select 'Save settings persistently', \
credentials will be removed from all non-selected methods. \
'Restore Default Settings' will clear credentials from all methods.
""",
),
ui.separator("Appearance"),
ui.inline(
items=[
Expand Down
Loading