@openagentsy/footprint 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/README.md +34 -2
- package/dist/constants.d.ts +27 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +29 -0
- package/dist/constants.js.map +1 -0
- package/dist/estimate.d.ts +54 -0
- package/dist/estimate.d.ts.map +1 -0
- package/dist/estimate.js +114 -0
- package/dist/estimate.js.map +1 -0
- package/dist/estimate.test.d.ts +2 -0
- package/dist/estimate.test.d.ts.map +1 -0
- package/dist/estimate.test.js +136 -0
- package/dist/estimate.test.js.map +1 -0
- package/dist/golden.test.d.ts +2 -0
- package/dist/golden.test.d.ts.map +1 -0
- package/dist/golden.test.js +55 -0
- package/dist/golden.test.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/prefill.test.d.ts +2 -0
- package/dist/prefill.test.d.ts.map +1 -0
- package/dist/prefill.test.js +76 -0
- package/dist/prefill.test.js.map +1 -0
- package/dist/resolve.d.ts +56 -0
- package/dist/resolve.d.ts.map +1 -0
- package/dist/resolve.js +114 -0
- package/dist/resolve.js.map +1 -0
- package/dist/resolve.test.d.ts +2 -0
- package/dist/resolve.test.d.ts.map +1 -0
- package/dist/resolve.test.js +106 -0
- package/dist/resolve.test.js.map +1 -0
- package/dist/types.d.ts +86 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +12 -0
- package/dist/types.js.map +1 -0
- package/package.json +44 -4
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type ModelArch, type Range, type SiteProfile } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Everything the estimator needs to know, injected.
|
|
4
|
+
*
|
|
5
|
+
* Nothing is loaded from a file: the model map, the grid factors and the
|
|
6
|
+
* provider sites all come from the caller, because the data behind them has
|
|
7
|
+
* licenses this package cannot ship.
|
|
8
|
+
*/
|
|
9
|
+
export interface Registry {
|
|
10
|
+
/** The model map, keyed by the normalised model id. */
|
|
11
|
+
ecologitsModels: Map<string, ModelArch>;
|
|
12
|
+
/** The user's own numbers, keyed by `provider/modelId` or by `modelId`. */
|
|
13
|
+
overrides: Map<string, ModelArch>;
|
|
14
|
+
/** The provider sites, keyed by provider. */
|
|
15
|
+
providerSites: Map<string, SiteProfile>;
|
|
16
|
+
/** Kilograms of CO2 per kWh, by region. */
|
|
17
|
+
grid: Map<string, Range>;
|
|
18
|
+
/** Litres per kWh of embedded water, by region. */
|
|
19
|
+
offsiteWue: Map<string, Range>;
|
|
20
|
+
}
|
|
21
|
+
/** The region key that means "the world, when nobody says". */
|
|
22
|
+
export declare const WORLD_REGION = "WORLD";
|
|
23
|
+
/** What a provider discloses about its own infrastructure. */
|
|
24
|
+
export interface ProviderDefaults {
|
|
25
|
+
pue: Range;
|
|
26
|
+
wueOnSite: Range;
|
|
27
|
+
source: string;
|
|
28
|
+
disclosed: boolean;
|
|
29
|
+
}
|
|
30
|
+
/** What a provider discloses about its own infrastructure. */
|
|
31
|
+
export declare function providerDefaults(provider: string): ProviderDefaults;
|
|
32
|
+
/**
|
|
33
|
+
* The model id in the form the model map is keyed by.
|
|
34
|
+
*
|
|
35
|
+
* A model id may carry its provider (`ollama/qwen3:8b`) and it may be
|
|
36
|
+
* written in any case, so the key is the name alone, in lower case.
|
|
37
|
+
*/
|
|
38
|
+
export declare function normalizeModelId(modelId: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* What is known about a model.
|
|
41
|
+
*
|
|
42
|
+
* A user's own number wins over the model map, because the person writing
|
|
43
|
+
* it knows more than any table. A model nobody describes gets a very wide
|
|
44
|
+
* range, so the answer says "model size unknown" instead of pretending.
|
|
45
|
+
*/
|
|
46
|
+
export declare function resolveArch(reg: Registry, provider: string, modelId: string): ModelArch;
|
|
47
|
+
/**
|
|
48
|
+
* The site of a provider in a region.
|
|
49
|
+
*
|
|
50
|
+
* The provider's own PUE and cooling water come from the table, or from the
|
|
51
|
+
* registry when the caller knows better. The grid's carbon and water come
|
|
52
|
+
* from the registry, which is injected, and a region nobody has a number
|
|
53
|
+
* for falls back to the world.
|
|
54
|
+
*/
|
|
55
|
+
export declare function resolveSite(reg: Registry, provider: string, region: string): SiteProfile;
|
|
56
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,KAAK,EAAK,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAE7E;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACvB,uDAAuD;IACvD,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACxC,2EAA2E;IAC3E,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAClC,6CAA6C;IAC7C,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACxC,2CAA2C;IAC3C,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACzB,mDAAmD;IACnD,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;CAChC;AAED,+DAA+D;AAC/D,eAAO,MAAM,YAAY,UAAU,CAAC;AAEpC,8DAA8D;AAC9D,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,KAAK,CAAC;IACX,SAAS,EAAE,KAAK,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;CACpB;AAuDD,8DAA8D;AAC9D,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,CAGnE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAIxD;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,CAUvF;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,CAyBxF"}
|
package/dist/resolve.js
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { r } from './types.js';
|
|
2
|
+
/** The region key that means "the world, when nobody says". */
|
|
3
|
+
export const WORLD_REGION = 'WORLD';
|
|
4
|
+
/**
|
|
5
|
+
* The provider table of the EcoLogits methodology.
|
|
6
|
+
*
|
|
7
|
+
* The numbers are the ones EcoLogits uses for these providers. A provider
|
|
8
|
+
* that is not in the table gets the widest range in it, marked as not
|
|
9
|
+
* disclosed, because guessing a narrow one would be a lie.
|
|
10
|
+
*/
|
|
11
|
+
const PROVIDER_TABLE = {
|
|
12
|
+
anthropic: {
|
|
13
|
+
pue: r(1.09, 1.14),
|
|
14
|
+
wueOnSite: r(0.13, 0.999),
|
|
15
|
+
source: 'ecologits:anthropic',
|
|
16
|
+
disclosed: true,
|
|
17
|
+
},
|
|
18
|
+
google: {
|
|
19
|
+
pue: r(1.09),
|
|
20
|
+
wueOnSite: r(0.999),
|
|
21
|
+
source: 'ecologits:google',
|
|
22
|
+
disclosed: true,
|
|
23
|
+
},
|
|
24
|
+
mistral: {
|
|
25
|
+
pue: r(1.16),
|
|
26
|
+
wueOnSite: r(0.09),
|
|
27
|
+
source: 'ecologits:mistral',
|
|
28
|
+
disclosed: true,
|
|
29
|
+
},
|
|
30
|
+
openai: {
|
|
31
|
+
pue: r(1.2),
|
|
32
|
+
wueOnSite: r(0.569),
|
|
33
|
+
source: 'ecologits:openai',
|
|
34
|
+
disclosed: true,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
/** The names EcoLogits itself uses, which are not the names in the table. */
|
|
38
|
+
const PROVIDER_ALIASES = {
|
|
39
|
+
google_genai: 'google',
|
|
40
|
+
mistralai: 'mistral',
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* The widest PUE range in the table, with the widest WUE range.
|
|
44
|
+
*
|
|
45
|
+
* A provider that discloses nothing gets these, and they are marked as not
|
|
46
|
+
* disclosed so the UI can say so.
|
|
47
|
+
*/
|
|
48
|
+
const UNDISCLOSED = {
|
|
49
|
+
pue: r(1.09, 1.14),
|
|
50
|
+
wueOnSite: r(0.13, 0.999),
|
|
51
|
+
source: 'world-default',
|
|
52
|
+
disclosed: false,
|
|
53
|
+
};
|
|
54
|
+
/** What a provider discloses about its own infrastructure. */
|
|
55
|
+
export function providerDefaults(provider) {
|
|
56
|
+
const key = PROVIDER_ALIASES[provider] ?? provider;
|
|
57
|
+
return PROVIDER_TABLE[key] ?? UNDISCLOSED;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The model id in the form the model map is keyed by.
|
|
61
|
+
*
|
|
62
|
+
* A model id may carry its provider (`ollama/qwen3:8b`) and it may be
|
|
63
|
+
* written in any case, so the key is the name alone, in lower case.
|
|
64
|
+
*/
|
|
65
|
+
export function normalizeModelId(modelId) {
|
|
66
|
+
const trimmed = modelId.trim().toLowerCase();
|
|
67
|
+
const slash = trimmed.indexOf('/');
|
|
68
|
+
return slash === -1 ? trimmed : trimmed.slice(slash + 1);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* What is known about a model.
|
|
72
|
+
*
|
|
73
|
+
* A user's own number wins over the model map, because the person writing
|
|
74
|
+
* it knows more than any table. A model nobody describes gets a very wide
|
|
75
|
+
* range, so the answer says "model size unknown" instead of pretending.
|
|
76
|
+
*/
|
|
77
|
+
export function resolveArch(reg, provider, modelId) {
|
|
78
|
+
return (reg.overrides.get(`${provider}/${modelId}`) ??
|
|
79
|
+
reg.overrides.get(modelId) ??
|
|
80
|
+
reg.ecologitsModels.get(normalizeModelId(modelId)) ?? {
|
|
81
|
+
totalParamsB: r(10, 2000),
|
|
82
|
+
activeParamsB: r(1, 600),
|
|
83
|
+
source: 'unknown',
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The site of a provider in a region.
|
|
88
|
+
*
|
|
89
|
+
* The provider's own PUE and cooling water come from the table, or from the
|
|
90
|
+
* registry when the caller knows better. The grid's carbon and water come
|
|
91
|
+
* from the registry, which is injected, and a region nobody has a number
|
|
92
|
+
* for falls back to the world.
|
|
93
|
+
*/
|
|
94
|
+
export function resolveSite(reg, provider, region) {
|
|
95
|
+
const injected = reg.providerSites.get(provider);
|
|
96
|
+
const site = injected ?? providerDefaults(provider);
|
|
97
|
+
const grid = reg.grid.get(region) ?? reg.grid.get(WORLD_REGION);
|
|
98
|
+
if (!grid) {
|
|
99
|
+
throw new Error(`no grid carbon factor for "${region}" and no "${WORLD_REGION}" in the registry`);
|
|
100
|
+
}
|
|
101
|
+
const offsite = reg.offsiteWue.get(region) ?? reg.offsiteWue.get(WORLD_REGION);
|
|
102
|
+
if (!offsite) {
|
|
103
|
+
throw new Error(`no off-site water factor for "${region}" and no "${WORLD_REGION}" in the registry`);
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
pue: site.pue,
|
|
107
|
+
wueOnSite: site.wueOnSite,
|
|
108
|
+
wueOffSite: offsite,
|
|
109
|
+
gridKgCo2PerKWh: grid,
|
|
110
|
+
source: site.source,
|
|
111
|
+
disclosed: site.disclosed,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=resolve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,CAAC,EAAoB,MAAM,YAAY,CAAC;AAsB7E,+DAA+D;AAC/D,MAAM,CAAC,MAAM,YAAY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K,CACb,8BAA8B,MAAM,aAAa,YAAY,mBAAmB,CACjF,CAAC;IACJ,CAAC;IACD,MAAM,OAAO,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC/E,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,iCAAiC,MAAM,aAAa,YAAY,mBAAmB,CACpF,CAAC;IACJ,CAAC;IAED,OAAO;QACL,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,UAAU,EAAE,OAAO;QACnB,eAAe,EAAE,IAAI;QACrB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,SAAS,EAAE,IAAI,CAAC,SAAS;KAC1B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.test.d.ts","sourceRoot":"","sources":["../src/resolve.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { normalizeModelId, providerDefaults, resolveArch, resolveSite, } from './resolve.js';
|
|
3
|
+
import { r } from './types.js';
|
|
4
|
+
const ARCH = {
|
|
5
|
+
totalParamsB: r(70),
|
|
6
|
+
activeParamsB: r(70),
|
|
7
|
+
source: 'user',
|
|
8
|
+
};
|
|
9
|
+
function registry(overrides = {}) {
|
|
10
|
+
return {
|
|
11
|
+
ecologitsModels: new Map(),
|
|
12
|
+
overrides: new Map(),
|
|
13
|
+
providerSites: new Map(),
|
|
14
|
+
grid: new Map(),
|
|
15
|
+
offsiteWue: new Map(),
|
|
16
|
+
...overrides,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
describe('the provider table', () => {
|
|
20
|
+
it('keeps the numbers the methodology publishes', () => {
|
|
21
|
+
expect(providerDefaults('anthropic')).toMatchObject({
|
|
22
|
+
pue: [1.09, 1.14],
|
|
23
|
+
wueOnSite: [0.13, 0.999],
|
|
24
|
+
disclosed: true,
|
|
25
|
+
});
|
|
26
|
+
expect(providerDefaults('google')).toMatchObject({
|
|
27
|
+
pue: [1.09, 1.09],
|
|
28
|
+
wueOnSite: [0.999, 0.999],
|
|
29
|
+
});
|
|
30
|
+
expect(providerDefaults('mistral')).toMatchObject({
|
|
31
|
+
pue: [1.16, 1.16],
|
|
32
|
+
wueOnSite: [0.09, 0.09],
|
|
33
|
+
});
|
|
34
|
+
expect(providerDefaults('openai')).toMatchObject({
|
|
35
|
+
pue: [1.2, 1.2],
|
|
36
|
+
wueOnSite: [0.569, 0.569],
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
it('knows the names the methodology uses', () => {
|
|
40
|
+
expect(providerDefaults('google_genai')).toEqual(providerDefaults('google'));
|
|
41
|
+
expect(providerDefaults('mistralai')).toEqual(providerDefaults('mistral'));
|
|
42
|
+
});
|
|
43
|
+
it('gives an unknown provider the widest range, marked as undisclosed', () => {
|
|
44
|
+
const unknown = providerDefaults('ollama-cloud');
|
|
45
|
+
expect(unknown.pue).toEqual([1.09, 1.14]);
|
|
46
|
+
expect(unknown.wueOnSite).toEqual([0.13, 0.999]);
|
|
47
|
+
expect(unknown.disclosed).toBe(false);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
describe('the model id', () => {
|
|
51
|
+
it('drops the provider and the case', () => {
|
|
52
|
+
expect(normalizeModelId('Ollama/Qwen3:8B')).toBe('qwen3:8b');
|
|
53
|
+
expect(normalizeModelId(' gpt-4o-mini ')).toBe('gpt-4o-mini');
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
describe('the architecture of a model', () => {
|
|
57
|
+
it('prefers the number the user wrote for that provider', () => {
|
|
58
|
+
const reg = registry({
|
|
59
|
+
overrides: new Map([
|
|
60
|
+
['openai/gpt-4o-mini', ARCH],
|
|
61
|
+
['gpt-4o-mini', { ...ARCH, totalParamsB: r(1) }],
|
|
62
|
+
]),
|
|
63
|
+
});
|
|
64
|
+
expect(resolveArch(reg, 'openai', 'gpt-4o-mini')).toEqual(ARCH);
|
|
65
|
+
});
|
|
66
|
+
it('falls back to the number the user wrote for any provider', () => {
|
|
67
|
+
const reg = registry({ overrides: new Map([['gpt-4o-mini', ARCH]]) });
|
|
68
|
+
expect(resolveArch(reg, 'azure', 'gpt-4o-mini')).toEqual(ARCH);
|
|
69
|
+
});
|
|
70
|
+
it('then takes the model map, under the normalised name', () => {
|
|
71
|
+
const reg = registry({ ecologitsModels: new Map([['gpt-4o-mini', ARCH]]) });
|
|
72
|
+
expect(resolveArch(reg, 'openai', 'GPT-4o-Mini')).toEqual(ARCH);
|
|
73
|
+
});
|
|
74
|
+
it('and says the model size is unknown when nobody knows it', () => {
|
|
75
|
+
const unknown = resolveArch(registry(), 'openai', 'mystery-model');
|
|
76
|
+
expect(unknown.source).toBe('unknown');
|
|
77
|
+
expect(unknown.totalParamsB[0]).toBe(10);
|
|
78
|
+
expect(unknown.totalParamsB[1]).toBe(2000);
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
describe('the site of a provider', () => {
|
|
82
|
+
it('joins the provider numbers with the grid numbers', () => {
|
|
83
|
+
const reg = registry({
|
|
84
|
+
grid: new Map([['US', r(0.4)]]),
|
|
85
|
+
offsiteWue: new Map([['US', r(1.6)]]),
|
|
86
|
+
});
|
|
87
|
+
const site = resolveSite(reg, 'openai', 'US');
|
|
88
|
+
expect(site.pue).toEqual([1.2, 1.2]);
|
|
89
|
+
expect(site.wueOnSite).toEqual([0.569, 0.569]);
|
|
90
|
+
expect(site.gridKgCo2PerKWh).toEqual([0.4, 0.4]);
|
|
91
|
+
expect(site.wueOffSite).toEqual([1.6, 1.6]);
|
|
92
|
+
});
|
|
93
|
+
it('falls back to the world when the region is unknown', () => {
|
|
94
|
+
const reg = registry({
|
|
95
|
+
grid: new Map([['WORLD', r(0.5)]]),
|
|
96
|
+
offsiteWue: new Map([['WORLD', r(2)]]),
|
|
97
|
+
});
|
|
98
|
+
const site = resolveSite(reg, 'openai', 'FR');
|
|
99
|
+
expect(site.gridKgCo2PerKWh).toEqual([0.5, 0.5]);
|
|
100
|
+
expect(site.wueOffSite).toEqual([2, 2]);
|
|
101
|
+
});
|
|
102
|
+
it('says what is missing instead of guessing a grid', () => {
|
|
103
|
+
expect(() => resolveSite(registry(), 'openai', 'US')).toThrow(/grid carbon factor/);
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
//# sourceMappingURL=resolve.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.test.js","sourceRoot":"","sources":["../src/resolve.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAEhB,WAAW,EACX,WAAW,GACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAAkB,CAAC,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,IAAI,GAAc;IACtB,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC;IACnB,aAAa,EAAE,CAAC,CAAC,EAAE,CAAC;IACpB,MAAM,EAAE,MAAM;CACf,CAAC;AAEF,SAAS,QAAQ,CAAC,YAA+B,EAAE;IACjD,OAAO;QACL,eAAe,EAAE,IAAI,GAAG,EAAE;QAC1B,SAAS,EAAE,IAAI,GAAG,EAAE;QACpB,aAAa,EAAE,IAAI,GAAG,EAAE;QACxB,IAAI,EAAE,IAAI,GAAG,EAAE;QACf,UAAU,EAAE,IAAI,GAAG,EAAE;QACrB,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;QACrD,MAAM,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC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AAC,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACtF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A quantity nobody knows exactly, so it carries its bounds.
|
|
3
|
+
*
|
|
4
|
+
* Every number this package produces is an interval, because the inputs are
|
|
5
|
+
* intervals: a model size nobody discloses, a data centre's PUE, a grid's
|
|
6
|
+
* carbon factor. A point estimate would hide that, so the type makes the
|
|
7
|
+
* width impossible to lose.
|
|
8
|
+
*/
|
|
9
|
+
export type Range = readonly [lo: number, hi: number];
|
|
10
|
+
/** An interval, with the ends in order. */
|
|
11
|
+
export declare const r: (lo: number, hi?: number) => Range;
|
|
12
|
+
/** The sum of two intervals. */
|
|
13
|
+
export declare const add: (a: Range, b: Range) => Range;
|
|
14
|
+
/** The product of two intervals: the four corners, then the two ends. */
|
|
15
|
+
export declare const mul: (a: Range, b: Range) => Range;
|
|
16
|
+
/** An interval scaled by a number. */
|
|
17
|
+
export declare const scale: (a: Range, k: number) => Range;
|
|
18
|
+
export interface ModelArch {
|
|
19
|
+
/** Billions of parameters in total. */
|
|
20
|
+
totalParamsB: Range;
|
|
21
|
+
/**
|
|
22
|
+
* Billions of parameters that take part in one token's forward pass.
|
|
23
|
+
* Equal to the total for a dense model; EcoLogits assumes 10-30 percent
|
|
24
|
+
* activation for a mixture of experts when nobody says.
|
|
25
|
+
*/
|
|
26
|
+
activeParamsB: Range;
|
|
27
|
+
source: 'ecologits' | 'model-card' | 'user' | 'unknown';
|
|
28
|
+
}
|
|
29
|
+
export interface SiteProfile {
|
|
30
|
+
/** Power Usage Effectiveness: the overhead of the data centre. */
|
|
31
|
+
pue: Range;
|
|
32
|
+
/** Litres per kWh, for the cooling inside the data centre. */
|
|
33
|
+
wueOnSite: Range;
|
|
34
|
+
/** Litres per kWh, for the water embedded in the grid electricity. */
|
|
35
|
+
wueOffSite: Range;
|
|
36
|
+
/** Kilograms of CO2 per kWh. */
|
|
37
|
+
gridKgCo2PerKWh: Range;
|
|
38
|
+
/** Where the numbers came from, e.g. "ecologits:anthropic" or "owid:US". */
|
|
39
|
+
source: string;
|
|
40
|
+
/** False when the provider does not disclose its infrastructure. */
|
|
41
|
+
disclosed: boolean;
|
|
42
|
+
}
|
|
43
|
+
export interface Usage {
|
|
44
|
+
/** Generated tokens. Reasoning tokens count once, not twice. */
|
|
45
|
+
outputTokens: number;
|
|
46
|
+
/** Fresh input tokens. */
|
|
47
|
+
inputTokens: number;
|
|
48
|
+
/** Input tokens read from the cache. */
|
|
49
|
+
cacheReadTokens: number;
|
|
50
|
+
/** Input tokens written to the cache. */
|
|
51
|
+
cacheWriteTokens: number;
|
|
52
|
+
/** The measured request time, when it is known. */
|
|
53
|
+
latencyS?: number;
|
|
54
|
+
}
|
|
55
|
+
export interface Impact {
|
|
56
|
+
energyWh: Range;
|
|
57
|
+
waterL: Range;
|
|
58
|
+
co2Kg: Range;
|
|
59
|
+
warmingC: Range;
|
|
60
|
+
dominantUncertainty: 'model-size' | 'site' | 'grid' | 'tcre';
|
|
61
|
+
notes: string[];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The coefficients of the prefill term.
|
|
65
|
+
*
|
|
66
|
+
* The fit is not shipped: the numbers come from ML.ENERGY measurements that
|
|
67
|
+
* a person has to review first, so a caller that wants the term brings its
|
|
68
|
+
* own coefficients. The unit is Wh per token per billion active parameters,
|
|
69
|
+
* and a coefficient is an interval like every other number in this package:
|
|
70
|
+
* the fit in `data/prefill-fit.json` carries a range, because the models
|
|
71
|
+
* that were measured differ from each other.
|
|
72
|
+
*/
|
|
73
|
+
export interface PrefillCoeff {
|
|
74
|
+
/** The fresh input: Wh per input token per billion active parameters. */
|
|
75
|
+
kIn: Range;
|
|
76
|
+
/** The cache read: Wh per cache-read token per billion active parameters. */
|
|
77
|
+
kCache: Range;
|
|
78
|
+
}
|
|
79
|
+
/** How fast the provider generates, when the numbers are known. */
|
|
80
|
+
export interface Throughput {
|
|
81
|
+
/** Time to the first token, in seconds. */
|
|
82
|
+
ttftS: Range;
|
|
83
|
+
/** Tokens per second. */
|
|
84
|
+
tps: Range;
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,KAAK,GAAG,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;AAEtD,2CAA2C;AAC3C,eAAO,MAAM,CAAC,GAAI,IAAI,MAAM,EAAE,WAAO,KAAG,KAA6C,CAAC;AAEtF,gCAAgC;AAChC,eAAO,MAAM,GAAG,GAAI,GAAG,KAAK,EAAE,GAAG,KAAK,KAAG,KAAmC,CAAC;AAE7E,yEAAyE;AACzE,eAAO,MAAM,GAAG,GAAI,GAAG,KAAK,EAAE,GAAG,KAAK,KAAG,KAGxC,CAAC;AAEF,sCAAsC;AACtC,eAAO,MAAM,KAAK,GAAI,GAAG,KAAK,EAAE,GAAG,MAAM,KAAG,KAA8B,CAAC;AAE3E,MAAM,WAAW,SAAS;IACxB,uCAAuC;IACvC,YAAY,EAAE,KAAK,CAAC;IACpB;;;;OAIG;IACH,aAAa,EAAE,KAAK,CAAC;IACrB,MAAM,EAAE,WAAW,GAAG,YAAY,GAAG,MAAM,GAAG,SAAS,CAAC;CACzD;AAED,MAAM,WAAW,WAAW;IAC1B,kEAAkE;IAClE,GAAG,EAAE,KAAK,CAAC;IACX,8DAA8D;IAC9D,SAAS,EAAE,KAAK,CAAC;IACjB,sEAAsE;IACtE,UAAU,EAAE,KAAK,CAAC;IAClB,gCAAgC;IAChC,eAAe,EAAE,KAAK,CAAC;IACvB,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,KAAK;IACpB,gEAAgE;IAChE,YAAY,EAAE,MAAM,CAAC;IACrB,0BAA0B;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,wCAAwC;IACxC,eAAe,EAAE,MAAM,CAAC;IACxB,yCAAyC;IACzC,gBAAgB,EAAE,MAAM,CAAC;IACzB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,MAAM;IACrB,QAAQ,EAAE,KAAK,CAAC;IAChB,MAAM,EAAE,KAAK,CAAC;IACd,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC;IAChB,mBAAmB,EAAE,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAC7D,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,YAAY;IAC3B,yEAAyE;IACzE,GAAG,EAAE,KAAK,CAAC;IACX,6EAA6E;IAC7E,MAAM,EAAE,KAAK,CAAC;CACf;AAED,mEAAmE;AACnE,MAAM,WAAW,UAAU;IACzB,2CAA2C;IAC3C,KAAK,EAAE,KAAK,CAAC;IACb,yBAAyB;IACzB,GAAG,EAAE,KAAK,CAAC;CACZ"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** An interval, with the ends in order. */
|
|
2
|
+
export const r = (lo, hi = lo) => [Math.min(lo, hi), Math.max(lo, hi)];
|
|
3
|
+
/** The sum of two intervals. */
|
|
4
|
+
export const add = (a, b) => [a[0] + b[0], a[1] + b[1]];
|
|
5
|
+
/** The product of two intervals: the four corners, then the two ends. */
|
|
6
|
+
export const mul = (a, b) => {
|
|
7
|
+
const products = [a[0] * b[0], a[0] * b[1], a[1] * b[0], a[1] * b[1]];
|
|
8
|
+
return [Math.min(...products), Math.max(...products)];
|
|
9
|
+
};
|
|
10
|
+
/** An interval scaled by a number. */
|
|
11
|
+
export const scale = (a, k) => r(a[0] * k, a[1] * k);
|
|
12
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAUA,2CAA2C;AAC3C,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,EAAU,EAAE,EAAE,GAAG,EAAE,EAAS,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;AAEtF,gCAAgC;AAChC,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,CAAQ,EAAE,CAAQ,EAAS,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE7E,yEAAyE;AACzE,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,CAAQ,EAAE,CAAQ,EAAS,EAAE;IAC/C,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACtE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;AACxD,CAAC,CAAC;AAEF,sCAAsC;AACtC,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,CAAQ,EAAE,CAAS,EAAS,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openagentsy/footprint",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"author": "Grand Slopulissimo <slopulissimo@voxslopuli.org>",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc -b tsconfig.json",
|
|
13
|
+
"typecheck": "tsc -b tsconfig.json",
|
|
14
|
+
"fit:prefill": "node scripts/fit-prefill.mjs"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/node": "^24.3.0",
|
|
18
|
+
"typescript": "^5.9.2"
|
|
19
|
+
},
|
|
20
|
+
"license": "GPL-3.0-or-later",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/voxslopuli/openagentsy.git"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://github.com/voxslopuli/openagentsy#readme",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/voxslopuli/openagentsy/issues"
|
|
28
|
+
},
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=22.5.0"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"description": "The OpenAgentsy footprint estimator: the energy, water and carbon of an inference, as ranges.",
|
|
36
|
+
"keywords": [
|
|
37
|
+
"agents",
|
|
38
|
+
"opencode",
|
|
39
|
+
"llm",
|
|
40
|
+
"ecologits",
|
|
41
|
+
"carbon"
|
|
42
|
+
],
|
|
43
|
+
"files": [
|
|
44
|
+
"dist"
|
|
45
|
+
]
|
|
46
|
+
}
|