Git push get an AI API

Ryan Fox-Tyler, Hypermode45:01 · Aug 2024 · 1,632 views
Thumbnail for Git push get an AI API Watch on YouTube
TL;DR
  1. 1

    AI features can be assembled from ordinary functions, models, data sources, and connections rather than built as one opaque system.

  2. 2

    A GitHub issue triage app can classify issues, summarize repository trends, and find similar issues with natural-language search.

  3. 3

    Hypermode lets developers deploy functions by pushing code, provision hosted models, generate a GraphQL API, and inspect model calls and logs.

Summary

Ryan Fox-Tyler presents Hypermode through a live workshop. He starts with Hyper Categories, a multiplayer version of Categories that uses AI to validate answers, group similar responses, and produce a leaderboard. The example shows why AI applications need traditional programming alongside models. A dictionary check catches a case where the model accepts "P doctor" as an occupation beginning with P. The workshop then applies the same building blocks to GitHub issue triage. A trend-summary function fetches issues through GitHub's API and asks GPT-4 to summarize repository trends. A classification function uses a small Hugging Face model trained on GitHub issues. Finally, the group adds a collection, an embedding model, and a search function that returns the three most similar issues. Fox-Tyler also demonstrates deployment through Git push, generated GraphQL types, inference history, token counts, and function logs. The workshop is practical, though the live demo is rushed and exposes several rough edges in the newly launched platform.

Key ideas
05:40

AI features combine models with ordinary programming

The Hyper Categories game validates answers in several stages. A model checks whether an answer matches the category, while traditional code validates the starting letter and a dictionary catches malformed answers. Fox-Tyler gives the example of entering "P doctor" for the occupation category when the letter is P. The model considered that valid, so the team added dictionary validation. The system then clusters responses so "table" and "tables" count as the same answer. He presents this mixture of filtering, scoring, similarity matching, and leaderboard logic as the normal way to assemble an AI application.

07:23

GitHub issues provide useful open data for an AI demo

The workshop moves from the game to GitHub issue triage because open-source repositories provide data that is easy to access. Fox-Tyler describes several possible features: identifying what type of issue was submitted, finding similar issues that may already exist, spotting patterns, and summarizing trends in a repository. The same approach could apply to customer records, product records, or other data inside an application. Participants deploy a starter template, connect a GitHub repository, clone the code, install dependencies, and build the functions locally before pushing them to Hypermode.

15:55

Trend summaries use a normal API call followed by a model call

The trend-summary function first fetches GitHub issues with an ordinary HTTP REST request. The helper receives parameters, sends headers, and returns an array of issue data. The function then constructs a prompt containing timestamps, user handles, issue titles, and other issue text. It asks GPT-4 for the overall trend in the repository. Fox-Tyler calls this a basic retrieval-augmented generation use case because the application retrieves data and passes it to a model for analysis. Hypermode's model interface supplies typed options such as messages and temperature.

20:28

A shared model interface makes swapping models easier

Fox-Tyler says models are not fully interchangeable. Prompts, outputs, hyperparameters, and API controls vary between providers and model families. Hypermode wraps these differences in model interfaces, so a developer can select a model and access its supported options through editor completion and type checking. The example uses an OpenAI chat model, but the same style is available for other supported models. If a model is not supported, developers can implement the interface themselves by inheriting from a base class. The aim is to avoid forcing every model choice at the start of an application.

22:02

Deployment turns exported functions into a GraphQL API

After the trend-summary function is written, Fox-Tyler deploys it with the sequence "git commit" and "git push." Hypermode picks up the push and rolls the code into the project. The platform generates a GraphQL schema from the exported function and its declared inputs, so the presenter can call the function without writing a GraphQL schema. The resulting endpoint can be used from the Hypermode console, Postman, a GraphQL client library, or curl. He also explains that structured output types appear in the generated schema, while input types in the current system are limited to scalars or arrays.

25:25

Inference history gives developers a record of model calls

The platform's inference tab records each model run. Developers can inspect how long a call took, what input was sent, and what output came back. Fox-Tyler says the record also includes information such as token usage, even when the application does not store that value itself. Function logs provide another view of execution, including system logs and overlapping function runs. This visibility matters when a function invokes several models or when calls are triggered dynamically from a frontend. It gives developers a place to inspect the actual prompts and responses while they iterate.

27:22

A small purpose-built classifier can label GitHub issues

The classification function accepts an issue title, description, and ID. It builds a simple input by combining the title and description, then sends it to a Hugging Face model called "thebert-mnli-GitHub-issues." The model is described as community contributed and pretrained on GitHub issues. Its task is to classify an issue as an issue, bug, feature request, or question. Fox-Tyler stresses that this example does not require training a model from scratch or choosing a large general-purpose model. He also shows that batch classification can send multiple strings in one model call.

33:27

Natural-language search needs a collection and a shared embedding function

To find repeated or related issues, the workshop adds a Hypermode collection and an embeddings model from Hugging Face, using MiniLM from sentence-transformers. The collection provides an in-memory key-value store with an index for vector search. An embedder function converts text into arrays of vectors, and a search function queries the collection for the top three results. When data is uploaded or added through code, Hypermode automatically runs the embedding function. The search uses the same embedding setup, so the stored issues and the new query are represented in a compatible way. The result can return structured similar-issue objects and generated GraphQL types.

"We really see this as illustrating the way we see the world of AI applications are to develop. It's this mix of models and traditional programming paradigms that come together that actually make it useful."06:12
Who should watch
  • You are adding classification, summarization, or semantic search to an existing app and want to see how the pieces fit together without redesigning the whole application.
  • Your team needs a practical example of combining model calls with validation, API requests, collections, and ordinary application code.
  • You want to compare hosted model execution with external APIs and see what deployment, logs, inference history, and generated GraphQL look like in practice.