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

feat: Hardware API #1593

Merged
merged 56 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
7aaa9cc
feat: ram info
sangjanai Oct 30, 2024
87920fd
chore bump vcpkg to 2024.10.21 Release 10b7a17
sangjanai Oct 30, 2024
f1de213
Merge branch 'chore/bump-vcpkg' into feat/hardware-api
sangjanai Oct 30, 2024
9c8db1a
fix: vcpkg-configuration.json
sangjanai Oct 30, 2024
253ef85
Merge branch 'chore/bump-vcpkg' into feat/hardware-api
sangjanai Oct 30, 2024
1fca8cc
feat: add ram and cpu info
sangjanai Oct 30, 2024
9b17e97
feat: os info
sangjanai Oct 30, 2024
c7534b0
temp gpu info
sangjanai Oct 30, 2024
cfecbb3
feat: gpu info
sangjanai Oct 31, 2024
ca41681
feat: v1/hardware
sangjanai Oct 31, 2024
19ea706
Merge branch 'dev' of https://github.com/janhq/cortex.cpp into feat/h…
sangjanai Oct 31, 2024
3e0e96c
fix: rm fmt
sangjanai Oct 31, 2024
ff8968f
fix: build macos
sangjanai Oct 31, 2024
469906f
Merge branch 'dev' of https://github.com/janhq/cortex.cpp into feat/h…
sangjanai Nov 1, 2024
1bc1c60
feat: v1/hardware/activate linux
sangjanai Nov 4, 2024
afb85de
Merge branch 'dev' of github.com:janhq/nitro into feat/hardware-api
vansangpfiev Nov 5, 2024
5cbd469
chore: hardware awareness docs
vansangpfiev Nov 5, 2024
b3ef8c5
fix: build windows
sangjanai Nov 5, 2024
f1f56b1
feat: activate for Windows
sangjanai Nov 5, 2024
7ab1a00
fix: build linux
sangjanai Nov 5, 2024
a7f7f98
feat: gpus parameters
sangjanai Nov 5, 2024
6872a35
Merge branch 'dev' of https://github.com/janhq/cortex into feat/hardw…
sangjanai Nov 6, 2024
dc09bbb
fix: temp gguf
sangjanai Nov 8, 2024
1a111bf
Merge branch 'dev' of github.com:janhq/nitro into feat/hardware-api
vansangpfiev Nov 8, 2024
5103de6
feat: windows fallback to CPU
vansangpfiev Nov 8, 2024
3cc124e
fix: hang on restart
sangjanai Nov 11, 2024
b24db31
feat: hardware list command
sangjanai Nov 11, 2024
1dffd34
feat: hardware activate command
sangjanai Nov 11, 2024
f83b478
feat: cortex models start with --gpus
sangjanai Nov 11, 2024
dc5f0a3
feat: support run command with --gpus
sangjanai Nov 11, 2024
d1cd4a6
Merge branch 'dev' of https://github.com/janhq/cortex.cpp into feat/h…
sangjanai Nov 11, 2024
dd707f6
fix: remove model estimation
sangjanai Nov 11, 2024
e8e6877
fix: hardcoded
sangjanai Nov 11, 2024
9b0a120
fix: typo
sangjanai Nov 11, 2024
efa7e11
fix: CI
sangjanai Nov 11, 2024
86d4698
fix: CI
sangjanai Nov 11, 2024
80093fe
Merge branch 'dev' of https://github.com/janhq/cortex.cpp into feat/h…
sangjanai Nov 11, 2024
4ccf655
fix: check before updating
sangjanai Nov 11, 2024
24ad749
fix: clean
sangjanai Nov 11, 2024
9f4e915
chores: update CLI docs
sangjanai Nov 11, 2024
40a80d0
chore: Hardware API docs
sangjanai Nov 11, 2024
6ed42e0
chore: update docs for CLI
sangjanai Nov 12, 2024
2534dd9
Merge branch 'dev' into feat/hardware-api
vansangpfiev Nov 12, 2024
0b67279
fix: macos RAM info
sangjanai Nov 12, 2024
773d885
Merge branch 'feat/hardware-api' of https://github.com/janhq/cortex.c…
sangjanai Nov 12, 2024
a60ba45
Merge branch 'dev' into feat/hardware-api
vansangpfiev Nov 12, 2024
e105003
fix: warnings
sangjanai Nov 12, 2024
6cea96a
chore: temporary disable hf test because main is broken
sangjanai Nov 12, 2024
9efbeba
fix: update hardware config
sangjanai Nov 12, 2024
ca3273d
e2e: stop server
sangjanai Nov 12, 2024
b89168b
e2e: add log for docker test
sangjanai Nov 13, 2024
33676f2
fix: guard nvidia available
sangjanai Nov 13, 2024
4886edb
fix: comments
sangjanai Nov 13, 2024
e8a8de5
chore: move FileManagerConfigTest test to the end
sangjanai Nov 13, 2024
216cd78
Merge branch 'dev' of https://github.com/janhq/cortex.cpp into feat/h…
sangjanai Nov 13, 2024
5707dd7
chore: disable docker test
sangjanai Nov 13, 2024
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
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
---
title: Hardware Awareness
draft: True
description: The Hardware Awareness section overview
---

:::warning
🚧 Cortex.cpp is currently under development. Our documentation outlines the intended behavior of Cortex, which may not yet be fully implemented in the codebase.
:::


# Hardware Awareness

Cortex is designed to be hardware aware, meaning it can detect your hardware configuration and automatically set parameters to optimize compatibility and performance, and avoid hardware-related errors.
Expand Down
116 changes: 116 additions & 0 deletions docs/docs/cli/hardware/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
---
title: Cortex Hardware
---

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

# `cortex hardware`

This command allows you manage and monitor hardware resources.


**Usage**:
:::info
You can use the `--verbose` flag to display more detailed output of the internal processes. To apply this flag, use the following format: `cortex --verbose [subcommand]`.
:::
<Tabs>
<TabItem value="MacOs/Linux" label="MacOs/Linux">
```sh
cortex hardware [options] [subcommand]
```
</TabItem>
<TabItem value="Windows" label="Windows">
```sh
cortex.exe hardware [options]

```
</TabItem>
</Tabs>

**Options**:

| Option | Description | Required | Default value | Example |
|-------------------|-------------------------------------------------------|----------|---------------|-----------------|
| `-h`, `--help` | Display help information for the command. | No | - | `-h` |

---
# Subcommands:

## `cortex hardware list`
:::info
This CLI command calls the following API endpoint:
- [List Model](/api-reference#tag/hardware/get/v1/hardware)
:::
This command lists all the hardware resources.

**Usage**:
<Tabs>
<TabItem value="MacOs/Linux" label="MacOs/Linux">
```sh
cortex hardware list [options]
```
</TabItem>
<TabItem value="Windows" label="Windows">
```sh
cortex.exe hardware list [options]
```
</TabItem>
</Tabs>

For example, it returns the following:
```bash
OS Information:
+---+---------------------------+--------------------+
| # | Version | Name |
+---+---------------------------+--------------------+
| 1 | 24.04.1 LTS (Noble Numbat)| Ubuntu 24.04.1 LTS |
+---+---------------------------+--------------------+
```

**Options**:

| Option | Description | Required | Default value | Example |
|---------------------------|----------------------------------------------------|----------|---------------|----------------------|
| `-h`, `--help` | Display help for command. | No | - | `-h` |
|`--cpu` | Display CPU information | No | - | `--cpu` |
|`--os` | Display OS information | No | - | `--os` |
|`--ram` | Display RAM information | No | - | `--ram` |
|`--storage` | Display Storage information | No | - | `--storage` |
|`--gpu` | Display GPU information | No | - | `--gpu` |
|`--power` | Display Power information | No | - | `--power` |
|`--monitors` | Display Monitors information | No | - | `--monitors` |

## `cortex hardware activate`

::info
This CLI command calls the following API endpoint:
- [List Model](/api-reference#tag/hardware/post/v1/hardware/activate)
:::
This command activates the Cortex's hardware, currently support only GPUs.

**Usage**:
<Tabs>
<TabItem value="MacOs/Linux" label="MacOs/Linux">
```sh
cortex hardware activate [options]
```
</TabItem>
<TabItem value="Windows" label="Windows">
```sh
cortex.exe hardware activate [options]
```
</TabItem>
</Tabs>

For example, it returns the following:
```bash
Activated GPUs: 0
```

**Options**:

| Option | Description | Required | Default value | Example |
|---------------------------|----------------------------------------------------|----------|---------------|----------------------|
| `-h`, `--help` | Display help for command. | No | - | `-h` |
|`--gpus` | List of GPUs to activate | Yes | - | `[0, 1]` |
1 change: 1 addition & 0 deletions docs/docs/cli/models/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ This command uses a `model_id` from the model that you have downloaded or availa
| Option | Description | Required | Default value | Example |
|---------------------------|---------------------------------------------------------------------------|----------|----------------------------------------------|------------------------|
| `model_id` | The identifier of the model you want to start. | Yes | `Prompt to select from the available models` | `mistral` |
| `--gpus` | List of GPUs to use. | No | - | `[0,1]` |
| `-h`, `--help` | Display help information for the command. | No | - | `-h` |

## `cortex models stop`
Expand Down
16 changes: 5 additions & 11 deletions docs/docs/cli/models/start.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,28 @@ description: Cortex models subcommands.
This command starts a model defined by a `model_id`.



## Usage

```bash
# Start a model
cortex models start [model_id]

# Start a model with a preset
cortex models start [model_id] [options]

# Start with a specified engine
cortex models start [model_id]:[engine] [options]
```


:::info
- This command uses a `model_id` from the model that you have downloaded or available in your file system.
- Model preset is applied only at the start of the model and does not change during the chat session.
:::

## Options

| Option | Description | Required | Default value | Example |
|---------------------------|---------------------------------------------------------------------------|----------|----------------------------------------------|------------------------|
| `model_id` | The identifier of the model you want to start. | No | `Prompt to select from the available models` | `mistral` |
| `-a`, `--attach` | Attach to an interactive chat session. | No | `false` | `-a` |
| `-p`, `--preset <preset>` | Apply a chat preset to the chat session. | No | `false` | `-p friendly` |
| `-h`, `--help` | Display help information for the command. | No | - | `-h` |
| Option | Description | Required | Default value | Example |
|---------------------------|----------------------------------------------------------|----------|----------------------------------------------|-------------------|
| `model_id` | The identifier of the model you want to start. | No | `Prompt to select from the available models` | `mistral` |
| `--gpus` | List of GPUs to use. | No | - | `[0,1]` |
| `-h`, `--help` | Display help information for the command. | No | - | `-h` |



1 change: 1 addition & 0 deletions docs/docs/cli/run.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ You can use the `--verbose` flag to display more detailed output of the internal
| Option | Description | Required | Default value | Example |
|-----------------------------|-----------------------------------------------------------------------------|----------|----------------------------------------------|------------------------|
| `model_id` | The identifier of the model you want to chat with. | Yes | - | `mistral` |
| `--gpus` | List of GPUs to use. | No | - | `[0,1]` |
| `-h`, `--help` | Display help information for the command. | No | - | `-h` |
<!-- | `-t`, `--thread <thread_id>` | Specify the Thread ID. Defaults to creating a new thread if none specified. | No | - | `-t jan_1717650808` | | `-c` | -->
Loading
Loading