Skip to content

Commit e39c782

Browse files
authored
Add a vimeo/youtube embed function that supports private and public endpoints (#48)
* Add a VimeoEmbed component to embed public or private vimeo videos Signed-off-by: Pete Cheslock <[email protected]> * Add video demonstration section to architecture documentation Signed-off-by: Pete Cheslock <[email protected]> * Replace VimeoEmbed component with VideoEmbed for YouTube videos in architecture documentation; add VideoEmbed component for responsive YouTube video embedding. Signed-off-by: Pete Cheslock <[email protected]> --------- Signed-off-by: Pete Cheslock <[email protected]>
1 parent fdcee45 commit e39c782

File tree

2 files changed

+67
-1
lines changed

2 files changed

+67
-1
lines changed

docs/architecture/00_architecture.md renamed to docs/architecture/00_architecture.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ With `llm-d`, users can operationalize GenAI deployments with a modular solution
99

1010
Built by leaders in the Kubernetes and vLLM projects, `llm-d` is a community-driven, Apache-2 licensed project with an open development model.
1111

12+
## Video Demonstration
13+
14+
import VideoEmbed from '@site/src/components/VideoEmbed';
15+
16+
<VideoEmbed videoId="32MqYC3OydE" />
17+
1218
## Architecture
1319

1420
`llm-d` adopts a layered architecture on top of industry-standard open technologies: vLLM, Kubernetes, and Inference Gateway.
@@ -17,7 +23,6 @@ Built by leaders in the Kubernetes and vLLM projects, `llm-d` is a community-dri
1723
![llm-d Architecture](../assets/images/llm-d-arch-simplified.svg)
1824

1925

20-
2126
Key features of `llm-d` include:
2227

2328
- **vLLM-Optimized Inference Scheduler:** `llm-d` builds on IGW's pattern for customizable “smart” load-balancing via the Endpoint Picker Protocol (EPP) to define vLLM-optimized scheduling. Leveraging operational telemetry, the Inference Scheduler implements the filtering and scoring algorithms to make decisions with P/D-, KV-cache-, SLA-, and load-awareness. Advanced teams can implement their own scorers to further customize, while benefiting from other features in IGW, like flow control and latency-aware balancing. [See our Northstar design](https://docs.google.com/document/d/1kE1LY8OVjiOgKVD9-9Po96HODbTIbgHp4qgvw06BCOc/edit?tab=t.0#heading=h.4rgkvvo5gnle)

src/components/VideoEmbed.js

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import React from 'react';
2+
3+
const VideoEmbed = ({
4+
videoId,
5+
width = '100%',
6+
height = '360',
7+
responsive = true,
8+
autoplay = false,
9+
modestbranding = true,
10+
rel = false
11+
}) => {
12+
// Construct the URL with optional parameters
13+
const params = new URLSearchParams({
14+
autoplay: autoplay ? 1 : 0,
15+
modestbranding: modestbranding ? 1 : 0,
16+
rel: rel ? 1 : 0
17+
});
18+
19+
const src = `https://www.youtube.com/embed/${videoId}?${params.toString()}`;
20+
21+
const iframe = (
22+
<iframe
23+
src={src}
24+
style={responsive ? {
25+
width: '100%',
26+
height: '100%'
27+
} : {
28+
width,
29+
height
30+
}}
31+
frameBorder="0"
32+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
33+
allowFullScreen
34+
/>
35+
);
36+
37+
if (responsive) {
38+
return (
39+
<div style={{
40+
position: 'relative',
41+
paddingBottom: '56.25%',
42+
height: 0,
43+
overflow: 'hidden'
44+
}}>
45+
<div style={{
46+
position: 'absolute',
47+
top: 0,
48+
left: 0,
49+
width: '100%',
50+
height: '100%'
51+
}}>
52+
{iframe}
53+
</div>
54+
</div>
55+
);
56+
}
57+
58+
return iframe;
59+
};
60+
61+
export default VideoEmbed;

0 commit comments

Comments
 (0)