In this quickstart we’ll show you how to get set up with Hypermode and build an intelligent API that you can integrate into your app. You’ll learn how to use the basic components of a Modus app and how to deploy it to Hypermode.

Prerequisites

Deploying your first Hypermode project

1

Create Modus app

We built Hypermode on top of Modus, an open source, serverless framework for crafting intelligent functions and APIs, powered by WebAssembly. With Hypermode, you can deploy, secure, and observe your Modus apps.

To get started, create your first Modus app. You can import this app into Hypermode in the next step.

2

Import Modus app

You can import your Modus app via the Hypermode Console or through the terminal with Hyp CLI.

Navigate to the Hypermode Console and click New Project. When prompted, connect your GitHub account and select the repository you want to import. Once you’ve selected your repository, click “Import” to deploy your app.

When Hypermode creates your project, a runtime is initiated for your app as well as connections to any Hypermode-hosted models.

3

Explore API endpoint

After deploying your app, Hypermode lands you in your project home. You can see the status of your project and the API endpoint generated for your app.

From the Query page, you can run a sample query to verify it’s working as expected. In the following query, we’re going to use the generateText function to generate text from the shared Meta Llama 3.1 model based on the prompt “How are black holes created?”

query myPrompt {
  generateText(text:"How are black holes created?")
}
4

Observe function execution

Let’s dig deeper into the behavior of our AI service when we ran the query by looking at the Inferences page. You can see the step-by-step inference process and the inputs and outputs of the model at each step of your function. We can see in this case, it took Llama 4.4 seconds to reply to the prompt. We can also see the parameters on both the inputs and outputs.

{
  "model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful assistant. Limit your answers to 150 words."
    },
    {
      "role": "user",
      "content": "How are black holes created?"
    }
  ],
  "max_tokens": 200,
  "temperature": 0.7
}
5

Customize your function

Hypermode makes it simple to iterate quickly. Let’s make a few changes to your app to explore how easy customizing your API is.

Our API is responding using language that is more formal than we want. Let’s update our generateText function to respond using exclusively surfing analogies.

Go to the index.ts file and locate the generateText function. Modify the function to only respond like a surfer, like this:

AssemblyScript
export function generateText(text: string): string {
  const model = models.getModel<OpenAIChatModel>("text-generator")

  const input = model.createInput([
    new SystemMessage(
      "You are a helpful assistant. Only respond using surfing analogies and metaphors.",
    ),
    new UserMessage(text),
  ])

  const output = model.invoke(input)

  return output.choices[0].message.content.trim()
}

Save the file and push an update to your git repo. Hypermode automatically redeploys whenever you push an update to the target branch in your git repo. Go back to the Hypermode Console and run the same query as before. You should see the response now uses surfing analogies!

Next steps

Hypermode and Modus provide a powerful platform for building and hosting AI models, data, and logic. You now know the basics of Hypermode. There’s no limit to what you can build.

And when you’re ready to integrate Hypermode into your app, that’s as simple as calling a GraphQL endpoint.