Hacker News new | ask | show | jobs
Show HN: Serverless GPT Functions that can call any API (functionhub.net)
2 points by mrpostman18 997 days ago
Hi HN,

I’ve been working on FunctionHub for the past few months and I’m excited to share it here. FunctionHub lets you write code in TypeScript and have GPT 3.5/4 call it. Your code can make HTTP requests to any API out there, scrape the web, or make database queries. GPT can then use the results to generate content, analyze data, or make further transactions to mutate objects.

FunctionHub works by generating OpenAPI specs from your functions and passing them along to GPT. When GPT "invokes" your function, FunctionHub executes your code and re-prompts GPT with the result. It also supports chained function calls for complex tasks within a specific application domain.

I wanted FunctionHub to be simple yet powerful enough for AI and general-purposes applications. So I built a VSCode-like editor with interactive API, NPM support, public functions that can be forked, and dynamic REST endpoints for your functions.

I’d love to hear any feedback, suggestions, or problems you might have!

Website: https://functionhub.net

Docs: https://functionhub.net/docs

Thanks!

1 comments

I have to say, this is pretty neat! Most examples of this that I have seen have been in Python. But the flexibility of REST opens up a lot of possibilities.

One thing I’m curious about is if function calling can reduce token usage and by how much. GPT 4 is quite expensive for any large app with a lot of usage.

Hey, thanks!

It can definitely reduce token usage significantly, depending on your use case. In the example here https://functionhub.net/docs/examples/new-york-times, it fetches NYT article summaries and does some grouping. You can probably send the html page in your prompt and ask GPT to parse it for you. The html page is about 10K tokens so it would exceed the the 4K and 8K token limits. So offloading the task of parsing this to a function reduces the usage by 80% in the example.

Not all tasks require LLMs. The great thing about function calling is that you can just offload all preprocessing to your functions.