Louis d85d02693b
feat: Nitro-Tensorrt-LLM Extension (#2280)
* feat: tensorrt-llm-extension

* fix: loading

* feat: add download tensorrt llm runner

Signed-off-by: James <james@jan.ai>

* feat: update to rollupjs instead of webpack for monitoring extension

Signed-off-by: James <james@jan.ai>

* feat: move update nvidia info to monitor extension

Signed-off-by: James <james@jan.ai>

* allow download tensorrt

Signed-off-by: James <james@jan.ai>

* update

Signed-off-by: James <james@jan.ai>

* allow download tensor rt based on gpu setting

Signed-off-by: James <james@jan.ai>

* update downloaded models

Signed-off-by: James <james@jan.ai>

* feat: add extension compatibility

* dynamic tensor rt engines

Signed-off-by: James <james@jan.ai>

* update models

Signed-off-by: James <james@jan.ai>

* chore: remove ts-ignore

* feat: getting installation state from extension

Signed-off-by: James <james@jan.ai>

* chore: adding type for decompress

Signed-off-by: James <james@jan.ai>

* feat: update according Louis's comment

Signed-off-by: James <james@jan.ai>

* feat: add progress for installing extension

Signed-off-by: James <james@jan.ai>

* chore: remove args from extension installation

* fix: model download does not work properly

* fix: do not allow user to stop tensorrtllm inference

* fix: extension installed style

* fix: download tensorrt does not update state

Signed-off-by: James <james@jan.ai>

* chore: replace int4 by fl16

* feat: modal for installing extension

Signed-off-by: James <james@jan.ai>

* fix: start download immediately after press install

Signed-off-by: James <james@jan.ai>

* fix: error switching between engines

* feat: rename inference provider to ai engine and refactor to core

* fix: missing ulid

* fix: core bundler

* feat: add cancel extension installing

Signed-off-by: James <james@jan.ai>

* remove mocking for mac

Signed-off-by: James <james@jan.ai>

* fix: show models only when extension is ready

* add tensorrt badge for model

Signed-off-by: James <james@jan.ai>

* fix: copy

* fix: add compatible check (#2342)

* fix: add compatible check

Signed-off-by: James <james@jan.ai>

* fix: copy

* fix: font

* fix: copy

* fix: broken monitoring extension

* chore: bump engine

* fix: copy

* fix: model copy

* fix: copy

* fix: model json

---------

Signed-off-by: James <james@jan.ai>
Co-authored-by: James <james@jan.ai>
Co-authored-by: Louis <louis@jan.ai>

* fix: vulkan support

* fix: installation button padding

* fix: empty script

* fix: remove hard code string

---------

Signed-off-by: James <james@jan.ai>
Co-authored-by: James <james@jan.ai>
Co-authored-by: NamH <NamNh0122@gmail.com>
2024-03-14 14:07:22 +07:00

99 lines
2.9 KiB
TypeScript

import { useState } from 'react'
import { Model } from '@janhq/core'
import { Badge } from '@janhq/uikit'
import { twMerge } from 'tailwind-merge'
import ExploreModelItemHeader from '@/screens/ExploreModels/ExploreModelItemHeader'
type Props = {
model: Model
}
const ExploreModelItem: React.FC<Props> = ({ model }) => {
const [open, setOpen] = useState('')
const handleToggle = () => {
if (open === model.id) {
setOpen('')
} else {
setOpen(model.id)
}
}
return (
<div className="mb-6 flex flex-col overflow-hidden rounded-xl border border-border bg-background/60">
<ExploreModelItemHeader
model={model}
onClick={handleToggle}
open={open}
/>
{open === model.id && (
<div className="flex">
<div className="flex w-full flex-col border-t border-border p-4 ">
<div className="mb-6 flex flex-col gap-1">
<span className="font-semibold">About</span>
<p className="text-muted-foreground">
{model.description || '-'}
</p>
</div>
<div className="flex space-x-10">
<div>
<span className="font-semibold text-muted-foreground">
Author
</span>
<p className="mt-2 line-clamp-1 font-medium">
{model.metadata.author}
</p>
</div>
<div>
<span className="mb-1 font-semibold text-muted-foreground">
Model ID
</span>
<p className="mt-2 line-clamp-1 font-medium">{model.id}</p>
</div>
<div>
<span className="mb-1 font-semibold text-muted-foreground">
Tags
</span>
<div className="mt-2 flex space-x-2">
{model.metadata.tags.map((tag, i) => (
<Badge
key={i}
themes="primary"
className="line-clamp-1"
title={tag}
>
{tag}
</Badge>
))}
</div>
</div>
</div>
</div>
<div className="w-48 flex-shrink-0 border-l border-t border-border p-4">
<div>
<span className="font-semibold text-muted-foreground">
Format
</span>
<p
className={twMerge(
'mt-2 font-medium',
!model.format?.includes(' ') &&
!model.format?.includes('-') &&
'uppercase'
)}
>
{model.format}
</p>
</div>
</div>
</div>
)}
</div>
)
}
export default ExploreModelItem