mirror of
https://github.com/HeyPuter/puter.git
synced 2026-07-08 08:12:15 +00:00
Add serverless only filtering for togetherai chat models (#3187)
This commit is contained in:
committed by
GitHub
parent
382d2b3c14
commit
7b7604440f
@@ -21,8 +21,8 @@ import { Together } from 'together-ai';
|
||||
import { Context } from '../../../../core/context.js';
|
||||
import type { MeteringService } from '../../../../services/metering/MeteringService.js';
|
||||
import { kv } from '../../../../util/kvSingleton.js';
|
||||
import * as OpenAIUtil from '../../utils/OpenAIUtil.js';
|
||||
import { IChatModel, IChatProvider, ICompleteArguments } from '../../types.js';
|
||||
import * as OpenAIUtil from '../../utils/OpenAIUtil.js';
|
||||
|
||||
const TOGETHER_AI_CHAT_COST_MAP = {
|
||||
prompt_tokens: 'input',
|
||||
@@ -51,7 +51,9 @@ export class TogetherAIProvider implements IChatProvider {
|
||||
let models: IChatModel[] | undefined = kv.get(this.#kvKey);
|
||||
if (models) return models;
|
||||
|
||||
const apiModels = await this.#together.models.list();
|
||||
const apiModels = await this.#together.models.list({
|
||||
query: { serverless: 'true' },
|
||||
});
|
||||
models = [];
|
||||
for (const model of apiModels) {
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user