Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/young-taxis-deny.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@mixedbread/cli": minor
---

- Change max parallel upload/deletion to 200
- Change default parallel and `parallel` in config to 100
2 changes: 1 addition & 1 deletion .github/workflows/changeset-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.0.0
version: 10.15.0

- name: Setup Node.js
uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.0.0
version: 10.15.0

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.0.0
version: 10.15.0

- name: Setup Node.js
uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.0.0
version: 10.15.0

- name: Setup Node.js
uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"turbo": "^2.5.4",
"typescript": "5.8.2"
},
"packageManager": "pnpm@9.0.0",
"packageManager": "pnpm@10.15.0",
"engines": {
"node": ">=18"
}
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ mxbai vs upload "My Documents" --manifest upload-manifest.yaml
### File Management

- `mxbai vs upload <name-or-id> <patterns...>` - Upload files to vector store
- Options: `--strategy fast|high_quality`, `--contextualization`, `--metadata <json>`, `--dry-run`, `--parallel <n>` (1-20), `--unique`, `--manifest <file>`
- Options: `--strategy fast|high_quality`, `--contextualization`, `--metadata <json>`, `--dry-run`, `--parallel <n>` (1-200), `--unique`, `--manifest <file>`
- `mxbai vs files list <name-or-id>` - List files in vector store (alias: `ls`)
- Options: `--status <status>` (pending|in_progress|cancelled|completed|failed), `--limit <n>`
- `mxbai vs files get <name-or-id> <file-id>` - Get file details
Expand All @@ -83,7 +83,7 @@ mxbai vs upload "My Documents" --manifest upload-manifest.yaml
### Advanced Features

- `mxbai vs sync <name-or-id> <patterns...>` - Sync files with intelligent change detection
- Options: `--strategy <strategy>`, `--contextualization`, `--from-git <ref>`, `--dry-run`, `--yes/-y`, `--force/-f`, `--metadata <json>`, `--parallel <n>` (1-20)
- Options: `--strategy <strategy>`, `--contextualization`, `--from-git <ref>`, `--dry-run`, `--yes/-y`, `--force/-f`, `--metadata <json>`, `--parallel <n>` (1-200)

### Configuration

Expand Down Expand Up @@ -229,7 +229,7 @@ Set defaults for common options:
# Upload defaults (apply to both upload and sync commands)
mxbai config set defaults.upload.strategy high_quality # or 'fast' (default: fast)
mxbai config set defaults.upload.contextualization true # Enable context preservation (default: false)
mxbai config set defaults.upload.parallel 10 # Concurrent operations (1-20, default: 5)
mxbai config set defaults.upload.parallel 10 # Concurrent operations (1-200, default: 100)

# Search defaults
mxbai config set defaults.search.top_k 20 # Number of results (default: 10)
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"setup-cli": "node ./scripts/setup-cli.js"
},
"dependencies": {
"@mixedbread/sdk": "^0.19.0",
"@mixedbread/sdk": "^0.26.0",
"@pnpm/tabtab": "^0.5.4",
"chalk": "^5.3.0",
"cli-table3": "^0.6.5",
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/commands/vector-store/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ const SyncVectorStoreSchema = extendGlobalOptions({
.number({ message: '"parallel" must be a number' })
.int({ message: '"parallel" must be an integer' })
.min(1, { message: '"parallel" must be at least 1' })
.max(20, { message: '"parallel" must be less than or equal to 20' })
.max(200, { message: '"parallel" must be less than or equal to 200' })
.optional()
.default(5),
.default(100),
});

interface SyncOptions extends GlobalOptions {
Expand Down Expand Up @@ -81,7 +81,7 @@ export function createSyncCommand(): Command {
"Force re-upload all files, ignoring change detection"
)
.option("--metadata <json>", "Additional metadata for files")
.option("--parallel <n>", "Number of concurrent operations (1-20)")
.option("--parallel <n>", "Number of concurrent operations (1-200)")
);

command.action(
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/commands/vector-store/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const UploadVectorStoreSchema = extendGlobalOptions({
.number({ message: '"parallel" must be a number' })
.int({ message: '"parallel" must be an integer' })
.min(1, { message: '"parallel" must be at least 1' })
.max(20, { message: '"parallel" must be less than or equal to 20' })
.max(200, { message: '"parallel" must be less than or equal to 200' })
.optional(),
unique: z.boolean().optional(),
manifest: z.string().optional(),
Expand Down Expand Up @@ -69,7 +69,7 @@ export function createUploadCommand(): Command {
.option("--contextualization", "Enable context preservation")
.option("--metadata <json>", "Additional metadata as JSON string")
.option("--dry-run", "Preview what would be uploaded", false)
.option("--parallel <n>", "Number of concurrent uploads (1-20)")
.option("--parallel <n>", "Number of concurrent uploads (1-200)")
.option(
"--unique",
"Update existing files instead of creating duplicates",
Expand Down Expand Up @@ -125,7 +125,7 @@ export function createUploadCommand(): Command {
config.defaults?.upload?.contextualization ??
false;
const parallel =
parsedOptions.parallel ?? config.defaults?.upload?.parallel ?? 5;
parsedOptions.parallel ?? config.defaults?.upload?.parallel ?? 100;

const metadata = validateMetadata(parsedOptions.metadata);

Expand Down
3 changes: 2 additions & 1 deletion packages/cli/src/utils/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const UploadDefaultsSchema = z.object({
.number({ message: "Must be a number" })
.int({ message: "Must be an integer" })
.positive({ message: "Must be a positive number" })
.max(200, { message: "Must be less than or equal to 200" })
.optional(),
});

Expand Down Expand Up @@ -103,7 +104,7 @@ const DEFAULT_CONFIG: CLIConfig = {
upload: {
strategy: "fast",
contextualization: false,
parallel: 5,
parallel: 100,
},
search: {
top_k: 10,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/utils/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export async function uploadFromManifest(
await uploadFilesInBatch(client, vectorStoreIdentifier, uniqueFiles, {
unique: options.unique || false,
existingFiles,
parallel: options.parallel ?? config.defaults.upload.parallel ?? 5,
parallel: options.parallel ?? config.defaults.upload.parallel ?? 100,
});
} catch (error) {
if (error instanceof z.ZodError) {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/utils/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export async function executeSyncChanges(
parallel?: number;
}
): Promise<SyncResults> {
const parallel = options.parallel ?? 5;
const parallel = options.parallel ?? 100;
const limit = pLimit(parallel);
const totalOperations =
analysis.added.length +
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/tests/commands/config/get.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe("Config Get Command", () => {
defaults: {
upload: {
strategy: "fast",
parallel: 5,
parallel: 100,
},
api_key: "work",
},
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/tests/commands/config/set.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ describe("Config Set Command", () => {
defaults: {
upload: {
strategy: "fast",
parallel: 5,
parallel: 100,
},
},
}),
Expand All @@ -139,7 +139,7 @@ describe("Config Set Command", () => {

const config = loadConfig();
expect(config.defaults?.upload?.strategy).toBe("fast");
expect(config.defaults?.upload?.parallel).toBe(5);
expect(config.defaults?.upload?.parallel).toBe(100);
expect(config.defaults?.upload?.contextualization).toBe(true);
});
});
Expand Down
20 changes: 7 additions & 13 deletions packages/cli/tests/commands/vector-store/files.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ import {
jest,
} from "@jest/globals";
import type Mixedbread from "@mixedbread/sdk";
import type { CursorResponse } from "@mixedbread/sdk/core/pagination";
import type {
VectorStoreFile,
VectorStoreFilesCursor,
} from "@mixedbread/sdk/resources/vector-stores";
import type { VectorStoreFile } from "@mixedbread/sdk/resources/vector-stores";
import type { FileListResponse } from "@mixedbread/sdk/resources/vector-stores/files";
import type { Command } from "commander";
import { createFilesCommand } from "../../../src/commands/vector-store/files";
import * as clientUtils from "../../../src/utils/client";
Expand All @@ -38,17 +35,14 @@ const mockFormatOutput = outputUtils.formatOutput as jest.MockedFunction<
typeof outputUtils.formatOutput
>;

// Helper to create a properly typed mock cursor
// Since the Cursor class has private fields, we need to use type assertion
// but we avoid 'any' by being specific about what we're mocking
const createMockCursor = (
data: VectorStoreFile[],
pagination: CursorResponse.Pagination
): VectorStoreFilesCursor => {
pagination: FileListResponse.Pagination
): FileListResponse => {
return {
data,
pagination,
} as unknown as VectorStoreFilesCursor;
};
};

describe("Files Command", () => {
Expand Down Expand Up @@ -209,8 +203,8 @@ describe("Files Command", () => {
it("should handle empty results", async () => {
mockClient.vectorStores.files.list.mockResolvedValue(
createMockCursor([], {
first_cursor: undefined,
last_cursor: undefined,
first_cursor: null,
last_cursor: null,
has_more: false,
})
);
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/tests/commands/vector-store/upload.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,12 @@ describe("Vector Store Upload Command", () => {
"test-store",
"test.md",
"--parallel",
"25",
"201",
]);

expect(console.error).toHaveBeenCalledWith(
expect.any(String),
expect.stringContaining('"parallel" must be less than or equal to 20')
expect.stringContaining('"parallel" must be less than or equal to 200')
);
expect(process.exit).toHaveBeenCalledWith(1);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/tests/helpers/test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export function createTestConfig(overrides: Record<string, unknown> = {}) {
upload: {
strategy: "fast",
contextualization: false,
parallel: 5,
parallel: 100,
},
search: {
top_k: 10,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/tests/utils/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe("Config Utils", () => {
upload: {
strategy: "fast",
contextualization: false,
parallel: 5,
parallel: 100,
},
search: {
top_k: 10,
Expand Down
2 changes: 1 addition & 1 deletion packages/search/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"check-types": "tsc --noEmit"
},
"dependencies": {
"@mixedbread/sdk": "^0.24.0",
"@mixedbread/sdk": "^0.26.0",
"@radix-ui/react-dialog": "^1.1.14",
"@radix-ui/react-scroll-area": "^1.2.9",
"@radix-ui/react-slot": "^1.2.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/search/src/search/lib/fumadocs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export async function search(

const res = await client.vectorStores.search({
query,
vector_store_ids: [vectorStoreId],
vector_store_identifiers: [vectorStoreId],
top_k: 10,
search_options: {
return_metadata: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/search/src/search/lib/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function search(

const res = await mxbai.vectorStores.files.search({
query,
vector_store_ids: [process.env.VECTOR_STORE_ID],
vector_store_identifiers: [process.env.VECTOR_STORE_ID],
top_k: topK,
search_options: {
return_metadata: true,
Expand Down
20 changes: 7 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.