Skip to content

Implement guidellm UI #169

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

Open
wants to merge 4 commits into
base: implement-app-tooling
Choose a base branch
from
Open
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
11 changes: 10 additions & 1 deletion ui/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@
"peerDependencies": false
}
],
"no-secrets/no-secrets": ["error", { "additionalRegexes": {}, "ignoreContent": [] }]
"no-secrets/no-secrets": ["error", { "additionalRegexes": {}, "ignoreContent": [] }],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn", // or "error"
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
]
}
}
28 changes: 26 additions & 2 deletions ui/DEVELOPING.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
## Getting Started

First, run the development server:
The GuideLLM UI is built with Next.js

First, install dependencies:

```bash
npm install
```

Then, run the development server:

```bash
npm run dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
Open [http://localhost:3000](http://localhost:3000) with your browser to see the app.

#### `npm run build`

Expand All @@ -31,3 +39,19 @@ Fix code styling issues.
#### `make quality`

Run quality eslint quality checks.

##### Tagging Tests

Reference [https://www.npmjs.com/package/jest-runner-groups](jest-runner-groups)
Add @group with the tag in a docblock at the top of the test file to indicate which types of tests are contained within.
Can't distinguish between different types of tests in the same file.

```
/**
* Admin dashboard tests
*
* @group smoke
* @group sanity
* @group regression
*/
```
53 changes: 52 additions & 1 deletion ui/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,52 @@
# GuideLLM UI
### GuideLLM UI

GuideLLM UI is a companion frontend for visualizing the results of a GuideLLM benchmark run.

### 🛠 Running the UI

1. Use the Hosted Build (Recommended for Most Users)

After running a benchmark with GuideLLM, a report.html file will be generated (by default at guidellm_report/report.html). This file references the latest stable version of the UI hosted at:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is based off of a WIP effort i have. I don't know if this is where report.html will end up but that is what I'm working with for now.

```
https://neuralmagic.github.io/guidellm/ui/dev/
```

Open the file in your browser and you're done—no setup required.

2. Build and Serve the UI Locally (For Development)
This option is useful if:

- You are actively developing the UI

- You want to test changes to the UI before publishing

- You want full control over how the report is displayed

```bash
npm install
npm run build
npx serve out
```

This will start a local server (e.g., at http://localhost:3000). Then, in your GuideLLM config or CLI flags, point to this local server as the asset base for report generation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not something I've set up yet. Currently in this file the asset bases are configured via environment. One for prod, staging, dev, and local. But what I have in the readme implies you can see it to something other than the preconfigured options. Maybe it'd be better to have local hardcoded to localhost:3000 and wait on adding an option for the user to configure. Not sure.

### 🧪 Development Notes

During UI development, it can be helpful to view sample data. We include a sample benchmark run wired into the Redux store under:

```
src/lib/store/[runInfo/workloadDetails/benchmarks]WindowData.ts
```

In the future this will be replaced by a configurable untracked file for dev use.

### 🚧 Future Possibilities

We're evaluating options for hosting dev/staging/prod builds on GitHub Pages. For now, production builds will be published at:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should go with GitHub pages. I just left the other ideas in there as food for thought since gh pages is being used for docs right now, but I think these things can coexist. Netlify seems like something common in OS repos, and this is currently a Next.js app so Vercel also seems like a reasonable choice.

```
https://neuralmagic.github.io/guidellm/ui/dev/
```

If needed, alternative hosting (e.g., Vercel, Netlify) may be explored, but simplicity and transparency remain key priorities for this open-source tool.
2 changes: 2 additions & 0 deletions ui/__mocks__/@nivo/bar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const ResponsiveBar = () => null;
export const BarCustomLayerProps = () => null;
1 change: 1 addition & 0 deletions ui/__mocks__/@nivo/core.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const Point = () => null;
1 change: 1 addition & 0 deletions ui/__mocks__/@nivo/line.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const ResponsiveLine = () => null;
3 changes: 3 additions & 0 deletions ui/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ const customJestConfig = {
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
},
transformIgnorePatterns: [
'/node_modules/(?!(@nivo|d3|d3-.*|internmap|delaunator|robust-predicates)/)',
],
};

module.exports = createJestConfig(customJestConfig);
16 changes: 16 additions & 0 deletions ui/jest.setup.ts
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
import '@testing-library/jest-dom';

jest.mock('@nivo/bar');
jest.mock('@nivo/line');
jest.mock('@nivo/core');

jest.mock('next/dynamic', () => ({
__esModule: true,
default: (...props: any[]) => {
const dynamicModule = jest.requireActual('next/dynamic');
const dynamicActualComp = dynamicModule.default;
const RequiredComponent = dynamicActualComp(props[0]);
// eslint-disable-next-line no-unused-expressions, @typescript-eslint/no-unused-expressions
RequiredComponent.preload ? RequiredComponent.preload() : RequiredComponent.render.preload();
return RequiredComponent;
},
}));
Loading
Loading