diff --git a/python/voice_to_notes/ipc/handlers.py b/python/voice_to_notes/ipc/handlers.py index 2e64f85..e78f3c6 100644 --- a/python/voice_to_notes/ipc/handlers.py +++ b/python/voice_to_notes/ipc/handlers.py @@ -254,15 +254,15 @@ def make_ai_chat_handler() -> HandlerFunc: ) if action == "configure": - # Re-create a provider with custom settings + # Re-create a provider with custom settings and set it active provider_name = payload.get("provider", "") config = payload.get("config", {}) if provider_name == "local": from voice_to_notes.providers.local_provider import LocalProvider service.register_provider("local", LocalProvider( - base_url=config.get("base_url", "http://localhost:8080"), - model=config.get("model", "local"), + base_url=config.get("base_url", "http://localhost:11434/v1"), + model=config.get("model", "llama3.2"), )) elif provider_name == "openai": from voice_to_notes.providers.openai_provider import OpenAIProvider @@ -286,6 +286,10 @@ def make_ai_chat_handler() -> HandlerFunc: api_key=config.get("api_key"), api_base=config.get("api_base"), )) + # Set the configured provider as active + print(f"[sidecar] Configured AI provider: {provider_name} with config: {config}", file=sys.stderr, flush=True) + if provider_name in ("local", "openai", "anthropic", "litellm"): + service.set_active(provider_name) return IPCMessage( id=msg.id, type="ai.configured",