diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index f377a3a0..01c58947 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -32,10 +32,10 @@ jobs: git describe --tags > VERSION - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Log in to Docker Hub uses: docker/login-action@v2 @@ -62,8 +62,9 @@ jobs: uses: docker/build-push-action@v3 with: context: . - # platforms: linux/amd64,linux/arm64 - platforms: linux/amd64 # TODO disable arm64 for now, because it cause error + platforms: ${{ contains(github.ref, 'alpha') && 'linux/amd64' || 'linux/amd64,linux/arm64' }} push: true tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + labels: ${{ steps.meta.outputs.labels }} + build-args: | + TARGETARCH=${{ startsWith(matrix.platform, 'linux/arm64') && 'arm64' || 'amd64' }} \ No newline at end of file diff --git a/.github/workflows/linux-release.yml b/.github/workflows/linux-release.yml index 161c41e3..08639b15 100644 --- a/.github/workflows/linux-release.yml +++ b/.github/workflows/linux-release.yml @@ -7,6 +7,7 @@ on: tags: - 'v*.*.*' - '!*-alpha*' + - '!*-preview*' workflow_dispatch: inputs: name: diff --git a/.github/workflows/macos-release.yml b/.github/workflows/macos-release.yml index 94b3e47b..74d2aa0a 100644 --- a/.github/workflows/macos-release.yml +++ b/.github/workflows/macos-release.yml @@ -7,6 +7,7 @@ on: tags: - 'v*.*.*' - '!*-alpha*' + - '!*-preview*' workflow_dispatch: inputs: name: diff --git a/.github/workflows/windows-release.yml b/.github/workflows/windows-release.yml index 18641ae8..aed7bb10 100644 --- a/.github/workflows/windows-release.yml +++ b/.github/workflows/windows-release.yml @@ -7,6 +7,7 @@ on: tags: - 'v*.*.*' - '!*-alpha*' + - '!*-preview*' workflow_dispatch: inputs: name: diff --git a/Dockerfile b/Dockerfile index 10768435..fc43cde2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,23 +9,23 @@ RUN npm install --prefix /web/default & \ npm install --prefix /web/air & \ wait -RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat /web/default/VERSION) npm run build --prefix /web/default & \ - DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat /web/berry/VERSION) npm run build --prefix /web/berry & \ - DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat /web/air/VERSION) npm run build --prefix /web/air & \ +RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat ./VERSION) npm run build --prefix /web/default & \ + DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat ./VERSION) npm run build --prefix /web/berry & \ + DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat ./VERSION) npm run build --prefix /web/air & \ wait -FROM golang AS builder2 +FROM golang:alpine AS builder2 -RUN apt-get update && apt-get install -y --no-install-recommends \ - build-essential \ - sqlite3 libsqlite3-dev \ - && rm -rf /var/lib/apt/lists/* +RUN apk add --no-cache \ + gcc \ + musl-dev \ + sqlite-dev \ + build-base ENV GO111MODULE=on \ CGO_ENABLED=1 \ GOOS=linux \ - CGO_CFLAGS="-I/usr/include" \ - CGO_LDFLAGS="-L/usr/lib" + GOARCH=$TARGETARCH WORKDIR /build @@ -35,14 +35,11 @@ RUN go mod download COPY . . COPY --from=builder /web/build ./web/build -RUN go build -trimpath -ldflags "-s -w -X 'github.com/songquanpeng/one-api/common.Version=$(cat VERSION)'" -o one-api +RUN go build -trimpath -ldflags "-s -w -X 'github.com/songquanpeng/one-api/common.Version=$(cat VERSION)' -linkmode external -extldflags '-static'" -o one-api -# Final runtime image -FROM ubuntu:22.04 +FROM alpine:latest -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates tzdata bash \ - && rm -rf /var/lib/apt/lists/* +RUN apk add --no-cache ca-certificates tzdata COPY --from=builder2 /build/one-api / diff --git a/monitor/manage.go b/monitor/manage.go index 268d3924..338cd7c5 100644 --- a/monitor/manage.go +++ b/monitor/manage.go @@ -35,6 +35,8 @@ func ShouldDisableChannel(err *model.Error, statusCode int) bool { strings.Contains(lowerMessage, "balance") || strings.Contains(lowerMessage, "permission denied") || strings.Contains(lowerMessage, "organization has been restricted") || // groq + strings.Contains(lowerMessage, "api key not valid") || // gemini + strings.Contains(lowerMessage, "api key expired") || // gemini strings.Contains(lowerMessage, "已欠费") { return true } diff --git a/relay/adaptor/deepseek/constants.go b/relay/adaptor/deepseek/constants.go index ad840bc2..dc1a512a 100644 --- a/relay/adaptor/deepseek/constants.go +++ b/relay/adaptor/deepseek/constants.go @@ -2,5 +2,5 @@ package deepseek var ModelList = []string{ "deepseek-chat", - "deepseek-coder", + "deepseek-reasoner", } diff --git a/relay/adaptor/groq/constants.go b/relay/adaptor/groq/constants.go index 4d178c8e..2a26b28b 100644 --- a/relay/adaptor/groq/constants.go +++ b/relay/adaptor/groq/constants.go @@ -3,7 +3,6 @@ package groq // https://console.groq.com/docs/models var ModelList = []string{ - "gemma-7b-it", "gemma2-9b-it", "llama-3.1-70b-versatile", "llama-3.1-8b-instant", @@ -23,4 +22,6 @@ var ModelList = []string{ "distil-whisper-large-v3-en", "whisper-large-v3", "whisper-large-v3-turbo", + "deepseek-r1-distill-llama-70b-specdec", + "deepseek-r1-distill-llama-70b", } diff --git a/web/air/src/constants/channel.constants.js b/web/air/src/constants/channel.constants.js index e7b25399..68ca987a 100644 --- a/web/air/src/constants/channel.constants.js +++ b/web/air/src/constants/channel.constants.js @@ -7,7 +7,7 @@ export const CHANNEL_OPTIONS = [ { key: 24, text: 'Google Gemini', value: 24, color: 'orange' }, { key: 28, text: 'Mistral AI', value: 28, color: 'orange' }, { key: 41, text: 'Novita', value: 41, color: 'purple' }, - { key: 40, text: '字节跳动豆包', value: 40, color: 'blue' }, + {key: 40, text: '火山引擎', value: 40, color: 'blue'}, { key: 15, text: '百度文心千帆', value: 15, color: 'blue' }, { key: 17, text: '阿里通义千问', value: 17, color: 'orange' }, { key: 18, text: '讯飞星火认知', value: 18, color: 'blue' }, diff --git a/web/berry/src/constants/ChannelConstants.js b/web/berry/src/constants/ChannelConstants.js index 375adcd9..4c188d87 100644 --- a/web/berry/src/constants/ChannelConstants.js +++ b/web/berry/src/constants/ChannelConstants.js @@ -49,7 +49,7 @@ export const CHANNEL_OPTIONS = { }, 40: { key: 40, - text: '字节跳动豆包', + text: '火山引擎', value: 40, color: 'primary' }, diff --git a/web/default/src/constants/channel.constants.js b/web/default/src/constants/channel.constants.js index 61425508..8a0c977b 100644 --- a/web/default/src/constants/channel.constants.js +++ b/web/default/src/constants/channel.constants.js @@ -7,7 +7,7 @@ export const CHANNEL_OPTIONS = [ { key: 24, text: 'Google Gemini', value: 24, color: 'orange' }, { key: 28, text: 'Mistral AI', value: 28, color: 'orange' }, { key: 41, text: 'Novita', value: 41, color: 'purple' }, - { key: 40, text: '字节跳动豆包', value: 40, color: 'blue' }, + {key: 40, text: '火山引擎', value: 40, color: 'blue'}, { key: 15, text: '百度文心千帆', value: 15, color: 'blue' }, { key: 17, text: '阿里通义千问', value: 17, color: 'orange' }, { key: 18, text: '讯飞星火认知', value: 18, color: 'blue' }, diff --git a/web/default/src/pages/Dashboard/index.js b/web/default/src/pages/Dashboard/index.js index fd6a235b..21151519 100644 --- a/web/default/src/pages/Dashboard/index.js +++ b/web/default/src/pages/Dashboard/index.js @@ -1,6 +1,6 @@ -import React, {useEffect, useState} from 'react'; -import {useTranslation} from 'react-i18next'; -import {Card, Grid} from 'semantic-ui-react'; +import React, { useEffect, useState } from 'react'; +import { useTranslation } from 'react-i18next'; +import { Card, Grid } from 'semantic-ui-react'; import { Bar, BarChart, @@ -242,7 +242,7 @@ const Dashboard = () => { {t('dashboard.charts.requests.title')} - {/* {summaryData.todayRequests} */} + {/* {summaryData.todayRequests} */}
{ t('dashboard.charts.requests.tooltip'), ]} labelFormatter={(label) => - `${t('dashboard.statistics.tooltip.date')}: ${formatDate(label)}` + `${t( + 'dashboard.statistics.tooltip.date' + )}: ${formatDate(label)}` } /> { {t('dashboard.charts.quota.title')} - {/* + {/* ${summaryData.todayQuota.toFixed(3)} */} @@ -321,11 +323,13 @@ const Dashboard = () => { boxShadow: '0 2px 8px rgba(0,0,0,0.1)', }} formatter={(value) => [ - value, + value.toFixed(6), t('dashboard.charts.quota.tooltip'), ]} labelFormatter={(label) => - `${t('dashboard.statistics.tooltip.date')}: ${formatDate(label)}` + `${t( + 'dashboard.statistics.tooltip.date' + )}: ${formatDate(label)}` } /> { {t('dashboard.charts.tokens.title')} - {/* {summaryData.todayTokens} */} + {/* {summaryData.todayTokens} */}
{ t('dashboard.charts.tokens.tooltip'), ]} labelFormatter={(label) => - `${t('dashboard.statistics.tooltip.date')}: ${formatDate(label)}` + `${t( + 'dashboard.statistics.tooltip.date' + )}: ${formatDate(label)}` } /> { boxShadow: '0 2px 8px rgba(0,0,0,0.1)', }} labelFormatter={(label) => - `${t('dashboard.statistics.tooltip.date')}: ${formatDate(label)}` + `${t('dashboard.statistics.tooltip.date')}: ${formatDate( + label + )}` } />