This project is the server side of a simple AI text chat app.
It has a static web server and a specific web API for the AI Client.
This server can route chat requests to supported AI providers in a unified manner.
First install npm dependencies by running ./install.sh (or npm install) in a terminal.
Before running the server you need to set the AI providers to use.
Copy the file .env.example to .env and uncomment the AI providers you want to use.
You will have to put in your own secret API keys to be able to connect to paid models.
Build the server and run its tests with ./build.sh.
Start the server with ./start.sh.
Start the AI Client to access the server from that application, see: ../Client/AiClient.md
The server provides static file web hosting plus these web APIs to the client:
Returns all available providers and their suggested models to the client.
http://localhost:3000/api/providers
This request does not have any arguments.
[ { "provider": "openai", "models": [ "gpt-5.6-luna", "gpt-5.6-terra" ] },
{ "provider": "deepseek", "models": [ "deepseek-flash", "deepseek-pro" ] } ]
The response is implemented in the ST class: AiProviders
Calls the specified AI provider and model with text messages (prompts)
and returns the single text answer.
provider: the name of the AI provider, as returned by api/providers.model: the name of the model.messages: a JSON array of text messages.http://localhost:3000/api/chat?provider=openai&model=gpt-5.6-luna&messages=["Say this is a test"]
The request is implemented in the ST class: AiChatRequest
{ "success": true, "text": "This is a test." }
The response is implemented in the ST class: AiChatResponse
The following AI providers are supported:
With Ollama you can run models locally, so you don’t need API keys and buy tokens.
The Ollama server software can be downloaded here: ollama.com/download
Ollama supports open source models. A small starter model is Llama 3.2 1B.
You can download, install and run it with: ollama run llama3.2:1b
Start the Ollama server with ./startOllama.sh.
A popular AI provider, also powering ChatGPT.
You can create an account here: auth.openai.com/create-account
An open source AI provider, rivaling OpenAI.
Its API is compatible with that of OpenAI.
You can create an account here: platform.deepseek.com/sign_up
Google’s AI offering, now with improved Gemini models.
You can create an account here: aistudio.google.com
Anthropic’s Claude models are traditionally strong for development support.
But competitors are growing fast.
You can create an account here: console.anthropic.com