Keep the selected LLM profile visible while activating it.
The dropdown was bound to the previous server value, so a profile without a model snapped back to OpenRouter before the error was obvious. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
bef422a429
commit
59921fc5b5
2 files changed
+44
-13
No files matched your search
@@ -104,14 +104,19 @@ def seed_provider_settings(conn) -> None:
|
||||
|
||||
def seed_llm_profiles(conn) -> None:
|
||||
"""Named presets. Existing rows are not overwritten. Keys never stored."""
|
||||
ollama = conn.execute("SELECT id FROM llm_profiles WHERE id = ?", (OLLAMA_LAN_ID,)).fetchone()
|
||||
ollama = conn.execute("SELECT * FROM llm_profiles WHERE id = ?", (OLLAMA_LAN_ID,)).fetchone()
|
||||
if not ollama:
|
||||
conn.execute(
|
||||
"""
|
||||
INSERT INTO llm_profiles (id, title, name, url, model, zdr, no_train)
|
||||
VALUES (?, ?, ?, ?, ?, 1, 1)
|
||||
""",
|
||||
(OLLAMA_LAN_ID, "Ollama (LAN)", "ollama", OLLAMA_LAN_URL, ""),
|
||||
(OLLAMA_LAN_ID, "Ollama (LAN)", "ollama", OLLAMA_LAN_URL, "phi3:mini"),
|
||||
)
|
||||
elif not (dict(ollama).get("model") or "").strip():
|
||||
conn.execute(
|
||||
"UPDATE llm_profiles SET model = ?, updated = datetime('now') WHERE id = ?",
|
||||
("phi3:mini", OLLAMA_LAN_ID),
|
||||
)
|
||||
for role in ROLES:
|
||||
row = conn.execute("SELECT * FROM provider_settings WHERE role = ?", (role,)).fetchone()
|
||||
|
||||
Reference in new issue
Block a user