> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galileo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# createMetricConfigs

***

# Function: createMetricConfigs()

```ts theme={null}
function createMetricConfigs(
  projectId: string,
  runId: string,
  metrics: (string | Metric | LocalMetricConfig)[],
): Promise<[ScorerConfig[], LocalMetricConfig[]]>;
```

Defined in: [src/utils/metrics.ts](https://github.com/rungalileo/galileo-js/blob/main/src/utils/metrics.ts)

Process metrics and create scorer configurations for log streams or experiments.

This function categorizes metrics into server-side and client-side types,
validates they exist, and registers server-side metrics with Galileo.

## Parameters

### projectId

`string`

The ID of the project

### runId

`string`

The ID of the run (can be experiment ID or log stream ID)

### metrics

(
\| `string`
\| [`Metric`](/sdk-api/typescript/reference/types/interfaces/Metric)
\| [`LocalMetricConfig`](/sdk-api/typescript/reference/types/interfaces/LocalMetricConfig))\[]

List of metrics to configure. Can include: - GalileoMetrics const object values (e.g., GalileoMetrics.correctness) - Metric objects with name and optional version - LocalMetricConfig objects for client-side scoring - String names of metrics

## Returns

`Promise`\<\[[`ScorerConfig`](/sdk-api/typescript/reference/types/type-aliases/ScorerConfig)\[], [`LocalMetricConfig`](/sdk-api/typescript/reference/types/interfaces/LocalMetricConfig)\[]]>

A promise that resolves to a tuple containing: - Array of ScorerConfig objects for server-side metrics - Array of LocalMetricConfig objects for client-side metrics

## Throws

Error if any specified metrics are unknown or don't exist in Galileo

## Example

```typescript theme={null}
const [scorerConfigs, localMetrics] = await createMetricConfigs(
  "project-123",
  "log-stream-456",
  [
    GalileoMetrics.correctness,
    GalileoMetrics.completeness,
    "toxicity",
    { name: "custom_metric", version: 2 },
  ],
);
```
