Compare commits

..

2 Commits

Author SHA1 Message Date
Piotr Wilkin
4c4a3e2596 Some renames to make @CISC happy :> 2026-06-14 19:52:23 +02:00
Piotr Wilkin
f2bb114a32 chat: add dedicated Cohere2MoE (North Code) parser 2026-06-14 18:25:19 +02:00
25 changed files with 34 additions and 141 deletions

View File

@@ -3,7 +3,7 @@ ARG BUILD_DATE=N/A
ARG APP_VERSION=N/A
ARG APP_REVISION=N/A
FROM docker.io/ubuntu:$UBUNTU_VERSION AS build
FROM ubuntu:$UBUNTU_VERSION AS build
ARG TARGETARCH
@@ -37,7 +37,7 @@ RUN mkdir -p /app/full \
&& cp .devops/tools.sh /app/full/tools.sh
## Base image
FROM docker.io/ubuntu:$UBUNTU_VERSION AS base
FROM ubuntu:$UBUNTU_VERSION AS base
ARG BUILD_DATE=N/A
ARG APP_VERSION=N/A

View File

@@ -3,9 +3,9 @@ ARG UBUNTU_VERSION=24.04
ARG CUDA_VERSION=12.8.1
ARG GCC_VERSION=14
# Target the CUDA build image
ARG BASE_CUDA_DEV_CONTAINER=docker.io/nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION}
ARG BASE_CUDA_DEV_CONTAINER=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION}
ARG BASE_CUDA_RUN_CONTAINER=docker.io/nvidia/cuda:${CUDA_VERSION}-runtime-ubuntu${UBUNTU_VERSION}
ARG BASE_CUDA_RUN_CONTAINER=nvidia/cuda:${CUDA_VERSION}-runtime-ubuntu${UBUNTU_VERSION}
ARG BUILD_DATE=N/A
ARG APP_VERSION=N/A

View File

@@ -5,7 +5,7 @@ ARG APP_REVISION=N/A
## Build Image
FROM docker.io/intel/deep-learning-essentials:$ONEAPI_VERSION AS build
FROM intel/deep-learning-essentials:$ONEAPI_VERSION AS build
ARG GGML_SYCL_F16=OFF
ARG LEVEL_ZERO_VERSION=1.28.2
@@ -42,7 +42,7 @@ RUN mkdir -p /app/full \
&& cp requirements.txt /app/full \
&& cp .devops/tools.sh /app/full/tools.sh
FROM docker.io/intel/deep-learning-essentials:$ONEAPI_VERSION AS base
FROM intel/deep-learning-essentials:$ONEAPI_VERSION AS base
ARG BUILD_DATE=N/A
ARG APP_VERSION=N/A

View File

@@ -3,7 +3,7 @@ ARG BUILD_DATE=N/A
ARG APP_VERSION=N/A
ARG APP_REVISION=N/A
FROM docker.io/ascendai/cann:$ASCEND_VERSION AS build
FROM ascendai/cann:$ASCEND_VERSION AS build
WORKDIR /app
@@ -30,7 +30,7 @@ RUN echo "Building with static libs" && \
cmake --build build --config Release --target llama-completion
# TODO: use image with NNRT
FROM docker.io/ascendai/cann:$ASCEND_VERSION AS runtime
FROM ascendai/cann:$ASCEND_VERSION AS runtime
ARG BUILD_DATE=N/A
ARG APP_VERSION=N/A

View File

@@ -2,9 +2,9 @@ ARG UBUNTU_VERSION=22.04
# This needs to generally match the container host's environment.
ARG MUSA_VERSION=rc4.3.0
# Target the MUSA build image
ARG BASE_MUSA_DEV_CONTAINER=docker.io/mthreads/musa:${MUSA_VERSION}-devel-ubuntu${UBUNTU_VERSION}-amd64
ARG BASE_MUSA_DEV_CONTAINER=mthreads/musa:${MUSA_VERSION}-devel-ubuntu${UBUNTU_VERSION}-amd64
ARG BASE_MUSA_RUN_CONTAINER=docker.io/mthreads/musa:${MUSA_VERSION}-runtime-ubuntu${UBUNTU_VERSION}-amd64
ARG BASE_MUSA_RUN_CONTAINER=mthreads/musa:${MUSA_VERSION}-runtime-ubuntu${UBUNTU_VERSION}-amd64
ARG BUILD_DATE=N/A
ARG APP_VERSION=N/A

View File

@@ -23,7 +23,7 @@ ARG APP_VERSION=N/A
ARG APP_REVISION=N/A
## Build Image
FROM docker.io/ubuntu:${UBUNTU_VERSION} AS build
FROM ubuntu:${UBUNTU_VERSION} AS build
# Pass proxy args to build stage
ARG http_proxy
@@ -88,7 +88,7 @@ RUN mkdir -p /app/full \
&& cp .devops/tools.sh /app/full/tools.sh
## Base Runtime Image
FROM docker.io/ubuntu:${UBUNTU_VERSION} AS base
FROM ubuntu:${UBUNTU_VERSION} AS base
# Pass proxy args to runtime stage
ARG http_proxy

View File

@@ -5,7 +5,7 @@ ARG ROCM_VERSION=7.2.1
ARG AMDGPU_VERSION=7.2.1
# Target the ROCm build image
ARG BASE_ROCM_DEV_CONTAINER=docker.io/rocm/dev-ubuntu-${UBUNTU_VERSION}:${ROCM_VERSION}-complete
ARG BASE_ROCM_DEV_CONTAINER=rocm/dev-ubuntu-${UBUNTU_VERSION}:${ROCM_VERSION}-complete
ARG BUILD_DATE=N/A
ARG APP_VERSION=N/A

View File

@@ -5,7 +5,7 @@ ARG APP_VERSION=N/A
ARG APP_REVISION=N/A
### Build Llama.cpp stage
FROM docker.io/gcc:${GCC_VERSION} AS build
FROM gcc:${GCC_VERSION} AS build
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
@@ -55,7 +55,7 @@ COPY --from=build /opt/llama.cpp/conversion /llama.cpp/conversion
### Base image
FROM docker.io/ubuntu:${UBUNTU_VERSION} AS base
FROM ubuntu:${UBUNTU_VERSION} AS base
ARG BUILD_DATE=N/A
ARG APP_VERSION=N/A

View File

@@ -3,7 +3,7 @@ ARG BUILD_DATE=N/A
ARG APP_VERSION=N/A
ARG APP_REVISION=N/A
FROM docker.io/ubuntu:$UBUNTU_VERSION AS build
FROM ubuntu:$UBUNTU_VERSION AS build
# Install build tools
RUN apt update && apt install -y git build-essential cmake wget xz-utils
@@ -33,7 +33,7 @@ RUN mkdir -p /app/full \
&& cp .devops/tools.sh /app/full/tools.sh
## Base image
FROM docker.io/ubuntu:$UBUNTU_VERSION AS base
FROM ubuntu:$UBUNTU_VERSION AS base
ARG BUILD_DATE=N/A
ARG APP_VERSION=N/A

View File

@@ -3,7 +3,7 @@ ARG BUILD_DATE=N/A
ARG APP_VERSION=N/A
ARG APP_REVISION=N/A
FROM docker.io/ubuntu:$UBUNTU_VERSION AS build
FROM ubuntu:$UBUNTU_VERSION AS build
RUN apt-get update && \
apt-get install -y gcc-13 g++-13 build-essential git cmake libssl-dev libomp-dev libnuma-dev python3 ca-certificates
@@ -30,7 +30,7 @@ RUN mkdir -p /app/full \
&& cp .devops/tools.sh /app/full/tools.sh
## Base image
FROM docker.io/ubuntu:$UBUNTU_VERSION AS base
FROM ubuntu:$UBUNTU_VERSION AS base
ARG BUILD_DATE=N/A
ARG APP_VERSION=N/A

View File

@@ -270,7 +270,7 @@ You have successfully set up CUDA on Fedora within a toolbox environment using t
---
**Disclaimer:** Manually installing and modifying system packages can lead to instability of the container. The above steps are provided as a guideline and may need adjustments based on your specific system configuration. Always back up important data before making significant system changes, especially as your home folder is writable and shared with the toolbox.
**Disclaimer:** Manually installing and modifying system packages can lead to instability of the container. The above steps are provided as a guideline and may need adjustments based on your specific system configuration. Always back up important data before making significant system changes, especially as your home folder is writable and shared with he toolbox.
**Acknowledgments:** Special thanks to the Fedora community and NVIDIA documentation for providing resources that assisted in creating this guide.

View File

@@ -233,7 +233,7 @@ And a non-exhaustive list of other unsupported features that are unlikely to be
> [!WARNING]
> The JSON schemas spec states `object`s accept [additional properties](https://json-schema.org/understanding-json-schema/reference/object#additionalproperties) by default.
> Since this is slow and seems prone to hallucinations, we default to no additional properties.
> You can set `"additionalProperties": true` in the schema of any object to explicitly allow additional properties.
> You can set `"additionalProperties": true` in the the schema of any object to explicitly allow additional properties.
If you're using [Pydantic](https://pydantic.dev/) to generate schemas, you can enable additional properties with the `extra` config on each model class:

View File

@@ -9,10 +9,7 @@
<link rel="manifest" href="./manifest.webmanifest" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, interactive-widget=resizes-content"
/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%
</head>

View File

@@ -56,7 +56,6 @@
const showToolCallInProgress = $derived(config().showToolCallInProgress as boolean);
const showThoughtInProgress = $derived(config().showThoughtInProgress as boolean);
const renderThinkingAsMarkdown = $derived(config().renderThinkingAsMarkdown as boolean);
const hasReasoningError = $derived(
isLastAssistantMessage ? !!agenticLastError(message.convId) : false
@@ -317,13 +316,9 @@
onToggle={() => toggleExpanded(index, section)}
>
<div class="pt-3">
{#if renderThinkingAsMarkdown}
<MarkdownContent content={section.content} attachments={message?.extra} />
{:else}
<div class="text-xs leading-relaxed break-words whitespace-pre-wrap">
{section.content}
</div>
{/if}
<div class="text-xs leading-relaxed break-words whitespace-pre-wrap">
{section.content}
</div>
</div>
</CollapsibleContentBlock>
{:else if section.type === AgenticSectionType.REASONING_PENDING}
@@ -341,13 +336,9 @@
onToggle={() => toggleExpanded(index, section)}
>
<div class="pt-3">
{#if renderThinkingAsMarkdown}
<MarkdownContent content={section.content} attachments={message?.extra} />
{:else}
<div class="text-xs leading-relaxed break-words whitespace-pre-wrap">
{section.content}
</div>
{/if}
<div class="text-xs leading-relaxed break-words whitespace-pre-wrap">
{section.content}
</div>
</div>
</CollapsibleContentBlock>
{/if}

View File

@@ -41,7 +41,7 @@
data-slot="sidebar-wrapper"
style="--sidebar-width: {sidebar.sidebarWidth}; --sidebar-min-width: {SIDEBAR_MIN_WIDTH}; --sidebar-max-width: {SIDEBAR_MAX_WIDTH}; --sidebar-width-icon: {SIDEBAR_WIDTH_ICON}; {style}"
class={cn(
'group/sidebar-wrapper flex flex-col h-dvh w-full has-data-[variant=inset]:bg-sidebar',
'group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar',
className
)}
bind:this={ref}

View File

@@ -1,3 +1 @@
export const MEGAPIXELS_TO_PIXELS = 1_000_000;
export const HEIC_JPEG_QUALITY = 0.85;

View File

@@ -33,7 +33,6 @@ export const SETTINGS_KEYS = {
SHOW_MODEL_TAGS: 'showModelTags',
SHOW_BUILD_VERSION: 'showBuildVersion',
SHOW_SYSTEM_MESSAGE: 'showSystemMessage',
RENDER_THINKING_AS_MARKDOWN: 'renderThinkingAsMarkdown',
// Sampling
TEMPERATURE: 'temperature',
DYNATEMP_RANGE: 'dynatemp_range',

View File

@@ -282,18 +282,6 @@ const SETTINGS_REGISTRY: Record<string, SettingsSectionEntry> = {
paramType: SyncableParameterType.BOOLEAN
}
},
{
key: SETTINGS_KEYS.RENDER_THINKING_AS_MARKDOWN,
label: 'Render thinking as Markdown',
help: 'Render the reasoning/thinking block content as formatted Markdown instead of plain text.',
defaultValue: true,
type: SettingsFieldType.CHECKBOX,
section: SETTINGS_SECTION_SLUGS.DISPLAY,
sync: {
serverKey: SETTINGS_KEYS.RENDER_THINKING_AS_MARKDOWN,
paramType: SyncableParameterType.BOOLEAN
}
},
{
key: SETTINGS_KEYS.FULL_HEIGHT_CODE_BLOCKS,
label: 'Use full height code blocks',

View File

@@ -63,10 +63,6 @@ export const IMAGE_FILE_TYPES = {
[FileTypeImage.SVG]: {
extensions: [FileExtensionImage.SVG],
mimeTypes: [MimeTypeImage.SVG]
},
[FileTypeImage.HEIC]: {
extensions: [FileExtensionImage.HEIC, FileExtensionImage.HEIF],
mimeTypes: [MimeTypeImage.HEIC, MimeTypeImage.HEIF]
}
} as const;

View File

@@ -25,9 +25,7 @@ export enum FileTypeImage {
PNG = 'png',
GIF = 'gif',
WEBP = 'webp',
SVG = 'svg',
HEIC = 'heic',
HEIF = 'heif'
SVG = 'svg'
}
export enum FileTypeAudio {
@@ -92,9 +90,7 @@ export enum FileExtensionImage {
PNG = '.png',
GIF = '.gif',
WEBP = '.webp',
SVG = '.svg',
HEIC = '.heic',
HEIF = '.heif'
SVG = '.svg'
}
export enum FileExtensionAudio {
@@ -209,9 +205,7 @@ export enum MimeTypeImage {
WEBP = 'image/webp',
SVG = 'image/svg+xml',
ICO = 'image/x-icon',
ICO_MICROSOFT = 'image/vnd.microsoft.icon',
HEIC = 'image/heic',
HEIF = 'image/heif'
ICO_MICROSOFT = 'image/vnd.microsoft.icon'
}
export enum MimeTypeText {

View File

@@ -53,8 +53,6 @@ export function usePwa() {
// This comparison detects server upgrades for non-PWA users.
$effect(() => {
if (!browser) return;
// PWA pages update via the service worker path; the storage check is the non-PWA fallback only
if (navigator.serviceWorker?.controller) return;
const currentVersion = versionStore.value;
if (!currentVersion) return;

View File

@@ -30,8 +30,6 @@ export function getFileTypeCategory(mimeType: string): FileTypeCategory | null {
case MimeTypeImage.GIF:
case MimeTypeImage.WEBP:
case MimeTypeImage.SVG:
case MimeTypeImage.HEIC:
case MimeTypeImage.HEIF:
return FileTypeCategory.IMAGE;
// Audio
@@ -120,8 +118,6 @@ export function getFileTypeCategoryByExtension(filename: string): FileTypeCatego
case FileExtensionImage.GIF:
case FileExtensionImage.WEBP:
case FileExtensionImage.SVG:
case FileExtensionImage.HEIC:
case FileExtensionImage.HEIF:
return FileTypeCategory.IMAGE;
// Audio

View File

@@ -1,56 +0,0 @@
import { MimeTypeImage } from '$lib/enums';
import { HEIC_JPEG_QUALITY } from '$lib/constants/image-size';
// heic requires a relatively large decoder, in order to reduce primary bundle size
// we lazily load this decoder from a CDN when needed, and cache it for future conversions
const HEIC_TO_CDN_URL = 'https://cdn.jsdelivr.net/npm/heic-to@1.5.2/dist/heic-to.js';
interface HeicToModule {
heicTo(args: { blob: Blob; type: string; quality?: number }): Promise<Blob>;
}
let modulePromise: Promise<HeicToModule> | null = null;
/**
* Lazily load the heic-to decoder from the CDN and cache it
* @returns Promise resolving to the heic-to module
*/
function getHeicTo(): Promise<HeicToModule> {
if (!modulePromise) {
modulePromise = import(/* @vite-ignore */ HEIC_TO_CDN_URL) as Promise<HeicToModule>;
}
return modulePromise;
}
/**
* Convert a HEIC/HEIF file to a compressed JPEG data URL
* @param file - The HEIC/HEIF file to convert
* @returns Promise resolving to JPEG data URL
*/
export async function heicFileToJpegDataURL(file: File | Blob): Promise<string> {
const { heicTo } = await getHeicTo();
const jpegBlob = await heicTo({
blob: file,
type: MimeTypeImage.JPEG,
quality: HEIC_JPEG_QUALITY
});
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onload = () => resolve(reader.result as string);
reader.onerror = () => reject(reader.error);
reader.readAsDataURL(jpegBlob);
});
}
/**
* Check if a MIME type represents a HEIC/HEIF image
* @param mimeType - The MIME type to check
* @returns True if the MIME type is image/heic or image/heif
*/
export function isHeicMimeType(mimeType: string): boolean {
const normalized = mimeType.trim().toLowerCase();
return normalized === MimeTypeImage.HEIC || normalized === MimeTypeImage.HEIF;
}

View File

@@ -1,6 +1,5 @@
import { isSvgMimeType, svgBase64UrlToPngDataURL } from './svg-to-png';
import { isWebpMimeType, webpBase64UrlToPngDataURL } from './webp-to-png';
import { heicFileToJpegDataURL, isHeicMimeType } from './heic-to-jpeg';
import { FileTypeCategory } from '$lib/enums';
import { SETTINGS_KEYS } from '$lib/constants';
import { modelsStore } from '$lib/stores/models.svelte';
@@ -69,7 +68,7 @@ export async function processFilesToChatUploaded(
if (getFileTypeCategory(file.type) === FileTypeCategory.IMAGE) {
let preview = await readFileAsDataURL(file);
// Normalize SVG and WebP to PNG, and HEIC to compressed JPEG, in previews
// Normalize SVG and WebP to PNG in previews
if (isSvgMimeType(file.type)) {
try {
preview = await svgBase64UrlToPngDataURL(preview);
@@ -82,13 +81,6 @@ export async function processFilesToChatUploaded(
} catch (err) {
console.error('Failed to convert WebP to PNG:', err);
}
} else if (isHeicMimeType(file.type)) {
try {
preview = await heicFileToJpegDataURL(file);
} catch (err) {
console.error('Failed to convert HEIC to PNG:', err);
continue;
}
}
results.push({ ...base, preview });

View File

@@ -312,7 +312,7 @@
/>
<Sidebar.Provider bind:open={sidebarOpen}>
<div class="flex h-full w-full grow">
<div class="flex h-screen w-full">
<Sidebar.Root variant="floating" class="h-full"
><SidebarNavigation bind:this={chatSidebar} /></Sidebar.Root
>