Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/endrureza/agnostic-ai
A REST API built with Go and Fiber framework that provides a flexible interface for interacting with various AI models (OpenAI GPT, Gemini, Claude).
https://github.com/endrureza/agnostic-ai
ai claude fiber gemini golang groq huggingface ollama openai
Last synced: about 1 month ago
JSON representation
A REST API built with Go and Fiber framework that provides a flexible interface for interacting with various AI models (OpenAI GPT, Gemini, Claude).
- Host: GitHub
- URL: https://github.com/endrureza/agnostic-ai
- Owner: endrureza
- Created: 2024-11-05T23:23:10.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-06T20:08:34.000Z (2 months ago)
- Last Synced: 2024-11-21T05:36:15.207Z (about 2 months ago)
- Topics: ai, claude, fiber, gemini, golang, groq, huggingface, ollama, openai
- Language: Go
- Homepage:
- Size: 4.82 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Agnostic AI (WIP - Golang Noob Here)
This rest application is built in **Go** using the **Fiber** web framework to provide a flexible and agnostic API for interacting with various AI models. The goal is to allow users to send requests, which can be processed by any AI model, whether it's a machine learning model, natural language processing model, or any other type of AI.
## Features
- **Flexible AI Integration**: The application is designed to work with any AI model, either by invoking APIs or interacting directly with pre-trained models.
- **RESTful API**: Offers a clean and simple HTTP interface to communicate with AI systems.
- **AI Agnosticism**: The API does not make assumptions about the type of AI model being used. It is up to the user to specify the model they wish to interact with.
- **Support for multiple AI models**: The system can easily be extended to support additional models in the future.## Supported AI Models
- **OpenAI GPT**
- [x] Text Generation
- [x] Image Generation
- [x] Audio Transcription
- **Gemini**
- [x] Text Generation
- [ ] Image Generation
- [ ] Audio Transcription
- **Claude**
- [x] Text Generation
- **Ollama**
- [x] Text Generation
- **Groq**
- [x] Text Generation
- [x] Audio Transcription
- **Huggingface**
- [x] Text Generation
- [x] Image Generation
- [ ] Audio Transcription## Requirements
- **Go** (1.18+ recommended)
- **Fiber** web framework
- An external AI service or a locally integrated AI model.## Installation
### Prerequisites
Ensure you have Go installed on your system. If not, you can install Go from [here](https://golang.org/dl/).
### Clone the Repository
git clone
cd agnostic-ai### Install Dependencies
go mod tidy
### Run the Application
To start the application, use the following command:
go run main.go
The application will start a web server on port `5000`.
---
## API Endpoints
### 1. **POST /chat**
This endpoint to generate chat response.
#### Request Body
```json
{
"provider": "openai",
"model": "gpt-4o-mini",
"messages": [
{
"role": "user",
"content": "Hello, how are you?"
}
]
}
```#### Response
```json
{
"text": "I'm fine thank you"
}
```#### Example Usage
```bash
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"provider": "openai",
"model": "gpt-4o-mini",
"messages": [
{
"role": "user",
"content": "Hello, how are you?"
}
]
}'
```