-
Notifications
You must be signed in to change notification settings - Fork 9
feat(plugin-knowledge): add configurable rate limits for high-through… #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,6 +51,40 @@ export const ModelConfigSchema = z.object({ | |
|
|
||
| // Contextual Knowledge settings | ||
| CTX_KNOWLEDGE_ENABLED: z.boolean().default(false), | ||
|
|
||
| // Rate limiting settings | ||
| // Set RATE_LIMIT_ENABLED=false to disable all rate limiting for fast uploads | ||
| // Useful when using APIs without rate limits (e.g., self-hosted models) | ||
| // High defaults optimized for Vercel gateway / high-throughput APIs | ||
| RATE_LIMIT_ENABLED: z.boolean().default(true), | ||
|
|
||
| // Maximum concurrent requests (default: 150, set higher for faster processing) | ||
| MAX_CONCURRENT_REQUESTS: z | ||
| .string() | ||
| .or(z.number()) | ||
| .optional() | ||
| .transform((val) => (val ? (typeof val === 'string' ? parseInt(val, 10) : val) : 150)), | ||
|
|
||
| // Requests per minute limit (default: 300) | ||
| REQUESTS_PER_MINUTE: z | ||
| .string() | ||
| .or(z.number()) | ||
| .optional() | ||
| .transform((val) => (val ? (typeof val === 'string' ? parseInt(val, 10) : val) : 300)), | ||
|
|
||
| // Tokens per minute limit (default: 750000) | ||
| TOKENS_PER_MINUTE: z | ||
| .string() | ||
| .or(z.number()) | ||
| .optional() | ||
| .transform((val) => (val ? (typeof val === 'string' ? parseInt(val, 10) : val) : 750000)), | ||
|
|
||
| // Delay between batches in milliseconds (default: 100, set to 0 for no delay) | ||
| BATCH_DELAY_MS: z | ||
| .string() | ||
| .or(z.number()) | ||
| .optional() | ||
| .transform((val) => (val ? (typeof val === 'string' ? parseInt(val, 10) : val) : 100)), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Schema transform incorrectly handles numeric zero for batch delayThe |
||
| }); | ||
|
|
||
| export type ModelConfig = z.infer<typeof ModelConfigSchema>; | ||
|
|
@@ -67,6 +101,10 @@ export interface ProviderRateLimits { | |
| tokensPerMinute?: number; | ||
| // Name of the provider | ||
| provider: string; | ||
| // Whether rate limiting is enabled (false = unlimited throughput) | ||
| rateLimitEnabled: boolean; | ||
| // Delay between batches in milliseconds (0 = no delay) | ||
| batchDelayMs: number; | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -160,7 +198,12 @@ export interface KnowledgeConfig { | |
| EMBEDDING_PROVIDER?: string; | ||
| TEXT_PROVIDER?: string; | ||
| TEXT_EMBEDDING_MODEL?: string; | ||
| // Add any other plugin-specific configurations | ||
| // Rate limiting configuration | ||
| RATE_LIMIT_ENABLED?: boolean; | ||
| MAX_CONCURRENT_REQUESTS?: number; | ||
| REQUESTS_PER_MINUTE?: number; | ||
| TOKENS_PER_MINUTE?: number; | ||
| BATCH_DELAY_MS?: number; | ||
| } | ||
|
|
||
| export interface LoadResult { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: elizaos-plugins/plugin-knowledge
Length of output: 775
🏁 Script executed:
Repository: elizaos-plugins/plugin-knowledge
Length of output: 58
🏁 Script executed:
Repository: elizaos-plugins/plugin-knowledge
Length of output: 58
🌐 Web query:
@elizaos/core v1.7.0 changelog breaking changes release notes💡 Result:
I can't find a published @elizaos/core v1.7.0 release or changelog. The package on npm shows latest published v1.5.7. [1] The elizaOS GitHub releases page lists up through v1.6.5 (alpha) tags but no v1.7.0 release. [2]
If you want, I can:
Sources:
[1] npm: @elizaos/core package page.
[2] GitHub: elizaOS/eliza Releases.
🏁 Script executed:
Repository: elizaos-plugins/plugin-knowledge
Length of output: 257
🏁 Script executed:
# Check git log to see if there's context about this change git log --oneline -n 20 -- package.jsonRepository: elizaos-plugins/plugin-knowledge
Length of output: 164
🌐 Web query:
@elizaos/core npm package version history latest💡 Result:
Latest published version: 1.5.8 (published ~7 hours ago). [1][2]
Sources:
@elizaos/core v1.7.0 does not exist in npm—version should be updated.
The specified version
^1.7.0is not a published release. The latest available version is v1.5.8. This will causenpm installto fail. Update the version to an available release (e.g.,^1.5.8) or confirm if v1.7.0 is a pre-release or internal version that should be used instead.🤖 Prompt for AI Agents