Spaces:
Running
Running
File size: 2,207 Bytes
c39ed26 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
import { addLogEntry } from "./logEntries";
import { isF16Supported } from "./webGpu";
export const defaultSettings = {
showEnableAiResponsePrompt: true,
enableAiResponse: false,
enableWebGpu: true,
enableImageSearch: true,
webLlmModelId: isF16Supported
? VITE_WEBLLM_DEFAULT_F16_MODEL_ID
: VITE_WEBLLM_DEFAULT_F32_MODEL_ID,
wllamaModelId: VITE_WLLAMA_DEFAULT_MODEL_ID,
cpuThreads: Math.max(1, (navigator.hardwareConcurrency ?? 1) - 2),
searchResultsToConsider: 3,
searchResultsLimit: 15,
systemPrompt: `Answer using the search results below as your primary source, supplemented by your own knowledge when needed.
Cite every fact from the search results by placing a link immediately after it in this format: [domain.com](https://full-url). The link text must be the top-level domain only (no "https://", "www.", or paths).
Only cite sources that appear in the search results below. Never fabricate or hallucinate citations.
Write in the same language as the query.
You may use these Markdown elements: anchor, bold, italic, code, quote, table.
Below are the search results fetched at {{dateTime}}.
{{searchResults}}`,
inferenceType: VITE_DEFAULT_INFERENCE_TYPE,
inferenceTemperature: 0.7,
inferenceTopP: 0.9,
minP: 0.1,
inferenceFrequencyPenalty: 0,
inferencePresencePenalty: 0,
openAiApiBaseUrl: "",
openAiApiKey: "",
openAiApiModel: "",
hordeApiKey: "0000000000",
hordeModel: "",
enterToSubmit: true,
enableAiResponseScrolling: true,
allowAiModelDownload: false,
enableTextSearch: true,
enableHistory: true,
historyMaxEntries: 1000,
historyAutoCleanup: true,
historyRetentionDays: 30,
historyGroupByDate: true,
selectedVoiceId: "",
reasoningStartMarker: "<think>",
reasoningEndMarker: "</think>",
};
addLogEntry(
`Number of logical processors in CPU: ${
navigator.hardwareConcurrency ?? "unknown"
}`,
);
export const inferenceTypes = [
{ value: "browser", label: "In the browser (Private)" },
{ value: "openai", label: "Remote server (API)" },
{ value: "horde", label: "AI Horde (Pre-configured)" },
...(VITE_INTERNAL_API_ENABLED
? [{ value: "internal", label: VITE_INTERNAL_API_NAME }]
: []),
];
|