enricoros/big-AGI

Expose API Base URL option

alexkreidler opened this issue · 2 comments

There are projects like Helicone which provide a wrapper around the OpenAI API for tracking prompts/response quality over time, error rates, understanding pricing and token usage etc. Additionally some people might implement OpenAI API-compatible open source model servers e.g. based on LLama etc. So it would be great if the user could change the baseURL in the settings to use other services.

From the Helicone docs, the implementation should be pretty easy:

import { Configuration, OpenAIApi } from "openai";

const configuration = new Configuration({
  apiKey: process.env.OPENAI_API_KEY,
  basePath: "https://oai.hconeai.com/v1",
});

const openai = new OpenAIApi(configuration);

Great idea. Tried this change, and while the app works, nothing is displayed on the Helicone dashboard.
I've asked the Helicone discord if there are issues with the /v1/chat/completions API, or with stream: true (for getting the streaming output).

https://discord.com/channels/1020597994703310878/1021699161831251968/1091100457662943263

Done and deployed. Check 7154db7 for instructions and the note about Helicone adding support for chatGPT/streaming on the dashboard.