Skip to content

Commit cc41d74

Browse files
fix(LLM O): add toFloat to query runner (PostHog#28455)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 92c68a3 commit cc41d74

File tree

5 files changed

+65
-72
lines changed

5 files changed

+65
-72
lines changed

plugin-server/src/utils/ai-costs/deepseek.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
import type { ModelRow } from './types'
22

33
export const costs: ModelRow[] = [
4+
{
5+
model: 'deepseek-r1-distill-llama-8b',
6+
cost: {
7+
prompt_token: 0.00000004,
8+
completion_token: 0.00000004,
9+
},
10+
},
411
{
512
model: 'deepseek-r1-distill-qwen-1.5b',
613
cost: {
@@ -18,8 +25,8 @@ export const costs: ModelRow[] = [
1825
{
1926
model: 'deepseek-r1-distill-qwen-14b',
2027
cost: {
21-
prompt_token: 0.0000016,
22-
completion_token: 0.0000016,
28+
prompt_token: 0.00000015,
29+
completion_token: 0.00000015,
2330
},
2431
},
2532
{
@@ -44,17 +51,17 @@ export const costs: ModelRow[] = [
4451
},
4552
},
4653
{
47-
model: 'deepseek-r1',
54+
model: 'deepseek-r1:nitro',
4855
cost: {
49-
prompt_token: 0.00000075,
50-
completion_token: 0.0000024,
56+
prompt_token: 0.000003,
57+
completion_token: 0.000008,
5158
},
5259
},
5360
{
54-
model: 'deepseek-r1:nitro',
61+
model: 'deepseek-r1',
5562
cost: {
56-
prompt_token: 0.000007,
57-
completion_token: 0.000007,
63+
prompt_token: 0.000003,
64+
completion_token: 0.000008,
5865
},
5966
},
6067
{

plugin-server/src/utils/ai-costs/google.ts

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,73 +2,66 @@ import type { ModelRow } from './types'
22

33
export const costs: ModelRow[] = [
44
{
5-
model: 'gemini-2.0-flash-thinking-exp:free',
5+
model: 'gemini-2.0-flash-001',
66
cost: {
7-
prompt_token: 0,
8-
completion_token: 0,
7+
prompt_token: 0.0000001,
8+
completion_token: 0.0000004,
99
},
1010
},
1111
{
12-
model: 'gemini-2.0-flash-thinking-exp-1219:free',
12+
model: 'gemini-2.0-flash-lite-preview-02-05:free',
1313
cost: {
1414
prompt_token: 0,
1515
completion_token: 0,
1616
},
1717
},
1818
{
19-
model: 'gemini-2.0-flash-exp:free',
19+
model: 'gemini-2.0-pro-exp-02-05:free',
2020
cost: {
2121
prompt_token: 0,
2222
completion_token: 0,
2323
},
2424
},
2525
{
26-
model: 'gemini-exp-1206:free',
26+
model: 'gemini-2.0-flash-thinking-exp:free',
2727
cost: {
2828
prompt_token: 0,
2929
completion_token: 0,
3030
},
3131
},
3232
{
33-
model: 'gemini-exp-1121:free',
33+
model: 'gemini-2.0-flash-thinking-exp-1219:free',
3434
cost: {
3535
prompt_token: 0,
3636
completion_token: 0,
3737
},
3838
},
3939
{
40-
model: 'learnlm-1.5-pro-experimental:free',
40+
model: 'gemini-2.0-flash-exp:free',
4141
cost: {
4242
prompt_token: 0,
4343
completion_token: 0,
4444
},
4545
},
4646
{
47-
model: 'gemini-exp-1114:free',
47+
model: 'gemini-exp-1206:free',
4848
cost: {
4949
prompt_token: 0,
5050
completion_token: 0,
5151
},
5252
},
5353
{
54-
model: 'gemini-flash-1.5-8b',
55-
cost: {
56-
prompt_token: 0.0000000375,
57-
completion_token: 0.00000015,
58-
},
59-
},
60-
{
61-
model: 'gemini-flash-1.5-exp:free',
54+
model: 'learnlm-1.5-pro-experimental:free',
6255
cost: {
6356
prompt_token: 0,
6457
completion_token: 0,
6558
},
6659
},
6760
{
68-
model: 'gemini-flash-1.5-exp',
61+
model: 'gemini-flash-1.5-8b',
6962
cost: {
70-
prompt_token: 0,
71-
completion_token: 0,
63+
prompt_token: 0.0000000375,
64+
completion_token: 0.00000015,
7265
},
7366
},
7467
{
@@ -78,13 +71,6 @@ export const costs: ModelRow[] = [
7871
completion_token: 0,
7972
},
8073
},
81-
{
82-
model: 'gemini-pro-1.5-exp',
83-
cost: {
84-
prompt_token: 0,
85-
completion_token: 0,
86-
},
87-
},
8874
{
8975
model: 'gemma-2-27b-it',
9076
cost: {

plugin-server/src/utils/ai-costs/meta-llama.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ export const costs: ModelRow[] = [
88
completion_token: 0.0000003,
99
},
1010
},
11+
{
12+
model: 'llama-3.3-70b-instruct:nitro',
13+
cost: {
14+
prompt_token: 0.00000059,
15+
completion_token: 0.00000079,
16+
},
17+
},
1118
{
1219
model: 'llama-3.2-3b-instruct:free',
1320
cost: {
@@ -109,8 +116,8 @@ export const costs: ModelRow[] = [
109116
{
110117
model: 'llama-3.1-8b-instruct:nitro',
111118
cost: {
112-
prompt_token: 0.00000018,
113-
completion_token: 0.00000018,
119+
prompt_token: 0.00000005,
120+
completion_token: 0.00000008,
114121
},
115122
},
116123
{
@@ -155,13 +162,6 @@ export const costs: ModelRow[] = [
155162
completion_token: 0.00000006,
156163
},
157164
},
158-
{
159-
model: 'llama-3-8b-instruct:extended',
160-
cost: {
161-
prompt_token: 0.0000001875,
162-
completion_token: 0.000001125,
163-
},
164-
},
165165
{
166166
model: 'llama-3-8b-instruct:nitro',
167167
cost: {

0 commit comments

Comments
 (0)