chore: v1 to v2
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
const proxyTableList = [
|
const proxyTableList = [
|
||||||
'cli',
|
'cli',
|
||||||
'v1',
|
'v1',
|
||||||
|
'v2',
|
||||||
'auth',
|
'auth',
|
||||||
'v1-openai',
|
'v1-openai',
|
||||||
'version',
|
'version',
|
||||||
|
|||||||
@@ -7,4 +7,5 @@ export const DEFAULT_ENTER_PAGE = {
|
|||||||
login: '/login'
|
login: '/login'
|
||||||
};
|
};
|
||||||
|
|
||||||
export const GPUSTACK_API_BASE_URL = 'v1';
|
export const GPUSTACK_API_BASE_URL = 'v2';
|
||||||
|
export const OPENAI_COMPATIBLE = 'v1';
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { throttle } from 'lodash';
|
|||||||
import qs from 'query-string';
|
import qs from 'query-string';
|
||||||
import { useEffect, useRef } from 'react';
|
import { useEffect, useRef } from 'react';
|
||||||
|
|
||||||
const GPUSTACK_API = GPUSTACK_API_BASE_URL;
|
|
||||||
export interface HandlerOptions {
|
export interface HandlerOptions {
|
||||||
isComplete?: boolean | null;
|
isComplete?: boolean | null;
|
||||||
percent?: number;
|
percent?: number;
|
||||||
@@ -170,7 +169,7 @@ const useSetChunkFetch = () => {
|
|||||||
axiosToken.current = new AbortController();
|
axiosToken.current = new AbortController();
|
||||||
try {
|
try {
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
`${GPUSTACK_API}${url}?${qs.stringify({
|
`${GPUSTACK_API_BASE_URL}${url}?${qs.stringify({
|
||||||
...params,
|
...params,
|
||||||
watch: watch === undefined ? true : watch
|
watch: watch === undefined ? true : watch
|
||||||
})}`,
|
})}`,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import AutoTooltip from '@/components/auto-tooltip';
|
|||||||
import CopyButton from '@/components/copy-button';
|
import CopyButton from '@/components/copy-button';
|
||||||
import IconFont from '@/components/icon-font';
|
import IconFont from '@/components/icon-font';
|
||||||
import ScrollerModal from '@/components/scroller-modal';
|
import ScrollerModal from '@/components/scroller-modal';
|
||||||
import { GPUSTACK_API_BASE_URL } from '@/config/settings';
|
import { OPENAI_COMPATIBLE } from '@/config/settings';
|
||||||
import {
|
import {
|
||||||
AUDIO_SPEECH_TO_TEXT_API,
|
AUDIO_SPEECH_TO_TEXT_API,
|
||||||
AUDIO_TEXT_TO_SPEECH_API,
|
AUDIO_TEXT_TO_SPEECH_API,
|
||||||
@@ -23,8 +23,6 @@ import { modelCategoriesMap } from '../config';
|
|||||||
import { ListItem } from '../config/types';
|
import { ListItem } from '../config/types';
|
||||||
import useGenericProxy from '../hooks/use-generic-proxy';
|
import useGenericProxy from '../hooks/use-generic-proxy';
|
||||||
|
|
||||||
const GPUSTACK_API = GPUSTACK_API_BASE_URL;
|
|
||||||
|
|
||||||
const API_MAP: Record<string, { api: string }> = {
|
const API_MAP: Record<string, { api: string }> = {
|
||||||
[modelCategoriesMap.embedding]: {
|
[modelCategoriesMap.embedding]: {
|
||||||
api: EMBEDDING_API
|
api: EMBEDDING_API
|
||||||
@@ -112,7 +110,7 @@ const ApiAccessInfo = ({ open, data, onClose }: ApiAccessInfoProps) => {
|
|||||||
|
|
||||||
const endPoint = useMemo(() => {
|
const endPoint = useMemo(() => {
|
||||||
if (!data.generic_proxy) {
|
if (!data.generic_proxy) {
|
||||||
return `${window.location.origin}/${GPUSTACK_API}`;
|
return `${window.location.origin}/${OPENAI_COMPATIBLE}`;
|
||||||
}
|
}
|
||||||
return `${window.location.origin}${MODEL_PROXY}/<YOUR_API_PATH>`;
|
return `${window.location.origin}${MODEL_PROXY}/<YOUR_API_PATH>`;
|
||||||
}, [data]);
|
}, [data]);
|
||||||
|
|||||||
@@ -454,9 +454,12 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
|||||||
enabled: false,
|
enabled: false,
|
||||||
algorithm: '',
|
algorithm: '',
|
||||||
draft_model: null,
|
draft_model: null,
|
||||||
num_draft_tokens: 4,
|
num_draft_tokens:
|
||||||
ngram_min_match_length: 1,
|
initialValues?.speculative_config?.num_draft_tokens || 4,
|
||||||
ngram_max_match_length: 10
|
ngram_min_match_length:
|
||||||
|
initialValues?.speculative_config?.ngram_min_match_length || 1,
|
||||||
|
ngram_max_match_length:
|
||||||
|
initialValues?.speculative_config?.ngram_max_match_length || 10
|
||||||
},
|
},
|
||||||
...initialValues
|
...initialValues
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
import { GPUSTACK_API_BASE_URL } from '@/config/settings';
|
import { GPUSTACK_API_BASE_URL, OPENAI_COMPATIBLE } from '@/config/settings';
|
||||||
import { createFormData, errorHandler } from '@/utils/fetch-chunk-data';
|
import { createFormData, errorHandler } from '@/utils/fetch-chunk-data';
|
||||||
import { request } from '@umijs/max';
|
import { request } from '@umijs/max';
|
||||||
|
|
||||||
export const OPENAI_COMPATIBLE = 'v1-openai';
|
export { GPUSTACK_API_BASE_URL, OPENAI_COMPATIBLE };
|
||||||
|
|
||||||
export const GPUSTACK_API = GPUSTACK_API_BASE_URL;
|
|
||||||
|
|
||||||
export const CHAT_API = `/${OPENAI_COMPATIBLE}/chat/completions`;
|
export const CHAT_API = `/${OPENAI_COMPATIBLE}/chat/completions`;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import AlertInfo from '@/components/alert-info';
|
import AlertInfo from '@/components/alert-info';
|
||||||
import SealInputNumber from '@/components/seal-form/input-number';
|
import SealInputNumber from '@/components/seal-form/input-number';
|
||||||
import { GPUSTACK_API_BASE_URL } from '@/config/settings';
|
import { OPENAI_COMPATIBLE } from '@/config/settings';
|
||||||
import useOverlayScroller from '@/hooks/use-overlay-scroller';
|
import useOverlayScroller from '@/hooks/use-overlay-scroller';
|
||||||
import useRequestToken from '@/hooks/use-request-token';
|
import useRequestToken from '@/hooks/use-request-token';
|
||||||
import {
|
import {
|
||||||
@@ -202,7 +202,7 @@ const GroundReranker: React.FC<MessageProps> = forwardRef((props, ref) => {
|
|||||||
|
|
||||||
const viewCodeContent = useMemo(() => {
|
const viewCodeContent = useMemo(() => {
|
||||||
return generateRerankCode({
|
return generateRerankCode({
|
||||||
api: `/${GPUSTACK_API_BASE_URL}/rerank`,
|
api: `/${OPENAI_COMPATIBLE}/rerank`,
|
||||||
parameters: {
|
parameters: {
|
||||||
..._.pick(parameters, ['model', ..._.split(formFields, ',')]),
|
..._.pick(parameters, ['model', ..._.split(formFields, ',')]),
|
||||||
query: queryValue,
|
query: queryValue,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { GPUSTACK_API, MODEL_PROXY, OPENAI_COMPATIBLE } from '../apis';
|
import { MODEL_PROXY, OPENAI_COMPATIBLE } from '../apis';
|
||||||
import { fomatNodeJsParams, formatCurlArgs, formatPyParams } from './utils';
|
import { fomatNodeJsParams, formatCurlArgs, formatPyParams } from './utils';
|
||||||
|
|
||||||
export const generateSpeechToTextCurlCode = ({
|
export const generateSpeechToTextCurlCode = ({
|
||||||
@@ -9,9 +9,7 @@ export const generateSpeechToTextCurlCode = ({
|
|||||||
}: Record<string, any>) => {
|
}: Record<string, any>) => {
|
||||||
const host = window.location.origin;
|
const host = window.location.origin;
|
||||||
// replace url OPENAI_COMPATIBLE with GPUSTACK
|
// replace url OPENAI_COMPATIBLE with GPUSTACK
|
||||||
const api = modelProxy
|
const api = modelProxy ? `${MODEL_PROXY}/\${YOUR_API_PATH}` : url;
|
||||||
? `${MODEL_PROXY}/\${YOUR_API_PATH}`
|
|
||||||
: url.replace(OPENAI_COMPATIBLE, GPUSTACK_API);
|
|
||||||
|
|
||||||
// ========================= Curl =========================
|
// ========================= Curl =========================
|
||||||
const curlCode = `
|
const curlCode = `
|
||||||
@@ -32,8 +30,6 @@ export const speechToTextCode = ({
|
|||||||
parameters
|
parameters
|
||||||
}: Record<string, any>) => {
|
}: Record<string, any>) => {
|
||||||
const host = window.location.origin;
|
const host = window.location.origin;
|
||||||
// replace url OPENAI_COMPATIBLE with GPUSTACK
|
|
||||||
const api = url.replace(OPENAI_COMPATIBLE, GPUSTACK_API);
|
|
||||||
|
|
||||||
// ========================= Curl =========================
|
// ========================= Curl =========================
|
||||||
const curlCode = generateSpeechToTextCurlCode({ api: url, parameters });
|
const curlCode = generateSpeechToTextCurlCode({ api: url, parameters });
|
||||||
@@ -43,7 +39,7 @@ export const speechToTextCode = ({
|
|||||||
from openai import OpenAI\n
|
from openai import OpenAI\n
|
||||||
audio_file = open("audio.mp3", "rb")
|
audio_file = open("audio.mp3", "rb")
|
||||||
client = OpenAI(
|
client = OpenAI(
|
||||||
base_url="${host}/${GPUSTACK_API}",
|
base_url="${host}/${OPENAI_COMPATIBLE}",
|
||||||
api_key="YOUR_GPUSTACK_API_KEY"
|
api_key="YOUR_GPUSTACK_API_KEY"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -68,7 +64,7 @@ const OpenAI = require("openai");
|
|||||||
|
|
||||||
const openai = new OpenAI({
|
const openai = new OpenAI({
|
||||||
"apiKey": "YOUR_GPUSTACK_API_KEY",
|
"apiKey": "YOUR_GPUSTACK_API_KEY",
|
||||||
"baseURL": "${host}/${GPUSTACK_API}"
|
"baseURL": "${host}/${OPENAI_COMPATIBLE}"
|
||||||
});
|
});
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
@@ -92,9 +88,7 @@ export const generateTextToSpeechCurlCode = ({
|
|||||||
parameters
|
parameters
|
||||||
}: Record<string, any>) => {
|
}: Record<string, any>) => {
|
||||||
const host = window.location.origin;
|
const host = window.location.origin;
|
||||||
const api = modelProxy
|
const api = modelProxy ? `${MODEL_PROXY}/\${YOUR_API_PATH}` : url;
|
||||||
? `${MODEL_PROXY}/\${YOUR_API_PATH}`
|
|
||||||
: url.replace(OPENAI_COMPATIBLE, GPUSTACK_API);
|
|
||||||
|
|
||||||
// ========================= Curl =========================
|
// ========================= Curl =========================
|
||||||
const curlCode = `
|
const curlCode = `
|
||||||
@@ -111,7 +105,6 @@ export const TextToSpeechCode = ({
|
|||||||
parameters
|
parameters
|
||||||
}: Record<string, any>) => {
|
}: Record<string, any>) => {
|
||||||
const host = window.location.origin;
|
const host = window.location.origin;
|
||||||
const api = url.replace(OPENAI_COMPATIBLE, GPUSTACK_API);
|
|
||||||
|
|
||||||
// ========================= Curl =========================
|
// ========================= Curl =========================
|
||||||
const curlCode = generateTextToSpeechCurlCode({ api: url, parameters });
|
const curlCode = generateTextToSpeechCurlCode({ api: url, parameters });
|
||||||
@@ -122,7 +115,7 @@ from pathlib import Path
|
|||||||
from openai import OpenAI\n
|
from openai import OpenAI\n
|
||||||
output_file_path = Path(__file__).parent / "output.mp3"
|
output_file_path = Path(__file__).parent / "output.mp3"
|
||||||
client = OpenAI(
|
client = OpenAI(
|
||||||
base_url="${host}/${GPUSTACK_API}",
|
base_url="${host}/${OPENAI_COMPATIBLE}",
|
||||||
api_key="YOUR_GPUSTACK_API_KEY"
|
api_key="YOUR_GPUSTACK_API_KEY"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -147,7 +140,7 @@ const ouptFile = path.resolve("./output.mp3");
|
|||||||
|
|
||||||
const openai = new OpenAI({
|
const openai = new OpenAI({
|
||||||
"apiKey": "YOUR_GPUSTACK_API_KEY",
|
"apiKey": "YOUR_GPUSTACK_API_KEY",
|
||||||
"baseURL": "${host}/${GPUSTACK_API}"
|
"baseURL": "${host}/${OPENAI_COMPATIBLE}"
|
||||||
});
|
});
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { GPUSTACK_API, MODEL_PROXY, OPENAI_COMPATIBLE } from '../apis';
|
import { MODEL_PROXY, OPENAI_COMPATIBLE } from '../apis';
|
||||||
import { fomatNodeJsParams, formatCurlArgs, formatPyParams } from './utils';
|
import { fomatNodeJsParams, formatCurlArgs, formatPyParams } from './utils';
|
||||||
|
|
||||||
export const generateEmbeddingCurlCode = ({
|
export const generateEmbeddingCurlCode = ({
|
||||||
@@ -7,9 +7,7 @@ export const generateEmbeddingCurlCode = ({
|
|||||||
parameters
|
parameters
|
||||||
}: Record<string, any>) => {
|
}: Record<string, any>) => {
|
||||||
const host = window.location.origin;
|
const host = window.location.origin;
|
||||||
const api = modelProxy
|
const api = modelProxy ? `${MODEL_PROXY}/\${YOUR_API_PATH}` : url;
|
||||||
? `${MODEL_PROXY}/\${YOUR_API_PATH}`
|
|
||||||
: url.replace(OPENAI_COMPATIBLE, GPUSTACK_API);
|
|
||||||
|
|
||||||
// ========================= Curl =========================
|
// ========================= Curl =========================
|
||||||
const curlCode = `
|
const curlCode = `
|
||||||
@@ -26,7 +24,6 @@ export const generateEmbeddingCode = ({
|
|||||||
parameters
|
parameters
|
||||||
}: Record<string, any>) => {
|
}: Record<string, any>) => {
|
||||||
const host = window.location.origin;
|
const host = window.location.origin;
|
||||||
const api = url.replace(OPENAI_COMPATIBLE, GPUSTACK_API);
|
|
||||||
|
|
||||||
// ========================= Curl =========================
|
// ========================= Curl =========================
|
||||||
const curlCode = generateEmbeddingCurlCode({ api: url, parameters });
|
const curlCode = generateEmbeddingCurlCode({ api: url, parameters });
|
||||||
@@ -35,7 +32,7 @@ export const generateEmbeddingCode = ({
|
|||||||
const pythonCode = `
|
const pythonCode = `
|
||||||
from openai import OpenAI\n
|
from openai import OpenAI\n
|
||||||
client = OpenAI(
|
client = OpenAI(
|
||||||
base_url="${host}/${GPUSTACK_API}",
|
base_url="${host}/${OPENAI_COMPATIBLE}",
|
||||||
api_key="YOUR_GPUSTACK_API_KEY"
|
api_key="YOUR_GPUSTACK_API_KEY"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -52,7 +49,7 @@ const OpenAI = require("openai");
|
|||||||
|
|
||||||
const openai = new OpenAI({
|
const openai = new OpenAI({
|
||||||
"apiKey": "YOUR_GPUSTACK_API_KEY",
|
"apiKey": "YOUR_GPUSTACK_API_KEY",
|
||||||
"baseURL": "${host}/${GPUSTACK_API}"
|
"baseURL": "${host}/${OPENAI_COMPATIBLE}"
|
||||||
});
|
});
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { GPUSTACK_API, MODEL_PROXY, OPENAI_COMPATIBLE } from '../apis';
|
import { MODEL_PROXY, OPENAI_COMPATIBLE } from '../apis';
|
||||||
import { fomatNodeJsParams, formatCurlArgs, formatPyParams } from './utils';
|
import { fomatNodeJsParams, formatCurlArgs, formatPyParams } from './utils';
|
||||||
|
|
||||||
export const generateImageCurlCode = ({
|
export const generateImageCurlCode = ({
|
||||||
@@ -10,9 +10,7 @@ export const generateImageCurlCode = ({
|
|||||||
edit = false
|
edit = false
|
||||||
}: Record<string, any>) => {
|
}: Record<string, any>) => {
|
||||||
const host = window.location.origin;
|
const host = window.location.origin;
|
||||||
const api = modelProxy
|
const api = modelProxy ? `${MODEL_PROXY}/\${YOUR_API_PATH}` : url;
|
||||||
? `${MODEL_PROXY}/\${YOUR_API_PATH}`
|
|
||||||
: url.replace(OPENAI_COMPATIBLE, GPUSTACK_API);
|
|
||||||
|
|
||||||
// ========================= Curl =========================
|
// ========================= Curl =========================
|
||||||
let curlCode = `
|
let curlCode = `
|
||||||
@@ -43,7 +41,7 @@ export const generateImageCode = ({
|
|||||||
edit = false
|
edit = false
|
||||||
}: Record<string, any>) => {
|
}: Record<string, any>) => {
|
||||||
const host = window.location.origin;
|
const host = window.location.origin;
|
||||||
const api = url.replace(OPENAI_COMPATIBLE, GPUSTACK_API);
|
const api = url;
|
||||||
|
|
||||||
// ========================= Curl =========================
|
// ========================= Curl =========================
|
||||||
let curlCode = generateImageCurlCode({
|
let curlCode = generateImageCurlCode({
|
||||||
@@ -69,7 +67,7 @@ print(response.json()['data'][0]['b64_json'])`.trim();
|
|||||||
const nodeJsCode = `
|
const nodeJsCode = `
|
||||||
const axios = require('axios');
|
const axios = require('axios');
|
||||||
|
|
||||||
const url = "${host}/${GPUSTACK_API}/images/generations";
|
const url = "${host}/${OPENAI_COMPATIBLE}/images/generations";
|
||||||
const headers = {
|
const headers = {
|
||||||
"Content-type": "application/json",
|
"Content-type": "application/json",
|
||||||
"Authorization": "Bearer $\{YOUR_GPUSTACK_API_KEY}"
|
"Authorization": "Bearer $\{YOUR_GPUSTACK_API_KEY}"
|
||||||
@@ -94,7 +92,7 @@ export const generateOpenaiImageCode = ({
|
|||||||
edit = false
|
edit = false
|
||||||
}: Record<string, any>) => {
|
}: Record<string, any>) => {
|
||||||
const host = window.location.origin;
|
const host = window.location.origin;
|
||||||
const api = url.replace(OPENAI_COMPATIBLE, GPUSTACK_API);
|
const api = url;
|
||||||
|
|
||||||
// ========================= Curl =========================
|
// ========================= Curl =========================
|
||||||
let curlCode = `
|
let curlCode = `
|
||||||
@@ -118,7 +116,7 @@ ${formatCurlArgs(_.omit(parameters, ['mask', 'image']), isFormdata)}`
|
|||||||
const pythonCode = `
|
const pythonCode = `
|
||||||
from openai import OpenAI\n
|
from openai import OpenAI\n
|
||||||
client = OpenAI(
|
client = OpenAI(
|
||||||
base_url="${host}/${GPUSTACK_API}",
|
base_url="${host}/${OPENAI_COMPATIBLE}",
|
||||||
api_key="YOUR_GPUSTACK_API_KEY"
|
api_key="YOUR_GPUSTACK_API_KEY"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -135,7 +133,7 @@ const OpenAI = require("openai");
|
|||||||
|
|
||||||
const openai = new OpenAI({
|
const openai = new OpenAI({
|
||||||
"apiKey": "YOUR_GPUSTACK_API_KEY",
|
"apiKey": "YOUR_GPUSTACK_API_KEY",
|
||||||
"baseURL": "${host}/${GPUSTACK_API}"
|
"baseURL": "${host}/${OPENAI_COMPATIBLE}"
|
||||||
});
|
});
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { GPUSTACK_API, MODEL_PROXY, OPENAI_COMPATIBLE } from '../apis';
|
import { MODEL_PROXY, OPENAI_COMPATIBLE } from '../apis';
|
||||||
import { fomatNodeJsParams, formatCurlArgs, formatPyParams } from './utils';
|
import { fomatNodeJsParams, formatCurlArgs, formatPyParams } from './utils';
|
||||||
|
|
||||||
export const generateLLmCurlCode = ({
|
export const generateLLmCurlCode = ({
|
||||||
@@ -7,9 +7,7 @@ export const generateLLmCurlCode = ({
|
|||||||
parameters
|
parameters
|
||||||
}: Record<string, any>) => {
|
}: Record<string, any>) => {
|
||||||
const host = window.location.origin;
|
const host = window.location.origin;
|
||||||
const api = modelProxy
|
const api = modelProxy ? `${MODEL_PROXY}/\${YOUR_API_PATH}` : url;
|
||||||
? `${MODEL_PROXY}/\${YOUR_API_PATH}`
|
|
||||||
: url.replace(OPENAI_COMPATIBLE, GPUSTACK_API);
|
|
||||||
|
|
||||||
// ========================= Curl =========================
|
// ========================= Curl =========================
|
||||||
const curlCode = `
|
const curlCode = `
|
||||||
@@ -26,7 +24,6 @@ export const generateLLMCode = ({
|
|||||||
parameters
|
parameters
|
||||||
}: Record<string, any>) => {
|
}: Record<string, any>) => {
|
||||||
const host = window.location.origin;
|
const host = window.location.origin;
|
||||||
const api = url.replace(OPENAI_COMPATIBLE, GPUSTACK_API);
|
|
||||||
|
|
||||||
// ========================= Curl =========================
|
// ========================= Curl =========================
|
||||||
const curlCode = generateLLmCurlCode({ api: url, parameters });
|
const curlCode = generateLLmCurlCode({ api: url, parameters });
|
||||||
@@ -35,7 +32,7 @@ export const generateLLMCode = ({
|
|||||||
const pythonCode = `
|
const pythonCode = `
|
||||||
from openai import OpenAI\n
|
from openai import OpenAI\n
|
||||||
client = OpenAI(
|
client = OpenAI(
|
||||||
base_url="${host}/${GPUSTACK_API}",
|
base_url="${host}/${OPENAI_COMPATIBLE}",
|
||||||
api_key="YOUR_GPUSTACK_API_KEY"
|
api_key="YOUR_GPUSTACK_API_KEY"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -52,7 +49,7 @@ const OpenAI = require("openai");
|
|||||||
|
|
||||||
const openai = new OpenAI({
|
const openai = new OpenAI({
|
||||||
"apiKey": "YOUR_GPUSTACK_API_KEY",
|
"apiKey": "YOUR_GPUSTACK_API_KEY",
|
||||||
"baseURL": "${host}/${GPUSTACK_API}"
|
"baseURL": "${host}/${OPENAI_COMPATIBLE}"
|
||||||
});
|
});
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import { RequestConfig, history } from '@umijs/max';
|
|||||||
import { message } from 'antd';
|
import { message } from 'antd';
|
||||||
import { DEFAULT_ENTER_PAGE } from './config/settings';
|
import { DEFAULT_ENTER_PAGE } from './config/settings';
|
||||||
|
|
||||||
// no base URL APIs
|
// no GPUSTACK BASE API
|
||||||
const NoBaseURLAPIs = ['/auth', '/v1-openai', '/version', '/proxy', '/update'];
|
const NoBaseURLAPIs = ['/auth', '/v1', '/version', '/proxy', '/update'];
|
||||||
|
|
||||||
export const requestConfig: RequestConfig = {
|
export const requestConfig: RequestConfig = {
|
||||||
errorConfig: {
|
errorConfig: {
|
||||||
|
|||||||
Reference in New Issue
Block a user