Skip to content

Commit 5206608

Browse files
committed
app manifest updates
1 parent a450f67 commit 5206608

File tree

4 files changed

+118
-99
lines changed

4 files changed

+118
-99
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_STORE

.trunk/trunk.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cli:
77
plugins:
88
sources:
99
- id: trunk
10-
ref: v1.6.3
10+
ref: v1.6.4
1111
uri: https://github.com/trunk-io/plugins
1212

1313
runtimes:
@@ -19,14 +19,14 @@ lint:
1919
enabled:
2020
2121
22-
22+
2323
- git-diff-check
2424
2525
2626
2727
2828
29-
29+
3030
3131
ignore:
3232
- linters: [ALL]

modus/app-manifest.mdx

Lines changed: 111 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,95 @@
11
---
22
title: App Manifest
3-
description: "Define your models and hosts"
3+
description: "Define the resources for your app"
44
---
55

66
The manifest for your Modus app allows you to configure the exposure and resources for your functions at runtime. You
7-
define the manifest in the `modus.json` file within the root of your project directory.
7+
define the manifest in the `modus.json` file within the root of directory of your app.
8+
9+
## Structure
810

911
<CardGroup cols={2}>
10-
<Card title="Endpoints" icon="message-plus" href="#endpoints">
12+
<Card title="Endpoints" icon="rectangle-code" href="#endpoints">
1113
Expose your functions for integration into your frontend or federated API
1214
</Card>
13-
<Card title="Connections" icon="server" href="#connections">
15+
<Card title="Connections" icon="router" href="#connections">
1416
Establish connectivity for external endpoints and model hosts
1517
</Card>
16-
<Card title="Models" icon="message-plus" href="#models">
18+
<Card title="Models" icon="cube" href="#models">
1719
Define inference services for use in your functions
1820
</Card>
19-
<Card title="Collections" icon="server" href="#collections">
20-
Define groups of text data to enable natural language search
21+
<Card title="Collections" icon="table" href="#collections">
22+
Define sets of text data to enable natural language search
2123
</Card>
2224
</CardGroup>
2325

26+
### Base manifest
27+
28+
A simple manifest, which exposes a single GraphQL endpoint with a bearer token for authentication, looks like this:
29+
30+
```json modus.json
31+
{
32+
"$schema": "https://schema.hypermode.com/modus.json",
33+
"endpoints": {
34+
"default": {
35+
"type": "graphql",
36+
"path": "/graphql",
37+
"auth": "bearer-token"
38+
}
39+
}
40+
}
41+
```
42+
43+
## Endpoints
44+
45+
Endpoints make your functions available outside of your Modus app. The `endpoints` object in the app manifest allows you
46+
to define these endpoints for integration into your frontend or federated API.
47+
48+
Each endpoint requires a unique name, specified as a key containing only alphanumeric characters and hyphens.
49+
50+
<Note>
51+
Only a GraphQL endpoint is available currently, but the modular design of Modus allows for the introduction of
52+
additional endpoint types in the future.
53+
</Note>
54+
55+
### GraphQL endpoint
56+
57+
This endpoint type supports the GraphQL protocol to communicate with external clients. You can use a GraphQL client,
58+
such as [urql](https://github.com/urql-graphql/urql) or [Apollo Client](https://github.com/apollographql/apollo-client),
59+
to interact with the endpoint.
60+
61+
**Example:**
62+
63+
```json modus.json
64+
{
65+
"endpoints": {
66+
"default": {
67+
"type": "graphql",
68+
"path": "/graphql",
69+
"auth": "bearer-token"
70+
}
71+
}
72+
}
73+
```
74+
75+
<ResponseField name="type" type="string" required>
76+
Always set to `"graphql"` for this endpoint type.
77+
</ResponseField>
78+
79+
<ResponseField name="path" type="string" required>
80+
The path for the endpoint. Must start with a forward slash `/`.
81+
</ResponseField>
82+
83+
<ResponseField name="auth" type="string" required>
84+
The authentication method for the endpoint. Options are `"bearer-token"` or `"none"`. See
85+
[Authentication](/modus/authentication) for additional details.
86+
</ResponseField>
87+
2488
## Connections
2589

26-
Connections establish connectivity to external services. They're used for HTTP and GraphQL APIs, database connections,
27-
and externally hosted AI models. The `connections` object in the app manifest allows you to define these hosts, for
28-
secure access from within a function.
90+
Connections establish connectivity and access to external services. They're used for HTTP and GraphQL APIs, database
91+
connections, and externally hosted AI models. The `connections` object in the app manifest allows you to define these
92+
hosts, for secure access from within a function.
2993

3094
Each connection requires a unique name, specified as a key containing only alphanumeric characters and hyphens.
3195

@@ -39,9 +103,7 @@ following table lists the available host types:
39103
| `dgraph` | Connect to a Dgraph database | `dgraph` |
40104

41105
<Warning>
42-
### Caution
43-
44-
Don't include secrets directly in the manifest!
106+
**Don't include secrets directly in the manifest!**
45107

46108
If your connection requires authentication, you can include _placeholders_ in connection properties which resolve to
47109
their respective secrets at runtime. Set the actual secrets via the Hypermode Console, where they're securely stored
@@ -72,14 +134,12 @@ This connection type is also used for [GraphQL APIs](/modus/sdk/graphql) and to
72134
}
73135
```
74136

75-
<ResponseField name="type" type="string">
137+
<ResponseField name="type" type="string" required>
76138
Always set to `"http"` for this connection type.
77139
</ResponseField>
78140

79141
<ResponseField name="baseUrl" type="string" required>
80-
Base URL for connections to the host.
81-
- Must end with a trailing slash.
82-
- May contain path segments if necessary.
142+
Base URL for connections to the host. Must end with a trailing slash and may contain path segments if necessary.
83143

84144
Example: `"https://api.example.com/v1/"`
85145

@@ -244,73 +304,61 @@ Modus SDK to interact with the database.
244304
AI models are a core resource for inferencing. The `models` object in the app manifest allows you to easily define
245305
models, whether hosted by Hypermode or another host.
246306

247-
```json hypermode.json
307+
Each model requires a unique name, specified as a key, containing only alphanumeric characters and hyphens.
308+
309+
```json modus.json
248310
{
249311
"models": {
250312
"text-generator": {
251313
"sourceModel": "meta-llama/Llama-3.1-8B-Instruct",
252314
"provider": "hugging-face",
253-
"host": "hypermode"
315+
"connection": "hypermode"
254316
}
255317
}
256318
}
257319
```
258320

259-
Each model requires a unique name, specified as a key, containing only alphanumeric characters and hyphens.
260-
261-
### Models properties
262-
263321
<ResponseField name="sourceModel" type="string" required>
264322
Original relative path of the model within the provider's repository.
265323
</ResponseField>
266324

267-
<ResponseField name="host" type="string" required>
268-
Host for the model instance.
269-
270-
- Specify `"hypermode"` for models that are automatically deployed by Hypermode.
271-
- Otherwise, specify a name that matches a host defined in the [`hosts`](#hosts) section of the manifest.
272-
273-
</ResponseField>
274-
275325
<ResponseField name="provider" type="string">
276326
Source provider of the model. `hugging-face` is currently the only supported option.
277327
</ResponseField>
278328

279-
<ResponseField name="path" type="string">
280-
Path to the model endpoint, applied to the `baseUrl` of the host.
281-
</ResponseField>
329+
<ResponseField name="connection" type="string" required>
330+
Connection for the model instance.
331+
332+
- Specify `"hypermode"` for models that [Hypermode hosts](/hosted-models).
333+
- Otherwise, specify a name that matches a host defined in the [`connections`](#connections) section of the manifest.
282334

283-
<ResponseField name="dedicated" type="boolean">
284-
Set to `true` to use a dedicated instance of the model for your project. Defaults to `false`.
285335
</ResponseField>
286336

287-
### Auto-deployed models
337+
<Tip>
338+
339+
When using `hugging-face` as the `provider` and `hypermode` as the `connection`, Hypermode automatically facilitates the
340+
connection to an instance of a shared or dedicated instance of the model. Your project's functions securely access the
341+
hosted model, with no further configuration required. For more details, see [hosted models](/hosted-models).
288342

289-
When using `hugging-face` as the `provider` and `hypermode` as the `host`, Hypermode automatically deploys a dedicated
290-
instance of the defined `sourceModel` when deploying your project. Your project's functions securely connect to the
291-
hosted model, with no further configuration required.
343+
</Tip>
292344

293345
## Collections
294346

295-
Collections are a key integration aspect with [models](#models) to create smart, searchable text. The `collections`
296-
object in the app manifest allows you to define groupings of text and functions to embed inserted text with.
347+
Collections simplify the usage of vector embeddings to build natural language search features. The `collections` object
348+
allows you to define indexed data types that are automatically embedded and searchable based on the search method you
349+
define.
350+
351+
Each collection requires a unique name, specified as a key, containing only alphanumeric characters and hyphens.
297352

298-
```json hypermode.json
353+
For more detail on implementing collections, see [Search](/modus/search).
354+
355+
```json modus.json
299356
{
300357
"collections": {
301-
// This defines a collection of products, having two search methods.
302358
"myProducts": {
303359
"searchMethods": {
304-
"searchMethod1": {
305-
// The embedder is the name of the function that will be used to generate vector embeddings.
306-
// By default, it uses a sequential index.
307-
"embedder": "embed"
308-
},
309-
310-
// This is an example of a second search method.
311-
// It could use a different embedder or index type, if desired.
312-
"searchMethod2": {
313-
"embedder": "embed",
360+
"searchMethod": {
361+
"embedder": "myEmbedder",
314362
"index": {
315363
"type": "sequential"
316364
}
@@ -321,46 +369,15 @@ object in the app manifest allows you to define groupings of text and functions
321369
}
322370
```
323371

324-
Each collection requires a unique name, specified as a key, containing only alphanumeric characters and hyphens.
325-
326-
### Collections properties
327-
328-
<ResponseField name="searchMethods" type="object">
329-
If provided, adds an index on top of the collection. Each key-value pair is a
330-
search method and values.
331-
332-
<ResponseField name="embedder" type="string">
333-
An exported function name used by the search method to embed text in the collection. Function must have a call signature with input `string[]` and return type `f32[][]`.
334-
335-
<Accordion title="Examples">
336-
This example specifies a `searchMethod` with an embedder named `embed`
337-
338-
```json
339-
"searchMethod1": {
340-
"embedder": "embed"
341-
}
342-
```
343-
344-
</Accordion>
345-
346-
</ResponseField>
347-
348-
<ResponseField name="index" type="string">
349-
If provided, describes the index mechanism used by the search method. `type`: specifies the type of the index. For example, `sequential` (default).
350-
351-
<Accordion title="Examples">
352-
This example specifies a `searchMethod` with an embedder named `embed` and an index with type `sequential`
353-
354-
```json
355-
"searchMethod1": {
356-
"embedder": "embed"
357-
"index": {
358-
"type": "sequential"
359-
}
360-
}
361-
```
372+
<ResponseField name="searchMethods" type="object" required>
373+
Search methods define a pair of an embedder and index to make available for searching the data in your collection.
374+
</ResponseField>
362375

363-
</Accordion>
376+
<ResponseField name="embedder" type="string" required>
377+
The function name to embed text added to the collection.
378+
</ResponseField>
364379

365-
</ResponseField>
380+
<ResponseField name="index" type="string">
381+
If provided, describes the index mechanism used by the search method. `type`: specifies the type of the index. For
382+
example, `sequential` (default).
366383
</ResponseField>

styles/config/vocabularies/general/accept.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ getModel
1919
getText
2020
getTexts
2121
getVector
22-
[Gg]it[Hh]ub
22+
GitHub|github
2323
GraphiQL
24-
GraphQL
24+
GraphQL|graphql
2525
gRPC
2626
hardcoding
2727
HTTP|http
@@ -52,4 +52,5 @@ timeEnd
5252
triaging
5353
upsert
5454
URL|url
55+
urql
5556
UUID

0 commit comments

Comments
 (0)