Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add endpoint_type_map section to customizable frontend tutorial #215

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion genai-perf/docs/customizable_frontends.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,20 @@ converters = {
}
```

## Map an Endpoint Type to the Output Format

Open `genai_perf/parser.py`.
Add an mapping for your new endpoint type in the `_endpoint_type_map`.

For example, see the code below.

```python
_endpoint_type_map = {
# Existing mappings
"NEW-ENDPOINT": EndpointConfig("v1/endpoint", "openai", ic.OutputFormat.NEW_ENDPOINT),
}
```

## Update the Metrics Parser

GenAI-Perf needs to know which metrics format your API uses. Go to
Expand All @@ -142,7 +156,7 @@ After implementing your converter, you can run it against your server to
ensure it works:

```bash
genai-perf profile -m TEST_MODEL --endpoint NEW-ENDPOINT
genai-perf profile -m TEST_MODEL --endpoint-type NEW-ENDPOINT
```

You can also write unit tests to ensure it works as expected.
Expand Down
16 changes: 15 additions & 1 deletion templates/genai-perf-templates/customizable_frontends_template
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,20 @@ converters = {
}
```

## Map an Endpoint Type to the Output Format

Open `genai_perf/parser.py`.
Add an mapping for your new endpoint type in the `_endpoint_type_map`.

For example, see the code below.

```python
_endpoint_type_map = {
# Existing mappings
"NEW-ENDPOINT": EndpointConfig("v1/endpoint", "openai", ic.OutputFormat.NEW_ENDPOINT),
}
```

## Update the Metrics Parser

GenAI-Perf needs to know which metrics format your API uses. Go to
Expand All @@ -142,7 +156,7 @@ After implementing your converter, you can run it against your server to
ensure it works:

```bash
genai-perf profile -m TEST_MODEL --endpoint NEW-ENDPOINT
genai-perf profile -m TEST_MODEL --endpoint-type NEW-ENDPOINT
```

You can also write unit tests to ensure it works as expected.
Expand Down
Loading