Skip to content

Conversation

@lingtonglu
Copy link
Contributor

  • add a token usage tracker service for all the endpoints
  • update the providers to extract the cached & reasoning tokens
  • implement the tombstone forge key / provider key deletion
  • code refactoring

* add a token usage tracker service for all the endpoints
* update the providers to extract the cached & reasoning tokens
* implement the tombstone forge key / provider key deletion
* code refactoring
def upgrade() -> None:
op.add_column('provider_keys', sa.Column('deleted_at', sa.DateTime(timezone=True), nullable=True))
op.add_column('forge_api_keys', sa.Column('deleted_at', sa.DateTime(timezone=True), nullable=True))
op.alter_column('forge_api_keys', 'key', nullable=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does "key" can be nullable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the user is trying to deleted this record. I would like to wipe out the key value to be None so there is no security issue. We only keep the id/name and the created/deleted timestamp for reference check.

Copy link
Contributor Author

@lingtonglu lingtonglu Aug 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same goes for provider keys, I would wipe out the encrypted_api_key value there. Probably base_url as well?

@lingtonglu lingtonglu merged commit f399fec into TensorBlock:main Aug 7, 2025
3 checks passed
@lingtonglu lingtonglu deleted the usage_tracker branch August 7, 2025 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants