diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9f1556a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + install: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + - run: npm install + + lint: + runs-on: ubuntu-latest + needs: install + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + - run: npm ci + - run: npm run lint + + test: + runs-on: ubuntu-latest + needs: install + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + - run: npm ci + - run: npm test \ No newline at end of file diff --git a/.github/workflows/release-container.yml b/.github/workflows/release-container.yml new file mode 100644 index 0000000..9b2782e --- /dev/null +++ b/.github/workflows/release-container.yml @@ -0,0 +1,46 @@ +name: Release Container Image + +on: + push: + tags: + - 'v*' + +jobs: + build-and-push: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/doai-proxy + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=raw,value=latest,enable={{is_default_branch}} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/utils/model-limits.js b/utils/model-limits.js index e5a8d5f..199544d 100644 --- a/utils/model-limits.js +++ b/utils/model-limits.js @@ -109,15 +109,6 @@ export function validateTotalContext(inputTokens, maxTokens, modelId) { return null; } - if (maxTokens && maxTokens > modelInfo.max_output) { - return { - error: { - message: `max_tokens (${maxTokens}) exceeds output limit (${modelInfo.max_output}) for ${modelId}`, - type: 'invalid_request_error', - }, - }; - } - const outputTokens = maxTokens || modelInfo.max_output; const totalTokens = inputTokens + outputTokens;