mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 00:36:31 +02:00
feat: implement token usage tracking for LLM calls with new accumulator and callback
This commit is contained in:
parent
917f35eb33
commit
3cfe53fb7f
6 changed files with 223 additions and 4 deletions
|
|
@ -22,10 +22,13 @@ litellm.drop_params = True
|
|||
# Memory controls: prevent unbounded internal accumulation
|
||||
litellm.telemetry = False
|
||||
litellm.cache = None
|
||||
litellm.success_callback = []
|
||||
litellm.failure_callback = []
|
||||
litellm.input_callback = []
|
||||
|
||||
from app.services.token_tracking_service import token_tracker
|
||||
|
||||
litellm.callbacks = [token_tracker]
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue