diff --git a/configure-environment.mdx b/configure-environment.mdx index 78900b79..8f963090 100644 --- a/configure-environment.mdx +++ b/configure-environment.mdx @@ -3,18 +3,18 @@ title: Configure Environment description: "Define environment parameters for your app" --- -On your first deployment, and when you add new hosts thereafter, you may need to -adjust the configuration of your environment for your app to be ready for -traffic. +On your first deployment, and when you add new connections thereafter, you may +need to adjust the configuration of your environment for your app to be ready +for traffic. -## Host secrets +## Connection secrets -If you included parameters for Host Secrets in your +If you included parameters for Connection Secrets in your [app manifest](/modus/app-manifest), you'll need to add the parameter values in the Hypermode Console. -From your project home, navigate to **Settings** → **Hosts**. Add the values for -your defined host authentication parameters. +From your project home, navigate to **Settings** → **Connections**. Add the +values for your defined connection authentication parameters. ## Model hosting diff --git a/getting-started-with-hyper-commerce.mdx b/getting-started-with-hyper-commerce.mdx index 1c32a489..fcb887ea 100644 --- a/getting-started-with-hyper-commerce.mdx +++ b/getting-started-with-hyper-commerce.mdx @@ -128,9 +128,9 @@ In the Hypermode console, you’ll see several key components of your project: for search. Hypermode provides open source shared and dedicated model hosting for rapid experimentation. You can also connect to your preferred large language model, including OpenAI, Anthropic, and Gemini. -- **[Hosts](/modus/app-manifest#hosts):** You define all external connections - from your functions as hosts, with the runtime denying all other egress for - secure-by-default processing. +- **[Connections](/modus/app-manifest#connections):** You define all external + connections, with the runtime denying all other egress for secure-by-default + processing. - **Endpoint:** The GraphQL endpoint for your project, which you’ll use to interact with your APIs and query your data. diff --git a/hosted-models.mdx b/hosted-models.mdx index 40f089a9..43df6621 100644 --- a/hosted-models.mdx +++ b/hosted-models.mdx @@ -12,7 +12,7 @@ Need a bespoke model? You can include a model from ## Setup -To use a Hypermode-hosted model, set `host: "hypermode"`, +To use a Hypermode-hosted model, set `connection: "hypermode"`, `provider: "hugging-face"`, and set `sourceModel` to be the model name as specified on Hugging Face. @@ -23,7 +23,7 @@ specified on Hugging Face. "text-generator": { "sourceModel": "meta-llama/Llama-3.1-8B-Instruct", "provider": "hugging-face", - "host": "hypermode" + "connection": "hypermode" } } ... @@ -36,12 +36,9 @@ We run our most popular models as multi-tenant, shared instances across projects and customers. By default, if the model you use is available as a shared model, your app uses -these shared models at runtime. You can override this default behavior by -setting `dedicated: true` on your model in the -[app manifest](/modus/app-manifest). - -If the model you use isn't available as a shared model, Hypermode automatically -spins up a dedicated instance of the model for your project. +these shared models at runtime. If the model you use isn't available as a shared +model, Hypermode automatically spins up a dedicated instance of the model for +your project. ## Shared models diff --git a/modus/app-manifest.mdx b/modus/app-manifest.mdx index 3fa949e3..f47899ca 100644 --- a/modus/app-manifest.mdx +++ b/modus/app-manifest.mdx @@ -103,7 +103,7 @@ alphanumeric characters and hyphens. Each connection has a `type` property, which controls how it's used and which additional properties are available. The following table lists the available -host types: +connection types: | Type | Purpose | Functions Namespaces | | :----------- | :------------------------------- | :-------------------------- | @@ -203,7 +203,7 @@ This example specifies a header named `X-API-Key` provided by a secret named } ``` -You can use a special syntax for hosts that require +You can use a special syntax for connections that require [HTTP basic authentication](https://en.wikipedia.org/wiki/Basic_access_authentication). In this example, secrets named `USERNAME` and `PASSWORD` combined and then are base64-encoded to form a compliant `Authorization` header value: @@ -358,7 +358,7 @@ alphanumeric characters and hyphens. Connection for the model instance. - Specify `"hypermode"` for models that [Hypermode hosts](/hosted-models). -- Otherwise, specify a name that matches a host defined in the +- Otherwise, specify a name that matches a connection defined in the [`connections`](#connections) section of the manifest. diff --git a/modus/data-fetching.mdx b/modus/data-fetching.mdx index eca18e69..51f9cfc9 100644 --- a/modus/data-fetching.mdx +++ b/modus/data-fetching.mdx @@ -26,7 +26,7 @@ import ( ) // the name of the PostgreSQL connection, as specified in the modus.json manifest -const host = "my-database" +const connection = "my-database" type Person struct { Name string `json:"name"` @@ -35,7 +35,7 @@ type Person struct { func GetPerson(name string) (*Person, error) { const query = "select * from persons where name = $1" - rows, _, _ := postgresql.Query[Person](host, query, name) + rows, _, _ := postgresql.Query[Person](connection, query, name) return &rows[0], nil } ``` @@ -44,7 +44,7 @@ func GetPerson(name string) (*Person, error) { import { postgresql } from "@hypermode/modus-sdk-as" // the name of the PostgreSQL connection, as specified in the modus.json manifest -const host = "my-database" +const connection = "my-database" @json class Person { @@ -58,7 +58,7 @@ export function getPerson(name: string): Person { const params = new postgresql.Params() params.push(name) - const response = postgresql.query(host, query, params) + const response = postgresql.query(connection, query, params) return response.rows[0] } ``` @@ -84,7 +84,7 @@ import ( ) // the name of the Dgraph connection, as specified in the modus.json manifest -const hostName = "my-dgraph" +const connection = "my-dgraph" // declare structures used to parse the JSON document returned by Dgraph query. type Person struct { @@ -109,7 +109,7 @@ func GetPerson(name string) (*Person, error) { "$name": name, } - response, _ := dgraph.Execute(hostName, &dgraph.Request{ + response, _ := dgraph.Execute(connection, &dgraph.Request{ Query: &dgraph.Query{ Query: statement, Variables: variables, @@ -129,7 +129,7 @@ import { dgraph } from "@hypermode/modus-sdk-as" import { JSON } from "json-as" // the name of the Dgraph connection, as specified in the modus.json manifest -const hostName: string = "my-dgraph" +const connection: string = "my-dgraph" // declare classes used to parse the JSON document returned by Dgraph query. @json @@ -157,7 +157,7 @@ export function getPerson(name: string): Person { vars.set("$name", name) const resp = dgraph.execute( - hostName, + connection, new dgraph.Request(new dgraph.Query(statement, vars)), ) const persons = JSON.parse(resp.Json).persons @@ -245,7 +245,7 @@ import ( ) // the name of the GraphQL connection, as specified in the modus.json manifest -const hostName = "my-graphql-api" +const connection = "my-graphql-api" // declare structures used to parse the JSON document returned type Person struct { @@ -269,7 +269,7 @@ func GetPerson(name string) (*Person, error) { "name": name, } - response, _ := graphql.Execute[GetPersonResponse](hostName, statement, vars) + response, _ := graphql.Execute[GetPersonResponse](connection, statement, vars) return response.Data.Person, nil } @@ -279,7 +279,7 @@ func GetPerson(name string) (*Person, error) { import { graphql } from "@hypermode/modus-sdk-as" // the name of the GraphQL connection, as specified in the modus.json manifest -const hostName: string = "my-graphql-api" +const connection: string = "my-graphql-api" // declare classes used to parse the JSON document returned @json @@ -304,7 +304,11 @@ export function getPerson(name: string): Person | null { const vars = new graphql.Variables() vars.set("name", name) - const response = graphql.execute(hostName, statement, vars) + const response = graphql.execute( + connection, + statement, + vars, + ) return response.data!.getPerson } diff --git a/modus/sdk/dgraph.mdx b/modus/sdk/dgraph.mdx index 6dee8968..253f9059 100644 --- a/modus/sdk/dgraph.mdx +++ b/modus/sdk/dgraph.mdx @@ -41,11 +41,12 @@ The APIs in the `dgraph` namespace are below, organized by category. Execute a Dgraph query or mutation using a Dgraph Request object. ```go -function execute(hostName: string, request: Request): Response; +function execute(connectionName: string, request: Request): Response; ``` - - Name of the host, as [defined in the manifest](../app-manifest#hosts). + + Name of the connection, as [defined in the + manifest](../app-manifest#connections). @@ -58,11 +59,12 @@ function execute(hostName: string, request: Request): Response; Alter the schema of a Dgraph database. ```go -function alterSchema(hostName: string, schema: string): string; +function alterSchema(connectionName: string, schema: string): string; ``` - - Name of the host, as [defined in the manifest](../app-manifest#hosts). + + Name of the connection, as [defined in the + manifest](../app-manifest#connections). @@ -74,11 +76,12 @@ function alterSchema(hostName: string, schema: string): string; Drop an attribute from a Dgraph schema. ```go -function dropAttr(hostName: string, attr: string): string; +function dropAttr(connectionName: string, attr: string): string; ``` - - Name of the host, as [defined in the manifest](../app-manifest#hosts). + + Name of the connection, as [defined in the + manifest](../app-manifest#connections). @@ -90,11 +93,12 @@ function dropAttr(hostName: string, attr: string): string; Drop all data from a Dgraph database. ```go -function dropAll(hostName: string): string; +function dropAll(connectionName: string): string; ``` - - Name of the host, as [defined in the manifest](../app-manifest#hosts). + + Name of the connection, as [defined in the + manifest](../app-manifest#connections). ### Objects diff --git a/modus/sdk/graphql.mdx b/modus/sdk/graphql.mdx index 90c9ff9e..94d2269e 100644 --- a/modus/sdk/graphql.mdx +++ b/modus/sdk/graphql.mdx @@ -43,7 +43,7 @@ API endpoint. ```go graphql.execute ( - hostName: string, + connection: string, statement: string, variables?: Variables ): Response @@ -65,8 +65,9 @@ and maps. - - Name of the host, as [defined in the manifest](../app-manifest#hosts). + + Name of the connection, as [defined in the + manifest](../app-manifest#connection). diff --git a/modus/sdk/http.mdx b/modus/sdk/http.mdx index ab1afc52..dc860b12 100644 --- a/modus/sdk/http.mdx +++ b/modus/sdk/http.mdx @@ -10,14 +10,14 @@ JavaScript, but with some modifications to work with Hypermode Functions. As a security measure, you can only call HTTP endpoints that you - [defined in your app's manifest](../app-manifest#hosts). Any attempt to access an arbitrary URL, for a host not + [defined in your app's manifest](../app-manifest#connections). Any attempt to access an arbitrary URL, for a connection not defined in your app's manifest, results in an error. -Additionally, you should use placeholders for host secrets in the manifest, -rather than hardcoding them in your functions. Enter the values for each hosts' -secrets via the Hypermode UI. This ensures that your secrets are securely -stored, aren't committed to your repository, and aren't visible or accessible -from your functions code. +Additionally, you should use placeholders for connection secrets in the +manifest, rather than hardcoding them in your functions. Enter the values for +each connections' secrets via environment variables or the Hypermode UI. This +ensures that your secrets are securely stored, aren't committed to your +repository, and aren't visible or accessible from your functions code. @@ -68,10 +68,10 @@ http.fetch( Either a URL `string` or a [`Request`](#request) object, describing the HTTP request to make. If a `string`, the operation uses the `GET` HTTP method with no headers other -than those defined in the manifest entry of the host. +than those defined in the manifest entry of the connection. - Each request must match to a host entry in the manifest, using the `baseUrl` field. The request URL passed to the + Each request must match to a connection entry in the manifest, using the `baseUrl` field. The request URL passed to the `fetch` function (or via a `Request` object) must start with the manifest entry's `baseUrl` value to match. diff --git a/modus/sdk/postgresql.mdx b/modus/sdk/postgresql.mdx index e25350e6..ec5f0c53 100644 --- a/modus/sdk/postgresql.mdx +++ b/modus/sdk/postgresql.mdx @@ -52,14 +52,15 @@ statements that don't return data. ```go function postgresql.execute ( - hostName: string, + connectionName: string, statement: string, params?: Params ): Response ``` - - Name of the host, as [defined in the manifest](../app-manifest#hosts). + + Name of the connection, as [defined in the + manifest](../app-manifest#connections). @@ -87,7 +88,7 @@ the column names. ```go function postgresql.query( - hostName: string, + connectionName: string, statement: string, params?: Params, ): QueryResponse @@ -110,8 +111,9 @@ or [`Location`](#location) object to represent the data. - - Name of the host, as [defined in the manifest](../app-manifest#hosts). + + Name of the connection, as [defined in the + manifest](../app-manifest#connections). @@ -139,7 +141,7 @@ an identifier. ```go function postgresql.queryScalar ( - hostName: string, + connectionName: string, statement: string, params?: Params ): ScalarResponse @@ -151,8 +153,9 @@ function postgresql.queryScalar ( the type of the data returned from the SQL query. - - Name of the host, as [defined in the manifest](../app-manifest#hosts). + + Name of the connection, as [defined in the + manifest](../app-manifest#connections).