🪙 feat: Use OpenRouter Model Data for Token Cost and Context (#1703)

* feat: use openrouter data for model token cost/context

* chore: add ttl for tokenConfig and refetch models if cache expired
This commit is contained in:
Danny Avila 2024-02-02 00:42:11 -05:00 committed by GitHub
parent f1d974c513
commit 30e143e96d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 146 additions and 16 deletions

View file

@ -385,3 +385,18 @@
* @property {string} [azureOpenAIApiVersion] - The Azure OpenAI API version.
* @memberof typedefs
*/
/**
* @typedef {Object} TokenConfig
* A configuration object mapping model keys to their respective prompt, completion rates, and context limit.
* @property {number} prompt - The prompt rate
* @property {number} completion - The completion rate
* @property {number} context - The maximum context length supported by the model.
* @memberof typedefs
*/
/**
* @typedef {Record<string, TokenConfig>} EndpointTokenConfig
* An endpoint's config object mapping model keys to their respective prompt, completion rates, and context limit.
* @memberof typedefs
*/