Skip to content
Closed
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
18 changes: 18 additions & 0 deletions modus/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,24 @@
- Text editor - we recommend [VS Code](https://code.visualstudio.com/)
- Terminal - access Modus through a command-line interface (CLI)

To create a Modus app in Go

- Go version 1.19 through 1.23

If you have a more recent version of Go installed, install Go 1.23.6 using

```bash
go install golang.org/dl/go1.23.6@latest
go1.23.6 download
```

and invoke `modus build` or `modus dev` with GOTOOLCHAIN environment variable
set to `go1.23.6`

```

Check notice on line 32 in modus/quickstart.mdx

View check run for this annotation

Trunk.io / Trunk Check

markdownlint(MD040)

[new] Fenced code blocks should have a language specified
GOTOOLCHAIN=go1.23.6 modus dev
```

## Building your first Modus app

<Steps>
Expand All @@ -22,7 +40,7 @@
The Modus CLI provides a set of commands to help you create, build, and run your Modus apps.
Install the CLI using npm.

```bash

Check notice on line 43 in modus/quickstart.mdx

View check run for this annotation

Trunk.io / Trunk Check

markdownlint(MD046)

[new] Code block style
npm install -g @hypermode/modus-cli
```

Expand All @@ -31,7 +49,7 @@
<Step title="Initialize your Modus app">
To create a new Modus app, run the following command in your terminal:

```bash

Check notice on line 52 in modus/quickstart.mdx

View check run for this annotation

Trunk.io / Trunk Check

markdownlint(MD046)

[new] Code block style
modus new
```

Expand All @@ -42,7 +60,7 @@
<Step title="Build and run your app">
To build and run your app, navigate to the app directory and run the following command:

```bash

Check notice on line 63 in modus/quickstart.mdx

View check run for this annotation

Trunk.io / Trunk Check

markdownlint(MD046)

[new] Code block style
modus dev
```

Expand All @@ -53,7 +71,7 @@
<Step title="Access your local endpoint">
Once your app is running, you can access the graphical interface for your API at the URL located in your terminal.

```bash

Check notice on line 74 in modus/quickstart.mdx

View check run for this annotation

Trunk.io / Trunk Check

markdownlint(MD046)

[new] Code block style
View endpoint: http://localhost:8686/explorer
```

Expand All @@ -70,7 +88,7 @@
Modus is a secure-by-default framework. To connect to external services, you need to add a connection
in your app manifest.

Add the following code into your `modus.json` manifest file:

Check notice on line 91 in modus/quickstart.mdx

View check run for this annotation

Trunk.io / Trunk Check

markdownlint(MD046)

[new] Code block style

```json modus.json
{
Expand All @@ -88,7 +106,7 @@
Functions are the building blocks of your app. Let's add a function that fetches a random quote from
the ZenQuotes connection you just created.

<Tabs>

Check notice on line 109 in modus/quickstart.mdx

View check run for this annotation

Trunk.io / Trunk Check

markdownlint(MD046)

[new] Code block style
<Tab title="Go">
To add a function, create a new file in the root directory with the following code:

Expand Down Expand Up @@ -178,7 +196,7 @@
<Step title="Add a model">
Modus also supports AI models. You can define new models in your `modus.json` file. Let's add a new meta-llama model:

```json

Check notice on line 199 in modus/quickstart.mdx

View check run for this annotation

Trunk.io / Trunk Check

markdownlint(MD046)

[new] Code block style
"models": {
"text-generator": {
"sourceModel": "meta-llama/Llama-3.2-3B-Instruct",
Expand All @@ -192,7 +210,7 @@
<Step title="Install the Hyp CLI and log in">
Next, install the Hyp CLI. This allows you to access hosted models on the Hypermode platform.

```bash

Check notice on line 213 in modus/quickstart.mdx

View check run for this annotation

Trunk.io / Trunk Check

markdownlint(MD046)

[new] Code block style
npm install -g @hypermode/hyp-cli
```

Expand All @@ -203,7 +221,7 @@

<Step title="Track local model inferences">

When testing an AI app locally, Modus records the inference and related metadata

Check notice on line 224 in modus/quickstart.mdx

View check run for this annotation

Trunk.io / Trunk Check

markdownlint(MD046)

[new] Code block style
in the `View Inferences` tab of the APIs explorer.

<Note>
Expand Down