open-index/open-npm huggingface dataset:
npm package: @genai-fi/recom
Description: [Generation AI](https://www.generation-ai-stn.fi) base code library for all common components of our educational apps.
Latest version: 0.3.19

# Introduction 
[Generation AI](https://www.generation-ai-stn.fi) base code library for all common components of our educational apps.

# Getting Started
```bash
npm install @knicos/genai-base
```

```typescript
import { ConnectionMonitor } from '@knicos/genai-base';

function MyComponent() {
    return <ConnectionMonitor />;
}
```

# Build and Test
Use `npm run build` to build the library in the `dist` folder. Testing uses vitest with `npm test`.
npm package: @genai-impact/ecologits.js
Description: Core library for the Ecologits project, port of the ecologits methodology to TypeScript
Latest version: 2.0.5

# Ecologits.js - Core calculator

## Install

### `npm`

```
npm install @genai-impact/ecologits.js
```

### `yarn`

```
yarn add @genai-impact/ecologits.js
```

## Usage (Calculator only)

```ts
import { computeLlmImpacts, type Impacts } from "@genai-impact/ecologits.js";

const PROVIDER = // provider name, must match one of the providers in https://raw.githubusercontent.com/genai-impact/ecologits/refs/tags/0.5.0/ecologits/data/models.csv
const model = // the model name used


const main = async () => {
  try {
    const startDate = new Date();
    const response = // Interact with any LLM
    const requestLatency = new Date().getTime() - startDate.getTime();
    const tokens = response.data.usage.completionTokens; // data structure to retrieve number of tokens may vary depending on the provider
    const impacts = computeLlmImpacts(
        PROVIDER,
        model,
        tokens,
        requestLatency);
    // Get estimated environmental impacts of the inference
    console.log(
      // @ts-ignore
      `Energy consumption: ${impacts.energy.value} ${impacts.energy.unit}`
    );
    console.log(
      // @ts-ignore
      `GHG emissions: ${impacts.gwp.value} ${impacts.gwp.unit}`
    );
  } catch (e) {
    console.error(e);
    throw e;
  }
};
main();
```