The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.
TypeScript agentai-chatai-studioall-in-onecoding-agentdesktop-appfluximage-generationlinuxllmlocal-ailocal-llmopen-sourceprivacyself-hostedstable-diffusionuncensoreduncensored-aivideo-generationwindows
fix(neuron): chat models only, readable tool failures, chat's own persona
purple6cc4c2c66866
diff --git a/src-tauri/src/commands/neuron/mod.rs b/src-tauri/src/commands/neuron/mod.rsindex 9553205a..b928307c 100644--- a/src-tauri/src/commands/neuron/mod.rs+++ b/src-tauri/src/commands/neuron/mod.rs@@ -389,6 +389,22 @@ pub fn parse_progress(line: &str) -> Option<(u64, u64)> {Some((a.trim().parse().ok()?, b.trim().parse().ok()?))}+/// One readable sentence for a generator that ended without a direction. Its+/// own output (a backtrace on an abort) goes to the log, not on the page;+/// only a missing library is named, since that is what the user can act on.+pub fn tool_failure(stderr: &str) -> String {+ let missing = stderr.lines().map(str::trim).find(|l| {+ let low = l.to_lowercase();+ let names_lib = low.contains(".dll") || low.contains(".dylib");+ let says_missing = ["not found", "not loaded", "missing", "cannot", "could not", "no such"].iter().any(|w| low.contains(w));+ names_lib && says_missing && l.len() < 200+ });+ match missing {+ Some(line) => format!("The vector tool could not start: a library is missing ({line})."),+ None => "The vector tool stopped on this model without a result. Its last output is in the app log (target neuron).".into(),+ }+}+/// Runs the generator on the example pairs and returns the direction.fn generate(app: &tauri::AppHandle, model_path: &str, plus: &[String], minus: &[String], work: &Path) -> Result<cvec::ControlVector, String> {let binary = generator_binary(app).ok_or("This build of LU has no vector tool (lu-llama-cvector-generator). On Linux it comes in a later version.")?;@@ -438,8 +454,11 @@ fn generate(app: &tauri::AppHandle, model_path: &str, plus: &[String], minus: &[tracing::info!(target: "neuron", pid = id, ?status, "vector tool finished");if !status.success() || !out.is_file() {let why = stderr.map(|(buf, _)| crate::commands::shell::captured_text(&buf)).unwrap_or_default();- let tail: Vec<&str> = why.lines().rev().take(6).collect::<Vec<_>>().into_iter().rev().collect();- return Err(format!("The vector tool stopped without a result.\n{}", tail.join("\n")));+ let tail: Vec<&str> = why.lines().rev().take(12).collect::<Vec<_>>().into_iter().rev().collect();+ for line in &tail {+ log(format!(" {line}"));+ }+ return Err(tool_failure(&why));}with_job(|j| j.step = j.total);let cv = cvec::read(&out)?;@@ -900,6 +919,18 @@ pub async fn neuron_compare(#[cfg(test)]mod tests {+ /// T1 (3.0.9): an abort put the raw backtrace on the page.+ #[test]+ fn a_tool_failure_reads_as_one_sentence() {+ let abort = "ggml/src/ggml.c:1234: GGML_ASSERT(x) failed\nSee: https://github.com/ggml-org/llama.cpp/pull/17869\n0 lu-llama-cvector-generator 0x0000000100b14358 ggml_print_backtrace + 276\n1 libggml-base.dylib 0x0000000100c01234 ggml_abort + 160";+ let msg = super::tool_failure(abort);+ assert!(!msg.contains("0x") && !msg.contains("github") && msg.contains("app log"), "{msg}");+ let dll = super::tool_failure("error while loading: llama-common.dll was not found");+ assert!(dll.contains("llama-common.dll"), "{dll}");+ let dylib = super::tool_failure("dyld: Library not loaded: @rpath/libllama.dylib");+ assert!(dylib.contains("libllama.dylib"), "{dylib}");+ }+use super::*;#[test]diff --git a/src-tauri/src/commands/neuron/model.rs b/src-tauri/src/commands/neuron/model.rsindex 58fd14c9..7590d314 100644--- a/src-tauri/src/commands/neuron/model.rs+++ b/src-tauri/src/commands/neuron/model.rs@@ -77,9 +77,18 @@ pub struct ModelFacts {pub name: String,}+/// Embedding and diffusion models (the architectures llama.cpp gives no+/// cache) have no chat turn to steer, and the vector tool aborts on them.+pub fn is_chat_arch(arch: &str) -> bool {+ !crate::commands::vram_plan::NO_CACHE_ARCHS.contains(&arch)+}+pub fn facts(path: &str) -> Result<ModelFacts, String> {let head = read_model_head(path).ok_or("LU cannot read this file as a GGUF model.")?;let arch = head.arch().ok_or("The model file names no architecture.")?.to_string();+ if !is_chat_arch(&arch) {+ return Err(format!("This is not a chat model ({arch}: embeddings or diffusion). The Neuron tweaker works on chat models."));+ }let n_layer = head.arch_int("block_count").filter(|n| *n > 1).ok_or("The model file names no layer count.")? as usize;let n_embd = head.arch_int("embedding_length").filter(|n| *n > 0).ok_or("The model file names no width.")? as usize;let template_text = match head.keys.get("tokenizer.chat_template") {@@ -235,4 +244,35 @@ mod tests {assert_eq!(string_array(&p, "tokenizer.ggml.tokens").unwrap(), vec!["<pad>".to_string(), "\u{2581}love".to_string()]);assert!(string_array(&p, "nope").is_err());}++ fn head_file(dir: &Path, arch: &str) -> std::path::PathBuf {+ let mut b = Vec::new();+ b.extend_from_slice(b"GGUF");+ b.extend_from_slice(&3u32.to_le_bytes());+ b.extend_from_slice(&0u64.to_le_bytes());+ b.extend_from_slice(&3u64.to_le_bytes());+ put_str(&mut b, "general.architecture");+ b.extend_from_slice(&8u32.to_le_bytes());+ put_str(&mut b, arch);+ for (key, v) in [("block_count", 12u32), ("embedding_length", 768)] {+ put_str(&mut b, &format!("{arch}.{key}"));+ b.extend_from_slice(&4u32.to_le_bytes());+ b.extend_from_slice(&v.to_le_bytes());+ }+ let p = dir.join(format!("{arch}.gguf"));+ std::fs::write(&p, &b).unwrap();+ p+ }++ /// T1 (3.0.9): an embedding model in the models folder was offered and+ /// the vector tool aborted on it.+ #[test]+ fn an_embedding_model_is_refused_in_words() {+ let dir = tempfile::tempdir().unwrap();+ let err = facts(head_file(dir.path(), "nomic-bert").to_str().unwrap()).unwrap_err();+ assert!(err.contains("not a chat model"), "{err}");+ let ok = facts(head_file(dir.path(), "qwen2").to_str().unwrap()).unwrap();+ assert_eq!((ok.n_layer, ok.n_embd), (12, 768));+ assert!(!is_chat_arch("bert") && !is_chat_arch("gemma-embedding") && is_chat_arch("gemma3"));+ }}diff --git a/src-tauri/src/commands/vram_plan.rs b/src-tauri/src/commands/vram_plan.rsindex 7675c583..0b78c83e 100644--- a/src-tauri/src/commands/vram_plan.rs+++ b/src-tauri/src/commands/vram_plan.rs@@ -143,7 +143,7 @@ pub(crate) struct ModelShape {/// Architectures llama.cpp creates no memory for (llama-model.cpp,/// `create_memory`).-const NO_CACHE_ARCHS: &[&str] = &[+pub(crate) const NO_CACHE_ARCHS: &[&str] = &["bert", "jina-bert-v2", "jina-bert-v3", "nomic-bert", "nomic-bert-moe", "neo-bert", "eurobert","wavtokenizer-dec", "modern-bert", "gemma-embedding", "dream", "llada", "llada-moe", "rnd1",];diff --git a/src/components/neuron/NeuronView.tsx b/src/components/neuron/NeuronView.tsxindex a1c64b91..ad72d258 100644--- a/src/components/neuron/NeuronView.tsx+++ b/src/components/neuron/NeuronView.tsx@@ -4,7 +4,7 @@ import { Hinweis } from '../ui/Hinweis'import { HINWEIS_TEXT } from '../../lib/hinweis'import { ICON_SM } from '../ui/icon-size'import { openExternal } from '../../api/backend'-import { listBundledModels, bundledEngineStatus, type BundledModel } from '../../api/engine'+import { listBundledModels, bundledEngineStatus, isEmbeddingGgufName, type BundledModel } from '../../api/engine'import {neuronApply, neuronBuildOwn, neuronBuildPreset, neuronCancel, neuronCompare, neuronDelete, neuronDismiss,neuronFeatureAdd, neuronInfo, neuronPresets, neuronSaeDownload, neuronSaeSearch, neuronStatus,@@ -16,15 +16,18 @@ import { preservedSwapCtx } from '../../lib/builtin-ctx'import { builtinModelMatches } from '../../lib/builtin-model-identity'import {backendNote, effectiveStrengths, entriesFor, hasPersonaProfile, jobProgressText, jobShare, sameEntries,- strengthWarning, warningText, type BackendKind,+ steeringPersona, strengthWarning, warningText, type BackendKind,} from '../../lib/neuron'import { editingKey, useNeuronStore } from '../../stores/neuronStore'import { useModelStore } from '../../stores/modelStore'+import { useChatStore } from '../../stores/chatStore'import { useSettingsStore } from '../../stores/settingsStore'import type { BuiltinEngineTuning } from '../../types/settings'const APPLY_DELAY_MS = 700+const NO_CHAT_MODEL = 'There is no chat model for LU Engine yet. Download one to start. An embedding model (the one Document Chat uses) cannot be tweaked.'+/** Which program answers the chat's model right now. */function chatBackend(activeModel: string | null, appMode: string | undefined): BackendKind {if (appMode === 'cloud') return 'cloud'@@ -57,12 +60,17 @@ async function restartTuning(model: BundledModel | undefined): Promise<BuiltinEnexport function NeuronView() {const activeModel = useModelStore((s) => s.activeModel)const appMode = useSettingsStore((s) => s.settings.appMode)- const personaId = useSettingsStore((s) => s.activePersonaId)+ const activePersonaId = useSettingsStore((s) => s.activePersonaId)const personas = useSettingsStore((s) => s.personas)+ const personasOn = useSettingsStore((s) => s.settings.personasEnabled !== false)+ const conv = useChatStore((s) => s.conversations.find((c) => c.id === s.activeConversationId))+ const steering = steeringPersona(conv, personas, activePersonaId, personasOn)+ const personaId = steering.id ?? undefinedconst persona = personas.find((p) => p.id === personaId)const { profiles, scopeByModel, setStrength, setProfile, removeProfile, removeSlider, setScope } = useNeuronStore()const [models, setModels] = useState<BundledModel[]>([])+ const [modelsLoaded, setModelsLoaded] = useState(false)const [modelPath, setModelPath] = useState<string>('')const [info, setInfo] = useState<NeuronInfo | null>(null)const [presets, setPresets] = useState<NeuronPreset[]>([])@@ -77,12 +85,15 @@ export function NeuronView() {// Models and presets once; the loaded model (or the chat's) preselected.useEffect(() => {void neuronPresets().then(setPresets).catch(() => setPresets([]))- void listBundledModels().then((list) => {+ void listBundledModels().then((all) => {+ // Chat models only: an embedding model (Document Chat's) has no chat+ // turn to steer, and the vector tool aborts on it.+ const list = all.filter((m) => !isEmbeddingGgufName(m.name))setModels(list)const loaded = list.find((m) => m.loaded)const chat = list.find((m) => activeModel && builtinModelMatches(m.path, activeModel) && activeModel.includes(m.name))setModelPath((cur) => cur || (chat ?? loaded ?? list[0])?.path || '')- }).catch(() => setModels([]))+ }).catch(() => setModels([])).finally(() => setModelsLoaded(true))// eslint-disable-next-line react-hooks/exhaustive-deps}, [])@@ -171,10 +182,11 @@ export function NeuronView() {else setProfile(editKey, {})}- if (backend !== 'lu-engine' && backend !== 'none' && models.length === 0) {+ if (modelsLoaded && models.length === 0) {return (<Shell>- <Hinweis>{backendNote(backend)}</Hinweis>+ {backend !== 'lu-engine' && backend !== 'none' && <Hinweis className="mb-3">{backendNote(backend)}</Hinweis>}+ <Hinweis><span data-testid="neuron-no-chat-model">{NO_CHAT_MODEL}</span></Hinweis></Shell>)}@@ -214,6 +226,10 @@ export function NeuronView() {</div>)}+ {steering.group && (+ <Hinweis className="mb-3"><span data-testid="neuron-group-note">This chat is a group chat: the model's sliders apply to every speaker. Sliders saved for one persona apply in its own chats (per speaker: later version).</span></Hinweis>+ )}+{job && job.status !== 'idle' && <JobPanel job={job} onStop={() => void neuronCancel().then(poll)} onDismiss={() => void neuronDismiss().then(poll)} />}<Section title="Sliders">diff --git a/src/components/neuron/__tests__/neuron-view-steers-the-engine.test.tsx b/src/components/neuron/__tests__/neuron-view-steers-the-engine.test.tsxindex bb3800ab..8bffede2 100644--- a/src/components/neuron/__tests__/neuron-view-steers-the-engine.test.tsx+++ b/src/components/neuron/__tests__/neuron-view-steers-the-engine.test.tsx@@ -5,7 +5,8 @@* model offers to compute it (locked, with no false notice, until the model's* info is in); a computed one, moved, reaches the engine as* one entry; Reset brings the engine back to no vector at all; a chat model- * in Ollama is told plainly that the sliders cannot reach it.+ * in Ollama is told plainly that the sliders cannot reach it; an embedding+ * model is never offered.** Run: npx vitest run src/components/neuron/__tests__/neuron-view-steers-the-engine.test.tsx*/@@ -38,10 +39,14 @@ vi.mock('../../../api/neuron', () => ({neuronFeatureAdd: vi.fn(), neuronSaeDownload: vi.fn(), neuronSaeSearch: vi.fn(),}))vi.mock('../../../api/engine', () => ({- listBundledModels: async () => [{ name: 'qwen2.5-0.5b-instruct-q8_0', path: '/models/qwen.gguf', size: 1, loaded: true }],+ listBundledModels: async () => [...disk.models],+ isEmbeddingGgufName: (name: string) => /embed/.test(name.toLowerCase()),bundledEngineStatus: async () => ({ running: true, healthy: true, port: 8127, model_path: '/models/qwen.gguf', ctx: 8192 }),}))vi.mock('../../../api/backend', () => ({ openExternal: vi.fn(), backendCall: vi.fn() }))+const QWEN = { name: 'qwen2.5-0.5b-instruct-q8_0', path: '/models/qwen.gguf', size: 1, loaded: true }+const NOMIC = { name: 'nomic-embed-text-v1.5.Q4_K_M', path: '/models/nomic.gguf', size: 1, loaded: false }+const disk = vi.hoisted(() => ({ models: [] as Array<Record<string, unknown>> }))const slot = vi.hoisted(() => ({ managed: true }))vi.mock('../../../api/builtin-ensure', () => ({ isManagedBuiltinSlot: () => slot.managed }))@@ -54,6 +59,7 @@ beforeEach(() => {buildPreset.mockClear()vectors.length = 0slot.managed = true+ disk.models = [NOMIC, QWEN]useNeuronStore.setState({ profiles: {}, scopeByModel: {} })useModelStore.setState({ activeModel: 'openai::qwen2.5-0.5b-instruct-q8_0' })})@@ -85,6 +91,24 @@ describe('Neuron tweaker view', () => {await waitFor(() => expect(apply.mock.calls.at(-1)?.[1]).toEqual([]), { timeout: 3000 })})+ // T1 (3.0.9): the embedding model of Document Chat was the only choice,+ // and the vector tool aborted on it.+ it('offers chat models only, under a labelled picker', async () => {+ render(createElement(NeuronView))+ const picker = (await screen.findByLabelText('Model')) as HTMLSelectElement+ await waitFor(() => expect(picker.options.length).toBe(1))+ expect(picker.options[0].value).toBe('/models/qwen.gguf')+ })++ it('says so when only an embedding model is there', async () => {+ disk.models = [NOMIC]+ useModelStore.setState({ activeModel: 'ollama::llama3:8b' })+ render(createElement(NeuronView))+ expect((await screen.findByTestId('neuron-no-chat-model')).textContent).toMatch(/no chat model/)+ expect(screen.getByText(/Ollama takes no control vectors/)).toBeTruthy()+ expect(screen.queryByTestId('neuron-model')).toBeNull()+ })+it('says plainly when the chat model runs in Ollama', async () => {useModelStore.setState({ activeModel: 'ollama::llama3:8b' })render(createElement(NeuronView))diff --git a/src/hooks/__tests__/neuron-follows-persona.test.ts b/src/hooks/__tests__/neuron-follows-persona.test.tsindex 83785fa9..1eb2043a 100644--- a/src/hooks/__tests__/neuron-follows-persona.test.ts+++ b/src/hooks/__tests__/neuron-follows-persona.test.ts@@ -1,7 +1,11 @@/**+ * @vitest-environment jsdom+ ** P11 (3.0.9): a persona with its own Neuron tweaker sliders brings them to* the engine when it becomes active; a switch between two personas without- * their own sliders restarts nothing.+ * their own sliders restarts nothing. The persona that counts is the one the+ * open chat speaks as (T1: a chat's own persona was ignored); a group chat+ * runs on the model's sliders.** Run: npx vitest run src/hooks/__tests__/neuron-follows-persona.test.ts*/@@ -16,8 +20,16 @@ vi.mock('../../api/neuron', () => ({neuronApply: (p: string, e: unknown[], t?: unknown) => apply(p, e, t),}))-import { followPersona } from '../useNeuronFollowsPersona'+import { followPersona, useNeuronFollowsPersona } from '../useNeuronFollowsPersona'+import { steeringPersona } from '../../lib/neuron'import { useNeuronStore } from '../../stores/neuronStore'+import { useChatStore } from '../../stores/chatStore'+import { useSettingsStore } from '../../stores/settingsStore'+import { renderHook } from '@testing-library/react'+import type { Persona } from '../../types/settings'++const PIRATE = { id: 'pirate', name: 'Pirate', systemPrompt: 'Arr.' } as Persona+const CODER = { id: 'coder', name: 'Coder', systemPrompt: 'Code.' } as PersonabeforeEach(() => {apply.mockClear()@@ -44,3 +56,36 @@ describe('Neuron sliders follow the persona', () => {expect(apply).not.toHaveBeenCalled()})})++describe('which persona steers', () => {+ it('is the open chat\'s own persona, not the app wide pick', () => {+ const conv = { personaId: 'pirate', personaEnabled: true }+ expect(steeringPersona(conv, [PIRATE, CODER], 'coder', true)).toEqual({ id: 'pirate', group: false })+ })++ it('is none while the persona is off for the chat or in Settings', () => {+ expect(steeringPersona({ personaId: 'pirate', personaEnabled: false }, [PIRATE], 'pirate', true).id).toBeNull()+ expect(steeringPersona({ personaId: 'pirate', personaEnabled: true }, [PIRATE], 'pirate', false).id).toBeNull()+ })++ it('is the app wide pick with no chat open, and none in a group chat', () => {+ expect(steeringPersona(undefined, [PIRATE], 'pirate', true)).toEqual({ id: 'pirate', group: false })+ expect(steeringPersona({ personaId: 'pirate', personaEnabled: true, groupModels: ['a', 'b'] }, [PIRATE], 'pirate', true)).toEqual({ id: null, group: true })+ })++ it('restarts the engine when the user opens a chat that speaks as a persona with own sliders', async () => {+ useSettingsStore.setState((s) => ({ personas: [PIRATE, CODER], activePersonaId: 'coder', settings: { ...s.settings, personasEnabled: true } }))+ useChatStore.setState({+ conversations: [+ { id: 'a', title: 'A', messages: [], model: 'm', createdAt: 1, updatedAt: 1, personaId: 'coder', personaEnabled: true },+ { id: 'b', title: 'B', messages: [], model: 'm', createdAt: 1, updatedAt: 1, personaId: 'pirate', personaEnabled: true },+ ] as never,+ activeConversationId: 'a',+ })+ const { unmount } = renderHook(() => useNeuronFollowsPersona())+ useChatStore.setState({ activeConversationId: 'b' })+ await vi.waitFor(() => expect(apply).toHaveBeenCalled())+ expect(apply.mock.calls[0][1]).toEqual([{ id: 'casual', strength: 0.8 }])+ unmount()+ })+})diff --git a/src/hooks/useNeuronFollowsPersona.ts b/src/hooks/useNeuronFollowsPersona.tsindex dd8b7a13..1762318d 100644--- a/src/hooks/useNeuronFollowsPersona.ts+++ b/src/hooks/useNeuronFollowsPersona.ts@@ -1,36 +1,51 @@import { useEffect } from 'react'import { bundledEngineStatus } from '../api/engine'import { neuronApply, neuronInfo } from '../api/neuron'-import { entriesFor, effectiveStrengths, hasPersonaProfile } from '../lib/neuron'+import { entriesFor, effectiveStrengths, hasPersonaProfile, steeringPersona } from '../lib/neuron'+import { useChatStore } from '../stores/chatStore'import { useNeuronStore } from '../stores/neuronStore'import { useSettingsStore } from '../stores/settingsStore'/*** A persona can carry its own Neuron tweaker sliders for a model (3.0.9,- * P11). When the persona changes and either the old or the new one has its- * own, the engine is restarted with the new persona's sliders. When neither- * has, the model's sliders stay and nothing restarts.+ * P11). When the persona that steers (lib/neuron `steeringPersona`: the open+ * chat's own, or the app wide pick) changes and either the old or the new+ * one has its own, the engine is restarted with the new persona's sliders.+ * When neither has, the model's sliders stay and nothing restarts.*/-export async function followPersona(prevId: string, nextId: string): Promise<boolean> {+export async function followPersona(prevId: string | null, nextId: string | null): Promise<boolean> {const status = await bundledEngineStatus().catch(() => null)const modelPath = status?.running ? status.model_path : nullif (!modelPath) return falseconst info = await neuronInfo(modelPath).catch(() => null)if (!info) return falseconst { profiles } = useNeuronStore.getState()- if (!hasPersonaProfile(profiles, info.modelKey, prevId) && !hasPersonaProfile(profiles, info.modelKey, nextId)) return false+ const own = (id: string | null) => !!id && hasPersonaProfile(profiles, info.modelKey, id)+ if (!own(prevId) && !own(nextId)) return falseconst available = new Set(info.vectors.map((v) => v.id))const entries = entriesFor(effectiveStrengths(profiles, info.modelKey, nextId), available)await neuronApply(modelPath, entries, useSettingsStore.getState().settings.builtinEngine)return true}+/** The steering persona right now, from the chat and settings stores. */+export function currentSteeringPersona(): { id: string | null; group: boolean } {+ const s = useSettingsStore.getState()+ return steeringPersona(useChatStore.getState().getActiveConversation(), s.personas, s.activePersonaId, s.settings.personasEnabled !== false)+}+export function useNeuronFollowsPersona(): void {useEffect(() => {- return useSettingsStore.subscribe((state, prev) => {- if (state.activePersonaId !== prev.activePersonaId) {- void followPersona(prev.activePersonaId, state.activePersonaId).catch(() => undefined)- }- })+ let prev = currentSteeringPersona().id+ const check = () => {+ const next = currentSteeringPersona().id+ if (next === prev) return+ const was = prev+ prev = next+ void followPersona(was, next).catch(() => undefined)+ }+ const offSettings = useSettingsStore.subscribe(check)+ const offChat = useChatStore.subscribe(check)+ return () => { offSettings(); offChat() }}, [])}diff --git a/src/lib/neuron.ts b/src/lib/neuron.tsindex 2d94a921..713b57b3 100644--- a/src/lib/neuron.ts+++ b/src/lib/neuron.ts@@ -2,6 +2,9 @@// to which chat, how a job's progress reads, when to warn.import type { NeuronEntry, NeuronJob } from '../api/neuron'+import type { Persona } from '../types/settings'+import { plainChatSpeaker } from './chat-persona'+import { isGroupChat } from './group-chat'/** Slider values by vector id, −1 … +1. */export type Strengths = Record<string, number>@@ -27,6 +30,23 @@ export function effectiveStrengths(profiles: Profiles, modelKey: string, personareturn profiles[modelProfileKey(modelKey)] ?? {}}+/** The persona whose sliders steer the engine, decided the way a send+ * decides who speaks (lib/chat-persona): the open chat's own persona while+ * it is switched on for that chat, the app wide pick when no chat is open.+ * A group chat has none: its speakers may be different personas on the one+ * engine, so the model's sliders apply there (own sliders per speaker:+ * later version). */+export function steeringPersona(+ conv: { personaId?: string; systemPrompt?: string | null; personaEnabled?: boolean; groupModels?: string[] } | undefined,+ personas: readonly Persona[],+ activePersonaId: string | undefined,+ personasOn: boolean,+): { id: string | null; group: boolean } {+ if (!conv) return { id: personasOn && activePersonaId ? activePersonaId : null, group: false }+ if (isGroupChat(conv.groupModels)) return { id: null, group: true }+ return { id: plainChatSpeaker(conv, personas, activePersonaId, personasOn)?.id ?? null, group: false }+}+export function hasPersonaProfile(profiles: Profiles, modelKey: string, personaId: string): boolean {return personaProfileKey(modelKey, personaId) in profiles}