AI prompts
base on [deprecated] AI Gateway - core infrastructure stack for building production-ready AI Applications ![Gateway](/.github/gateway.png)
<div align="center">
### Core infrastructure stack for building production-ready AI Applications
![Lint](https://github.com/missingstudio/gateway/actions/workflows/lint.yml/badge.svg)
![Release](https://github.com/missingstudio/gateway/actions/workflows/release.yml/badge.svg)
[![License](https://img.shields.io/github/license/missingstudio/gateway)](./LICENSE)
[![Version](https://img.shields.io/github/v/release/missingstudio/gateway?logo=semantic-release)](Version)
[![Discord](https://img.shields.io/discord/1136647481128661082)](https://discord.gg/yxV58ydzV7)
[![Twitter](https://img.shields.io/twitter/follow/_missingstudio)](https://twitter.com/_missingstudio)
</div>
<br><br>
## Introduction
š A Robust cloud-native [AI Gateway](https://www.missing.studio) - core LLMOps infrastructure stack for building production-ready AI Applications. It provides an Universal API for inferencing 100+ LLMs(OpenAI, Azure, Cohere, Anthropic, HuggingFace, Replicate, Stable Diffusion).
## š Key Features
ā
Seamless Integration with **Universal API** <br>
ā
Reliable LLM Routing with **AI Router** <br>
ā
**Load balance** across multiple models and providers <br>
ā
**Automatic Retries** with exponential fallbacks <br>
ā
High availability and resiliency using **production-ready LLMOps** <br>
š§ Detailed **Usage Analytics** <br>
š§ **PII detection and masking**<br>
š§ **Simple & Semantic Caching** for cost reduction <br>
š§ **No Vendor lock-in Observability** - Logging, monitoring and tracing <br>
ā
**Enterprise-ready** with enhanced security, reliability, and scale with custom deployments support.
## Supported Providers
| | Provider | Provider Name | Support | Supported Endpoints |
|-----------------------------------------------|----------------| :---: | :---: |--------------------------|
|<img src="assets/openai.png" width=16> | OpenAI | openai | ā
| `/chat/completions`, `/chat/completions:stream` |
|<img src="assets/groq.svg" width=16> | Groq | groq | ā
| `/chat/completions`, `/chat/completions:stream` |
|<img src="assets/anyscale.png" width=16> | Anyscale | anyscale | ā
| `/chat/completions` |
|<img src="assets/deepinfra.jpeg" width=16> | Deepinfra | deepinfra | ā
| `/chat/completions` |
|<img src="assets/togetherai.svg" width=16> | Together AI | togetherai | ā
| `/chat/completions` |
> Not supported (yet): images, audio, files, fine-tunes, moderations
## Installation
AI gateway can be intall on macOS, Windows, Linux, OpenBSD, FreeBSD, and on any machine
### Binary (Cross-platform)
Download the appropriate version for your platform from [releases](https://github.com/missingstudio/gateway/releases) page. Once downloaded, the binary can be run from anywhere. Ideally, you should install it somewhere in your PATH for easy use. `/usr/local/bin` is the most probable location.
### MacOS
`gateway` is available via a Homebrew Tap, and as downloadable binary from the [releases](https://github.com/missingstudio/gateway/releases/latest) page:
```sh
brew install missingstudio/tap/gateway
```
To upgrade to the latest version:
```sh
brew upgrade gateway
```
### Linux
`gateway` is available as downloadable binaries from the [releases](https://github.com/missingstudio/gateway/releases/latest) page. Download the `.deb` or `.rpm` from the releases page and install with `sudo dpkg -i` and `sudo rpm -i` respectively.
### Windows
`gateway` is available via [scoop](https://scoop.sh/), and as a downloadable binary from the [releases](https://github.com/missingstudio/gateway/releases/latest) page:
```sh
scoop bucket add gateway https://github.com/missingstudio/scoop-bucket.git
```
To upgrade to the latest version:
```sh
scoop update gateway
```
### Docker
We provide ready to use Docker container images. To pull the latest image:
```sh
docker pull missingstudio/gateway:latest
```
To pull a specific version:
```sh
docker pull missingstudio/gateway:v0.0.1
```
### Docker compose
To start missing studio AI gateway, simply run the following command:
```sh
make up
```
> Your AI Gateway is now running on http://localhost:8080 š„
## Usage
Let's make a chat completion request to OpenAI through the AI Gateway using both REST and gRPC protocols
### Send a request using curl
```sh
curl \
--header "Content-Type: application/json" \
--header "x-ms-provider: openai" \
--header "Authorization: Bearer {{OPENAI_API_KEY}}" \
--data '{"model":"gpt-3.5-turbo","messages":[{"role":"user","content":"who are you?"}]}' \
http://localhost:8080/v1/chat/completions
```
### Send a request using grpcurl
```sh
grpcurl \
-d '{"model":"gpt-3.5-turbo","messages":[{"role":"user","content":"hi"}]}' \
-H 'x-ms-provider: openai' \
-H 'Authorization: Bearer {{OPENAI_API_KEY}}' \
-plaintext localhost:8080 llm.v1.LLMService.ChatCompletions
```
## š«¶ Contributions
AI studio is an open-source project, and contributions are welcome. If you want to contribute, you can create new features, fix bugs, or improve the infrastructure.
It's still very early days for this so your mileage will vary here and lots of things will break. But almost any contribution will be beneficial at this point. Check the [current Issues](https://github.com/missingstudio/ai/issues) to see where you can jump in!
If you've got an improvement, just send in a pull request!
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'feat(module): add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
If you've got feature ideas, simply [open a new issues](https://github.com/missingstudio/ai/issues/new)!
Please refer to the [CONTRIBUTING.md](https://github.com/missingstudio/ai/blob/main/.github/CONTRIBUTING.md) file in the repository for more information on how to contribute.
<a href="https://github.com/missingstudio/ai/graphs/contributors">
<img src="https://contrib.rocks/image?repo=missingstudio/studio" />
</a>
## License
AI Studio is [Apache 2.0](https://github.com/missingstudio/ai/blob/main/LICENSE) licensed.", Assign "at most 3 tags" to the expected json: {"id":"8609","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"