Documentation
¶
Index ¶
- Constants
- type Limiter
- func (l *Limiter) Allow() bool
- func (l *Limiter) Burst() int
- func (l *Limiter) Enabled() bool
- func (l *Limiter) Limit() rate.Limit
- func (l *Limiter) Provider() string
- func (l *Limiter) SetRateLimit(requestsPerMinute int)
- func (l *Limiter) Tokens() float64
- func (l *Limiter) Wait(ctx context.Context) error
Constants ¶
View Source
const ( OpenAIRPM = 3500 // Requests per minute OpenAIBurst = 10 // Burst allowance SentinelRPM = 0 // Unlimited (OSS models) OllamaRPM = 0 // Unlimited (local) HuggingFaceRP = 0 // Unlimited (local sentence-transformers) )
OpenAI rate limits (per minute)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Limiter ¶
type Limiter struct {
// contains filtered or unexported fields
}
Limiter wraps rate.Limiter with provider-specific limits
func NewLimiter ¶
NewLimiter creates a rate limiter for the given embedding provider
func NewUnlimitedLimiter ¶
func NewUnlimitedLimiter() *Limiter
NewUnlimitedLimiter creates a limiter with no rate restrictions
func (*Limiter) SetRateLimit ¶
SetRateLimit updates the rate limit dynamically
Click to show internal directories.
Click to hide internal directories.