Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions src/components/chat/ChatMessages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type ChatMessagesProps = {
streamingContent: string;
loadingPhase?: string;
loadingProgress?: number;
layersOnGpu?: number;
layersOnRpc?: number;
};

function phaseLabel(phase: string, progress: number): string {
Expand Down Expand Up @@ -115,7 +115,7 @@ export function ChatMessages({
streamingContent,
loadingPhase,
loadingProgress = 0,
layersOnGpu = 0,
layersOnRpc = 0,
}: ChatMessagesProps) {
const bottomRef = useRef<HTMLDivElement>(null);

Expand Down Expand Up @@ -225,7 +225,7 @@ export function ChatMessages({
<span className="typing-dot" />
<span className="typing-status-text">
{phaseLabel(loadingPhase, loadingProgress)}
{layersOnGpu > 0 && ` · ${layersOnGpu} layers on GPU`}
{layersOnRpc > 0 && ` · ${layersOnRpc} layers on RPC`}
</span>
</div>
) : (
Expand Down
6 changes: 3 additions & 3 deletions src/context/ChatStreamingContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type StreamEntry = {
streamingContent: string;
loadingPhase: string;
loadingProgress: number;
layersOnGpu: number;
layersOnRpc: number;
};

export type StreamToast = {
Expand All @@ -24,7 +24,7 @@ const emptyEntry: StreamEntry = {
streamingContent: '',
loadingPhase: '',
loadingProgress: 0,
layersOnGpu: 0,
layersOnRpc: 0,
};

export type StartStreamParams = {
Expand Down Expand Up @@ -122,7 +122,7 @@ export function ChatStreamingProvider({ children }: { children: ReactNode }) {
if (assistantContent !== '') { clearInterval(phaseInterval); return; }
void getLoadingStatus().then((s) => {
if (assistantContent === '') {
patch(convId, { loadingPhase: s.phase, loadingProgress: s.progress, layersOnGpu: s.layers_on_gpu });
patch(convId, { loadingPhase: s.phase, loadingProgress: s.progress, layersOnRpc: s.layers_on_rpc });
}
}).catch(() => undefined);
}, 1200);
Expand Down
4 changes: 2 additions & 2 deletions src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ export async function appendChatEvent(
await postJson(chatEventsUrl(chatId), event);
}

export async function getLoadingStatus(): Promise<{ model: string; phase: string; progress: number; layers_on_gpu: number; node_count: number }> {
return getJson<{ model: string; phase: string; progress: number; layers_on_gpu: number; node_count: number }>('/api/ui/loading-status');
export async function getLoadingStatus(): Promise<{ model: string; phase: string; progress: number; layers_on_rpc: number; node_count: number }> {
return getJson<{ model: string; phase: string; progress: number; layers_on_rpc: number; node_count: number }>('/api/ui/loading-status');
}

export async function getParallelismTarget(): Promise<ParallelismTarget> {
Expand Down
6 changes: 3 additions & 3 deletions src/pages/ChatPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const emptyStream = {
streamingContent: '',
loadingPhase: '',
loadingProgress: 0,
layersOnGpu: 0,
layersOnRpc: 0,
};

export function ChatPage() {
Expand Down Expand Up @@ -58,7 +58,7 @@ export function ChatPage() {
const messages = activeConv?.messages ?? [];
const model = activeConv?.model ?? modelParam;

const { streaming, streamingContent, loadingPhase, loadingProgress, layersOnGpu } =
const { streaming, streamingContent, loadingPhase, loadingProgress, layersOnRpc } =
(activeId ? streams[activeId] : null) ?? emptyStream;

const thinkingSupported = models.find((m) => m.model === model)?.supports_thinking ?? false;
Expand Down Expand Up @@ -135,7 +135,7 @@ export function ChatPage() {
streamingContent={streamingContent}
loadingPhase={loadingPhase}
loadingProgress={loadingProgress}
layersOnGpu={layersOnGpu}
layersOnRpc={layersOnRpc}
/>
<ChatComposer
onSend={handleSend}
Expand Down
3 changes: 1 addition & 2 deletions src/types/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export type LoadingStatus = {
model: string;
phase: string;
progress: number;
layers_on_gpu: number;
layers_on_rpc: number;
layers_offloaded: number;
node_count: number;
};
Expand All @@ -114,4 +114,3 @@ export type ParallelismTarget = {
export type StorageChunkSize = {
chunk_size_bytes: number;
};