Commit 1c0f7090 authored by Your Name's avatar Your Name

Fix OAuth2 provider model auto-population

- Remove automatic model detection during provider save operations
- OAuth2 providers now only show models when 'Get Models from Provider' is clicked
- Users have full control over when models are fetched and saved
- Bump version to 0.99.6
parent 483edf5b
...@@ -1720,23 +1720,6 @@ async def dashboard_providers_save(request: Request, config: str = Form(...)): ...@@ -1720,23 +1720,6 @@ async def dashboard_providers_save(request: Request, config: str = Form(...)):
if 'condense_context' not in model or model.get('condense_context') is None: if 'condense_context' not in model or model.get('condense_context') is None:
model['condense_context'] = 80 model['condense_context'] = 80
# Auto-detect models for providers with no models configured
auto_detected_count = 0
for provider_key, provider in providers_data.items():
# Check if provider has no models or empty models list
has_models = 'models' in provider and isinstance(provider.get('models'), list) and len(provider.get('models', [])) > 0
if not has_models:
# Try to auto-detect models from API
detected_models = await _auto_detect_provider_models(provider_key, provider)
if detected_models:
provider['models'] = detected_models
auto_detected_count += 1
logger.info(f"Auto-detected {len(detected_models)} models for provider '{provider_key}'")
if auto_detected_count > 0:
logger.info(f"Auto-detected models for {auto_detected_count} provider(s)")
if is_config_admin: if is_config_admin:
# Config admin: save to JSON files # Config admin: save to JSON files
config_path = Path.home() / '.aisbf' / 'providers.json' config_path = Path.home() / '.aisbf' / 'providers.json'
...@@ -1767,8 +1750,6 @@ async def dashboard_providers_save(request: Request, config: str = Form(...)): ...@@ -1767,8 +1750,6 @@ async def dashboard_providers_save(request: Request, config: str = Form(...)):
logger.info(f"Saved {len(providers_data)} provider(s) to database for user {current_user_id}") logger.info(f"Saved {len(providers_data)} provider(s) to database for user {current_user_id}")
success_msg = "Configuration saved successfully! Restart server for changes to take effect." success_msg = "Configuration saved successfully! Restart server for changes to take effect."
if auto_detected_count > 0:
success_msg = f"Configuration saved successfully! Auto-detected models for {auto_detected_count} provider(s). Restart server for changes to take effect."
return templates.TemplateResponse( return templates.TemplateResponse(
request=request, request=request,
......
...@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" ...@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project] [project]
name = "aisbf" name = "aisbf"
version = "0.99.5" version = "0.99.6"
description = "AISBF - AI Service Broker Framework || AI Should Be Free - A modular proxy server for managing multiple AI provider integrations" description = "AISBF - AI Service Broker Framework || AI Should Be Free - A modular proxy server for managing multiple AI provider integrations"
readme = "README.md" readme = "README.md"
license = "GPL-3.0-or-later" license = "GPL-3.0-or-later"
......
...@@ -49,7 +49,7 @@ class InstallCommand(_install): ...@@ -49,7 +49,7 @@ class InstallCommand(_install):
setup( setup(
name="aisbf", name="aisbf",
version="0.99.5", version="0.99.6",
author="AISBF Contributors", author="AISBF Contributors",
author_email="stefy@nexlab.net", author_email="stefy@nexlab.net",
description="AISBF - AI Service Broker Framework || AI Should Be Free - A modular proxy server for managing multiple AI provider integrations", description="AISBF - AI Service Broker Framework || AI Should Be Free - A modular proxy server for managing multiple AI provider integrations",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment