diff --git a/configure-environment.mdx b/configure-environment.mdx index a690158d..512cffdf 100644 --- a/configure-environment.mdx +++ b/configure-environment.mdx @@ -1,6 +1,31 @@ --- title: Configure Environnment -description: "" +description: "Configure the project's environment in Hypermode Console" --- -- host secrets - shared vs. dedicated models - scaling +## Host Secrets + +In your project dashboard, navigate to Settings -> Hosts. Here you can configure secrets that are used for connecting to external hosts. + +## Shared vs Dedicated Models + +By default, models hosted on Hypermode run on a shared instance. All new projects use shared models. You can specify `"dedicated": true` in your `hypermode.json` to enable dedicated models: + +```json +{ + ... + "models": { + "text-generator": { + "sourceModel": "meta-llama/Meta-Llama-3.1-8B-Instruct", + "provider": "hugging-face", + "host": "hypermode", + "dedicated": true + } + } + ... +} +``` + +## Scaling + +Coming soon diff --git a/images/observe-functions/function-runs.png b/images/observe-functions/function-runs.png new file mode 100644 index 00000000..c3e5f0bf Binary files /dev/null and b/images/observe-functions/function-runs.png differ diff --git a/images/observe-functions/inference-history.png b/images/observe-functions/inference-history.png new file mode 100644 index 00000000..1c465e63 Binary files /dev/null and b/images/observe-functions/inference-history.png differ diff --git a/integrate-api.mdx b/integrate-api.mdx index 509cadee..c5c8fea8 100644 --- a/integrate-api.mdx +++ b/integrate-api.mdx @@ -1,6 +1,39 @@ --- title: Integrate API -description: "" +description: "Use the project's API endpoint and token" --- -API endpoint + keys +## API Endpoint + +You can find your project's API endpoint in your project dashboard. The endpoint follows this format: `https://-.hypermode.app/graphql`. + +## API Token + +In your project dashboard, navigate to Settings -> API Keys to find your API token. + +You can access the API by passing the API token in the `Authorization` header. Here's an example using the `fetch` API in JavaScript: + + + +```javascript index.js +const endpoint = ""; // your API endpoint +const key = ""; // your API key +// your graphql query +const query = `query { + ... +}`; + +const response = await fetch(endpoint, { + method: "POST", + headers: { + "Content-Type": "application/json", + Authorization: key, + }, + body: JSON.stringify({ + query: query, + }), +}); +const data = await response.json(); +``` + + diff --git a/observe-functions.mdx b/observe-functions.mdx index 7911ae8b..71409809 100644 --- a/observe-functions.mdx +++ b/observe-functions.mdx @@ -5,6 +5,44 @@ description: "Understand what's happening within your functions" - function invocation logs - model inferences -When you invoke a function within your project, the service records each execution. In addition to duration, logs are available for each execution to enable integrated debugging. +When you invoke a function within your project, Hypermode records the execution. In addition to duration, logs are available for each execution to enable integrated debugging. -To access the run history, navigate to the Function Runs tab of your project within the Hypermode Console. +## Function Runs + +In your function code, you can add logs to help debug your functions: + + + +```typescript index.ts +console.log("This is a simple log message."); +console.debug("This is a debug message."); +console.info("This is an info message."); +console.warn("This is a warning message."); +console.error("This is an error message."); +``` + +```go main.go +package main + +import ( + "github.com/hypermodeinc/modus/sdk/go/pkg/console" +) + +console.Log("This is a simple log message.") +console.Debug("This is a debug message.") +console.Info("This is an info message.") +console.Warn("This is a warning message.") +console.Error("This is an error message.") +``` + + + +In your project dashboard, navigate to the Function Runs tab to view execution logs of your functions. + +![function runs](images/observe-functions/function-runs.png) + +## Inference History + +For each model invocation, Hypermode records the model inference. This includes the input and output of the model, as well as the timestamp and duration of the inference. + +![inference history](images/observe-functions/inference-history.png) diff --git a/styles/config/vocabularies/general/accept.txt b/styles/config/vocabularies/general/accept.txt index 3bb68798..6caaceab 100644 --- a/styles/config/vocabularies/general/accept.txt +++ b/styles/config/vocabularies/general/accept.txt @@ -40,3 +40,9 @@ timeEnd triaging upsert UUID +Inference History +Function Runs +API Endpoint +API Token +Shared vs Dedicated Models +Host Secrets