Compare commits

..

14 commits

Author SHA1 Message Date
nsde ce2cd9469e Quicker models endpoint 2023-08-19 17:53:48 +02:00
nsde 474723c6dd Added gpt-4-32k support 2023-08-19 17:47:57 +02:00
Game_Time c0867bb865
Update tests.yml 2023-08-19 19:28:11 +05:00
Game_Time e3f938bb1a
Update users.py to enviorn 2023-08-19 19:26:37 +05:00
Game_Time 8719efd619
Update stats.py to enviorn 2023-08-19 19:26:14 +05:00
Game_Time 6d84c625a2
change .getenv to .enviorn 2023-08-19 19:25:45 +05:00
Game_Time 9be541fc45
Update tests.yml to include uvicorn 2023-08-19 19:22:50 +05:00
Game_Time 299ef72860
no need for sleep 2023-08-19 19:21:26 +05:00
nsde ee0c9e9d96 Docs 2023-08-19 16:20:16 +02:00
Game_Time 162e128366
setting enviornmental variables properly 2023-08-19 19:19:54 +05:00
Game_Time eebf72aea6
letstrythis 2023-08-19 19:16:49 +05:00
Game_Time e7198cc6e3
Update __main__.py 2023-08-19 19:12:26 +05:00
Game_Time 188a6c3b70
Update tests.yml 2023-08-19 19:11:54 +05:00
Game_Time 1d527cf18b
fix python version 2023-08-19 19:06:34 +05:00
10 changed files with 1748 additions and 1367 deletions

View file

@ -5,6 +5,9 @@ on: [pull_request]
jobs: jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
MONGO_URI: justtotes
NOVA_KEY: ${{ secrets.NOVA_KEY }}
steps: steps:
- name: Checkout code - name: Checkout code
@ -13,22 +16,17 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: 3.10 python-version: 3.x
- name: Install dependencies - name: Install dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install -r requirements.txt pip install -r requirements.txt
pip install uvicorn
- name: Start API server - name: Start API server
env:
MONGO_URI: ${{ secrets.MONGO_URI }}
TEST_NOVA_KEY: ${{ secrets.NOVA_KEY }}
run: | run: |
python run python run
- name: Wait for API server to start
run: sleep 10 # We can adjust this sleep duration as needed. idk how long the server takes to start
- name: Run tests - name: Run tests
run: python tests run: python tests

View file

@ -12,7 +12,7 @@ Reverse proxy server for "Closed"AI's API.
![Badge showing the number of forks](https://img.shields.io/github/forks/novaoss/nova-api?style=social) ![Badge showing the number of forks](https://img.shields.io/github/forks/novaoss/nova-api?style=social)
![Badge showing the number of watchers](https://img.shields.io/github/watchers/novaoss/nova-api?style=social) ![Badge showing the number of watchers](https://img.shields.io/github/watchers/novaoss/nova-api?style=social)
![Nova-API Conver/Banner Image. A picture of a galaxy with the caption "the core API server"](https://i.ibb.co/ZBhkS56/nova-api.png) ![Nova-API Conver/Banner Image - a picture of a galaxy with the caption "the core API server"](https://i.ibb.co/ZBhkS56/nova-api.png)
> "*OpenAI is very closed*" > "*OpenAI is very closed*"
> >
@ -20,13 +20,29 @@ Reverse proxy server for "Closed"AI's API.
We aim to fix that! We aim to fix that!
## Star History
###### *I founded FoxGPT (called *NovaGPT* back then)
Old, slow, deprecated* FoxGPT vs new NovaAI repository star count:
<a href="https://star-history.com/#NovaOSS/nova-api&FoxGPT/gpt&Date">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=NovaOSS/nova-api,FoxGPT/gpt&type=Date&theme=dark" />
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=NovaOSS/nova-api,FoxGPT/gpt&type=Date" />
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=NovaOSS/nova-api,FoxGPT/gpt&type=Date" />
</picture>
</a>
<img alt="'Emotional damage' meme, with a man with a worried face and the yellow caption 'emotional damage'" src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Findianmemetemplates.com%2Fwp-content%2Fuploads%2Femotional-damage-1024x575.jpg&f=1&nofb=1&ipt=b325721ee0a7b9e11603a9bd484c8042b82e1704e639887107c6ce3e0d9b389e&ipo=images" height=100>
## NovaOSS APIs ## NovaOSS APIs
Our infrastructure might seem a bit confusing, but it's actually quite simple. Just the first one really matters for you, if you want to access our AI API. The other ones are just for the team. Our infrastructure might seem a bit confusing, but it's actually quite simple. Just the first one really matters for you, if you want to access our AI API. The other ones are just for the team.
### AI API ### AI API
**Public** (everyone can use it with a valid API key) **Public** (everyone can use it with a valid API key)
Official endpoints: `https://api.nova-oss.com/v1/...` Endpoint: `https://api.nova-oss.com/v1/...`
Documentation & info: [nova-oss.com](https://nova-oss.com) Documentation & info: [nova-oss.com](https://nova-oss.com)
- Access to AI models - Access to AI models
@ -36,16 +52,24 @@ Documentation & info: [nova-oss.com](https://nova-oss.com)
### User/Account management API ### User/Account management API
**Private** (NovaOSS operators only!) **Private** (NovaOSS operators only!)
Official endpoints: `https://api.nova-oss.com/...` Endpoint: `https://api.nova-oss.com/...`
Documentation: [api.nova-oss.com/docs](https://api.nova-oss.com/docs) Documentation: [api.nova-oss.com/docs](https://api.nova-oss.com/docs)
- Access to user accounts - Access to user accounts
- Implemented in [NovaCord](https://nova-oss.com/novacord) - Implemented in [NovaCord](https://nova-oss.com/novacord)
### NovaCord Bot API
**Private** (NovaOSS operators only!)
Endpoint: `http://0.0.0.0:3224/...`
- acess to Discord server member roles (for receiving the Discord level, ...)
- hosted using [NovaCord](https://nova-oss.com/novacord)
### Website API ### Website API
**Private** (NovaOSS operators only!) **Private** (NovaOSS operators only!)
Official endpoints: `https://nova-oss.com/api/...` Endpoint: `https://nova-oss.com/api/...`
This one's code can be found in the following repository: [github.com/novaoss/nova-web](https://github.com/novaoss/nova-web) This one's code can be found in the following repository: [github.com/novaoss/nova-web](https://github.com/novaoss/nova-web)

View file

@ -18,7 +18,7 @@ UA_SIMPLIFY = {
## MONGODB Setup ## MONGODB Setup
conn = AsyncIOMotorClient(os.getenv('MONGO_URI')) conn = AsyncIOMotorClient(os.environ['MONGO_URI'])
async def _get_collection(collection_name: str): async def _get_collection(collection_name: str):
return conn[os.getenv('MONGO_NAME', 'nova-test')][collection_name] return conn[os.getenv('MONGO_NAME', 'nova-test')][collection_name]

View file

@ -23,7 +23,7 @@ class StatsManager:
""" """
def __init__(self): def __init__(self):
self.conn = AsyncIOMotorClient(os.getenv('MONGO_URI')) self.conn = AsyncIOMotorClient(os.environ['MONGO_URI'])
async def _get_collection(self, collection_name: str): async def _get_collection(self, collection_name: str):
return self.conn[os.getenv('MONGO_NAME', 'nova-test')][collection_name] return self.conn[os.getenv('MONGO_NAME', 'nova-test')][collection_name]

View file

@ -35,7 +35,7 @@ class UserManager:
""" """
def __init__(self): def __init__(self):
self.conn = AsyncIOMotorClient(os.getenv('MONGO_URI')) self.conn = AsyncIOMotorClient(os.environ['MONGO_URI'])
async def _get_collection(self, collection_name: str): async def _get_collection(self, collection_name: str):
return self.conn[os.getenv('MONGO_NAME', 'nova-test')][collection_name] return self.conn[os.getenv('MONGO_NAME', 'nova-test')][collection_name]

View file

@ -1,30 +1,6 @@
{ {
"object": "list", "object": "list",
"data": [ "data": [
{
"id": "gpt-4-0613",
"object": "model",
"created": 1686588896,
"owned_by": "openai",
"permission": [
{
"id": "modelperm-5xwZl3df52xxBXzb4cTMtGYV",
"object": "model_permission",
"created": 1690865538,
"allow_create_engine": false,
"allow_sampling": false,
"allow_logprobs": false,
"allow_search_indices": false,
"allow_view": false,
"allow_fine_tuning": false,
"organization": "*",
"group": null,
"is_blocking": false
}
],
"root": "gpt-4-0613",
"parent": null
},
{ {
"id": "text-davinci-001", "id": "text-davinci-001",
"object": "model", "object": "model",
@ -73,6 +49,30 @@
"root": "text-search-curie-query-001", "root": "text-search-curie-query-001",
"parent": null "parent": null
}, },
{
"id": "gpt-3.5-turbo",
"object": "model",
"created": 1677610602,
"owned_by": "openai",
"permission": [
{
"id": "modelperm-aRL68Vu37kh2Z0wi2tmPhGZT",
"object": "model_permission",
"created": 1692458060,
"allow_create_engine": false,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": false,
"organization": "*",
"group": null,
"is_blocking": false
}
],
"root": "gpt-3.5-turbo",
"parent": null
},
{ {
"id": "davinci", "id": "davinci",
"object": "model", "object": "model",
@ -97,6 +97,54 @@
"root": "davinci", "root": "davinci",
"parent": null "parent": null
}, },
{
"id": "gpt-3.5-turbo-0613",
"object": "model",
"created": 1686587434,
"owned_by": "openai",
"permission": [
{
"id": "modelperm-pgz6Bp5e90wX6lXRwF6SaqeZ",
"object": "model_permission",
"created": 1692458062,
"allow_create_engine": false,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": false,
"organization": "*",
"group": null,
"is_blocking": false
}
],
"root": "gpt-3.5-turbo-0613",
"parent": null
},
{
"id": "babbage",
"object": "model",
"created": 1649358449,
"owned_by": "openai",
"permission": [
{
"id": "modelperm-h574xGeqWyBeFDDKaoVTC4CO",
"object": "model_permission",
"created": 1692394129,
"allow_create_engine": false,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": false,
"organization": "*",
"group": null,
"is_blocking": false
}
],
"root": "babbage",
"parent": null
},
{ {
"id": "text-babbage-001", "id": "text-babbage-001",
"object": "model", "object": "model",
@ -152,9 +200,9 @@
"owned_by": "openai-internal", "owned_by": "openai-internal",
"permission": [ "permission": [
{ {
"id": "modelperm-a6niqBmW2JaGmo0fDO7FEt1n", "id": "modelperm-fTR6rjcTAYYKKqzDu6U8ht6h",
"object": "model_permission", "object": "model_permission",
"created": 1690930172, "created": 1692374815,
"allow_create_engine": false, "allow_create_engine": false,
"allow_sampling": true, "allow_sampling": true,
"allow_logprobs": true, "allow_logprobs": true,
@ -169,30 +217,6 @@
"root": "text-davinci-003", "root": "text-davinci-003",
"parent": null "parent": null
}, },
{
"id": "gpt-3.5-turbo-16k-0613",
"object": "model",
"created": 1685474247,
"owned_by": "openai",
"permission": [
{
"id": "modelperm-OPkkjVBEz20IWVysAi72govM",
"object": "model_permission",
"created": 1691516018,
"allow_create_engine": false,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": false,
"organization": "*",
"group": null,
"is_blocking": false
}
],
"root": "gpt-3.5-turbo-16k-0613",
"parent": null
},
{ {
"id": "davinci-similarity", "id": "davinci-similarity",
"object": "model", "object": "model",
@ -265,54 +289,6 @@
"root": "text-similarity-curie-001", "root": "text-similarity-curie-001",
"parent": null "parent": null
}, },
{
"id": "gpt-3.5-turbo-16k",
"object": "model",
"created": 1683758102,
"owned_by": "openai-internal",
"permission": [
{
"id": "modelperm-BYGQj1rUnLdY0H1Q5na1ONCB",
"object": "model_permission",
"created": 1691516057,
"allow_create_engine": false,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": false,
"organization": "*",
"group": null,
"is_blocking": false
}
],
"root": "gpt-3.5-turbo-16k",
"parent": null
},
{
"id": "text-embedding-ada-002",
"object": "model",
"created": 1671217299,
"owned_by": "openai-internal",
"permission": [
{
"id": "modelperm-F3BGCNGb0ChzFesHIYjbNYUX",
"object": "model_permission",
"created": 1690865307,
"allow_create_engine": false,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": true,
"allow_view": true,
"allow_fine_tuning": false,
"organization": "*",
"group": null,
"is_blocking": false
}
],
"root": "text-embedding-ada-002",
"parent": null
},
{ {
"id": "ada-code-search-text", "id": "ada-code-search-text",
"object": "model", "object": "model",
@ -361,6 +337,30 @@
"root": "text-search-ada-query-001", "root": "text-search-ada-query-001",
"parent": null "parent": null
}, },
{
"id": "gpt-3.5-turbo-16k-0613",
"object": "model",
"created": 1685474247,
"owned_by": "openai",
"permission": [
{
"id": "modelperm-hb67ObpoaFIKTieIMs9CqZPq",
"object": "model_permission",
"created": 1692458644,
"allow_create_engine": false,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": false,
"organization": "*",
"group": null,
"is_blocking": false
}
],
"root": "gpt-3.5-turbo-16k-0613",
"parent": null
},
{ {
"id": "gpt-4-0314", "id": "gpt-4-0314",
"object": "model", "object": "model",
@ -434,15 +434,15 @@
"parent": null "parent": null
}, },
{ {
"id": "gpt-3.5-turbo", "id": "text-curie-001",
"object": "model", "object": "model",
"created": 1677610602, "created": 1649364043,
"owned_by": "openai", "owned_by": "openai",
"permission": [ "permission": [
{ {
"id": "modelperm-zy5TOjnE2zVaicIcKO9bQDgX", "id": "modelperm-epkpKCMZ4ezExtQH69gwuIVE",
"object": "model_permission", "object": "model_permission",
"created": 1690864883, "created": 1692389420,
"allow_create_engine": false, "allow_create_engine": false,
"allow_sampling": true, "allow_sampling": true,
"allow_logprobs": true, "allow_logprobs": true,
@ -454,7 +454,31 @@
"is_blocking": false "is_blocking": false
} }
], ],
"root": "gpt-3.5-turbo", "root": "text-curie-001",
"parent": null
},
{
"id": "gpt-3.5-turbo-16k",
"object": "model",
"created": 1683758102,
"owned_by": "openai-internal",
"permission": [
{
"id": "modelperm-BPjHua9GyiXIbj7F0M6c4j0A",
"object": "model_permission",
"created": 1692458652,
"allow_create_engine": false,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": false,
"organization": "*",
"group": null,
"is_blocking": false
}
],
"root": "gpt-3.5-turbo-16k",
"parent": null "parent": null
}, },
{ {
@ -601,30 +625,6 @@
"root": "text-search-curie-doc-001", "root": "text-search-curie-doc-001",
"parent": null "parent": null
}, },
{
"id": "gpt-3.5-turbo-0301",
"object": "model",
"created": 1677649963,
"owned_by": "openai",
"permission": [
{
"id": "modelperm-7WmfQzsq5FJ92UAnn24LduAN",
"object": "model_permission",
"created": 1690842565,
"allow_create_engine": false,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": false,
"organization": "*",
"group": null,
"is_blocking": false
}
],
"root": "gpt-3.5-turbo-0301",
"parent": null
},
{ {
"id": "babbage-search-document", "id": "babbage-search-document",
"object": "model", "object": "model",
@ -649,6 +649,30 @@
"root": "babbage-search-document", "root": "babbage-search-document",
"parent": null "parent": null
}, },
{
"id": "gpt-4-32k-0314",
"object": "model",
"created": 1687979321,
"owned_by": "openai",
"permission": [
{
"id": "modelperm-lLwi9dsP7ZoboO1MHIJrIUSq",
"object": "model_permission",
"created": 1692399181,
"allow_create_engine": false,
"allow_sampling": false,
"allow_logprobs": false,
"allow_search_indices": false,
"allow_view": false,
"allow_fine_tuning": false,
"organization": "*",
"group": null,
"is_blocking": false
}
],
"root": "gpt-4-32k-0314",
"parent": null
},
{ {
"id": "babbage-code-search-text", "id": "babbage-code-search-text",
"object": "model", "object": "model",
@ -673,6 +697,30 @@
"root": "babbage-code-search-text", "root": "babbage-code-search-text",
"parent": null "parent": null
}, },
{
"id": "text-embedding-ada-002",
"object": "model",
"created": 1671217299,
"owned_by": "openai-internal",
"permission": [
{
"id": "modelperm-6xIVIGILGxg9gTVWY0SpzkFn",
"object": "model_permission",
"created": 1692313508,
"allow_create_engine": false,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": true,
"allow_view": true,
"allow_fine_tuning": false,
"organization": "*",
"group": null,
"is_blocking": false
}
],
"root": "text-embedding-ada-002",
"parent": null
},
{ {
"id": "davinci-instruct-beta", "id": "davinci-instruct-beta",
"object": "model", "object": "model",
@ -794,27 +842,27 @@
"parent": null "parent": null
}, },
{ {
"id": "babbage", "id": "gpt-4-32k",
"object": "model", "object": "model",
"created": 1649358449, "created": 1687979321,
"owned_by": "openai", "owned_by": "openai",
"permission": [ "permission": [
{ {
"id": "modelperm-vZIqTaVk4K37PezAFVHAEW3H", "id": "modelperm-isyZq5njWHQyHLCf26WtwCTY",
"object": "model_permission", "object": "model_permission",
"created": 1690943947, "created": 1692377623,
"allow_create_engine": false, "allow_create_engine": false,
"allow_sampling": true, "allow_sampling": false,
"allow_logprobs": true, "allow_logprobs": false,
"allow_search_indices": false, "allow_search_indices": false,
"allow_view": true, "allow_view": false,
"allow_fine_tuning": false, "allow_fine_tuning": false,
"organization": "*", "organization": "*",
"group": null, "group": null,
"is_blocking": false "is_blocking": false
} }
], ],
"root": "babbage", "root": "gpt-4-32k",
"parent": null "parent": null
}, },
{ {
@ -914,39 +962,15 @@
"parent": null "parent": null
}, },
{ {
"id": "whisper-1", "id": "gpt-4-32k-0613",
"object": "model", "object": "model",
"created": 1677532384, "created": 1686614047,
"owned_by": "openai-internal",
"permission": [
{
"id": "modelperm-YfjOENC37iATh6VsjLLpYdeq",
"object": "model_permission",
"created": 1691514055,
"allow_create_engine": false,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": false,
"organization": "*",
"group": null,
"is_blocking": false
}
],
"root": "whisper-1",
"parent": null
},
{
"id": "gpt-4",
"object": "model",
"created": 1687882411,
"owned_by": "openai", "owned_by": "openai",
"permission": [ "permission": [
{ {
"id": "modelperm-ufulBjea4GV50lNUk7TL02lX", "id": "modelperm-dwq8JoR7RqfTJHDVCxUe8GUB",
"object": "model_permission", "object": "model_permission",
"created": 1691192558, "created": 1692377639,
"allow_create_engine": false, "allow_create_engine": false,
"allow_sampling": false, "allow_sampling": false,
"allow_logprobs": false, "allow_logprobs": false,
@ -958,7 +982,7 @@
"is_blocking": false "is_blocking": false
} }
], ],
"root": "gpt-4", "root": "gpt-4-32k-0613",
"parent": null "parent": null
}, },
{ {
@ -986,15 +1010,15 @@
"parent": null "parent": null
}, },
{ {
"id": "ada", "id": "whisper-1",
"object": "model", "object": "model",
"created": 1649357491, "created": 1677532384,
"owned_by": "openai", "owned_by": "openai-internal",
"permission": [ "permission": [
{ {
"id": "modelperm-mEzQ65zcTNX233nYMXVZjvmy", "id": "modelperm-Qbzvr0DnIyt2HdaFiLj0P5h4",
"object": "model_permission", "object": "model_permission",
"created": 1690950776, "created": 1692314508,
"allow_create_engine": false, "allow_create_engine": false,
"allow_sampling": true, "allow_sampling": true,
"allow_logprobs": true, "allow_logprobs": true,
@ -1006,7 +1030,31 @@
"is_blocking": false "is_blocking": false
} }
], ],
"root": "ada", "root": "whisper-1",
"parent": null
},
{
"id": "gpt-4",
"object": "model",
"created": 1687882411,
"owned_by": "openai",
"permission": [
{
"id": "modelperm-cOSx57rPrEzolEUD2QSSACPS",
"object": "model_permission",
"created": 1692411452,
"allow_create_engine": false,
"allow_sampling": false,
"allow_logprobs": false,
"allow_search_indices": false,
"allow_view": false,
"allow_fine_tuning": false,
"organization": "*",
"group": null,
"is_blocking": false
}
],
"root": "gpt-4",
"parent": null "parent": null
}, },
{ {
@ -1057,6 +1105,30 @@
"root": "davinci-search-document", "root": "davinci-search-document",
"parent": null "parent": null
}, },
{
"id": "gpt-4-0613",
"object": "model",
"created": 1686588896,
"owned_by": "openai",
"permission": [
{
"id": "modelperm-kZWPVNfDP5WlVYNfcopBABZB",
"object": "model_permission",
"created": 1692411496,
"allow_create_engine": false,
"allow_sampling": false,
"allow_logprobs": false,
"allow_search_indices": false,
"allow_view": false,
"allow_fine_tuning": false,
"organization": "*",
"group": null,
"is_blocking": false
}
],
"root": "gpt-4-0613",
"parent": null
},
{ {
"id": "curie-search-query", "id": "curie-search-query",
"object": "model", "object": "model",
@ -1105,6 +1177,30 @@
"root": "babbage-similarity", "root": "babbage-similarity",
"parent": null "parent": null
}, },
{
"id": "ada",
"object": "model",
"created": 1649357491,
"owned_by": "openai",
"permission": [
{
"id": "modelperm-gUTBN2NFYvvG3UwNeDnY6EEe",
"object": "model_permission",
"created": 1692393802,
"allow_create_engine": false,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": false,
"organization": "*",
"group": null,
"is_blocking": false
}
],
"root": "ada",
"parent": null
},
{ {
"id": "ada-search-document", "id": "ada-search-document",
"object": "model", "object": "model",
@ -1177,30 +1273,6 @@
"root": "text-similarity-davinci-001", "root": "text-similarity-davinci-001",
"parent": null "parent": null
}, },
{
"id": "curie",
"object": "model",
"created": 1649359874,
"owned_by": "openai",
"permission": [
{
"id": "modelperm-0g6LBMO3cgUpTYzehqtF9G1i",
"object": "model_permission",
"created": 1690950807,
"allow_create_engine": false,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": false,
"organization": "*",
"group": null,
"is_blocking": false
}
],
"root": "curie",
"parent": null
},
{ {
"id": "curie-similarity", "id": "curie-similarity",
"object": "model", "object": "model",
@ -1225,30 +1297,6 @@
"root": "curie-similarity", "root": "curie-similarity",
"parent": null "parent": null
}, },
{
"id": "gpt-3.5-turbo-0613",
"object": "model",
"created": 1686587434,
"owned_by": "openai",
"permission": [
{
"id": "modelperm-XIXH7QF7QM60DDcON9eaGFfk",
"object": "model_permission",
"created": 1690842445,
"allow_create_engine": false,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": false,
"organization": "*",
"group": null,
"is_blocking": false
}
],
"root": "gpt-3.5-turbo-0613",
"parent": null
},
{ {
"id": "babbage-code-search-code", "id": "babbage-code-search-code",
"object": "model", "object": "model",
@ -1322,15 +1370,15 @@
"parent": null "parent": null
}, },
{ {
"id": "text-curie-001", "id": "gpt-3.5-turbo-0301",
"object": "model", "object": "model",
"created": 1649364043, "created": 1677649963,
"owned_by": "openai", "owned_by": "openai",
"permission": [ "permission": [
{ {
"id": "modelperm-vcuXVPe8oCucYrY0hxBNBXRd", "id": "modelperm-I4IcSJFYZl2fIK0DPSBkgK3d",
"object": "model_permission", "object": "model_permission",
"created": 1690915039, "created": 1691712139,
"allow_create_engine": false, "allow_create_engine": false,
"allow_sampling": true, "allow_sampling": true,
"allow_logprobs": true, "allow_logprobs": true,
@ -1342,8 +1390,320 @@
"is_blocking": false "is_blocking": false
} }
], ],
"root": "text-curie-001", "root": "gpt-3.5-turbo-0301",
"parent": null "parent": null
},
{
"id": "curie",
"object": "model",
"created": 1649359874,
"owned_by": "openai",
"permission": [
{
"id": "modelperm-cXKYjZ0dQvxFHt2rqkdTWYCz",
"object": "model_permission",
"created": 1692392433,
"allow_create_engine": false,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": false,
"organization": "*",
"group": null,
"is_blocking": false
}
],
"root": "curie",
"parent": null
},
{
"id": "davinci:ft-fixie-ai:industruous-facts-2022-10-13-01-17-15",
"object": "model",
"created": 1665623835,
"owned_by": "fixie-ai",
"permission": [
{
"id": "snapperm-qmCpjvRypiW6x5MZx8kYs6O4",
"object": "model_permission",
"created": 1665623835,
"allow_create_engine": true,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": true,
"organization": "org-om1NsPYwZBBiNRoN36vWDTrC",
"group": null,
"is_blocking": false
}
],
"root": "davinci:2020-05-03",
"parent": "davinci:2020-05-03"
},
{
"id": "davinci:ft-fixie-ai:industruous-facts-2022-10-12-23-26-28",
"object": "model",
"created": 1665617188,
"owned_by": "fixie-ai",
"permission": [
{
"id": "snapperm-kBM7YxDdBx7y0JtMpZZnTnCY",
"object": "model_permission",
"created": 1665617188,
"allow_create_engine": true,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": true,
"organization": "org-om1NsPYwZBBiNRoN36vWDTrC",
"group": null,
"is_blocking": false
}
],
"root": "davinci:2020-05-03",
"parent": "davinci:2020-05-03"
},
{
"id": "davinci:ft-fixie-ai-2022-09-16-18-23-16",
"object": "model",
"created": 1663352597,
"owned_by": "fixie-ai",
"permission": [
{
"id": "snapperm-SeuOQWbIya3BNKelkdDAi4Qq",
"object": "model_permission",
"created": 1663352597,
"allow_create_engine": true,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": true,
"organization": "org-om1NsPYwZBBiNRoN36vWDTrC",
"group": null,
"is_blocking": false
}
],
"root": "davinci:2020-05-03",
"parent": "davinci:2020-05-03"
},
{
"id": "davinci:ft-fixie-ai:promptrunner-2022-11-24-01-53-01",
"object": "model",
"created": 1669254781,
"owned_by": "fixie-ai",
"permission": [
{
"id": "snapperm-UlqCtflESCgu6wuml4ybiBTM",
"object": "model_permission",
"created": 1669254781,
"allow_create_engine": true,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": true,
"organization": "org-om1NsPYwZBBiNRoN36vWDTrC",
"group": null,
"is_blocking": false
}
],
"root": "davinci:2020-05-03",
"parent": "davinci:2020-05-03"
},
{
"id": "davinci:ft-fixie-ai:industruous-facts-2022-10-12-21-43-54",
"object": "model",
"created": 1665611034,
"owned_by": "fixie-ai",
"permission": [
{
"id": "snapperm-U6mB4aXW3ArdSIrElC4YFqtp",
"object": "model_permission",
"created": 1665611034,
"allow_create_engine": true,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": true,
"organization": "org-om1NsPYwZBBiNRoN36vWDTrC",
"group": null,
"is_blocking": false
}
],
"root": "davinci:2020-05-03",
"parent": "davinci:2020-05-03"
},
{
"id": "davinci:ft-fixie-ai:industruous-facts-fill-tokenlength-2022-10-13-23-33-54",
"object": "model",
"created": 1665704034,
"owned_by": "fixie-ai",
"permission": [
{
"id": "snapperm-viRUnGSfaVnkJVXamTPOrnmS",
"object": "model_permission",
"created": 1665704034,
"allow_create_engine": true,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": true,
"organization": "org-om1NsPYwZBBiNRoN36vWDTrC",
"group": null,
"is_blocking": false
}
],
"root": "davinci:2020-05-03",
"parent": "davinci:2020-05-03"
},
{
"id": "davinci:ft-fixie-ai:industruous-facts-fill-tokenlength-2022-10-14-00-23-52",
"object": "model",
"created": 1665707032,
"owned_by": "fixie-ai",
"permission": [
{
"id": "snapperm-BD65SMak4b2EmvLXL1whg4qB",
"object": "model_permission",
"created": 1665707032,
"allow_create_engine": true,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": true,
"organization": "org-om1NsPYwZBBiNRoN36vWDTrC",
"group": null,
"is_blocking": false
}
],
"root": "davinci:2020-05-03",
"parent": "davinci:2020-05-03"
},
{
"id": "davinci:ft-fixie-ai-2022-10-05-17-53-03",
"object": "model",
"created": 1664992384,
"owned_by": "fixie-ai",
"permission": [
{
"id": "snapperm-PdsJulMafesbkJH2UIEyxovh",
"object": "model_permission",
"created": 1664992384,
"allow_create_engine": true,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": true,
"organization": "org-om1NsPYwZBBiNRoN36vWDTrC",
"group": null,
"is_blocking": false
}
],
"root": "davinci:2020-05-03",
"parent": "davinci:2020-05-03"
},
{
"id": "davinci:ft-fixie-ai:industruous-facts-fill-no-sample-qa-2022-10-14-01-25-25",
"object": "model",
"created": 1665710725,
"owned_by": "fixie-ai",
"permission": [
{
"id": "snapperm-NFC2u7j45p63DTpoC9zM8R4X",
"object": "model_permission",
"created": 1665710725,
"allow_create_engine": true,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": true,
"organization": "org-om1NsPYwZBBiNRoN36vWDTrC",
"group": null,
"is_blocking": false
}
],
"root": "davinci:2020-05-03",
"parent": "davinci:2020-05-03"
},
{
"id": "davinci:ft-fixie-ai:industruous-facts-no-sample-qa-2022-10-14-03-14-08",
"object": "model",
"created": 1665717249,
"owned_by": "fixie-ai",
"permission": [
{
"id": "snapperm-5y121LGwoIr87Xl3qYh31JSa",
"object": "model_permission",
"created": 1665717249,
"allow_create_engine": true,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": true,
"organization": "org-om1NsPYwZBBiNRoN36vWDTrC",
"group": null,
"is_blocking": false
}
],
"root": "davinci:2020-05-03",
"parent": "davinci:2020-05-03"
},
{
"id": "davinci:ft-fixie-ai:industruous-facts-no-sample-qa-2022-10-14-22-14-09",
"object": "model",
"created": 1665785649,
"owned_by": "fixie-ai",
"permission": [
{
"id": "snapperm-mWTPRq0Qo0N1G3PDU7EZZRfU",
"object": "model_permission",
"created": 1665785649,
"allow_create_engine": true,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": true,
"organization": "org-om1NsPYwZBBiNRoN36vWDTrC",
"group": null,
"is_blocking": false
}
],
"root": "davinci:2020-05-03",
"parent": "davinci:2020-05-03"
},
{
"id": "davinci:ft-fixie-ai:picard-2022-10-06-05-10-37",
"object": "model",
"created": 1665033038,
"owned_by": "fixie-ai",
"permission": [
{
"id": "snapperm-mrAAsZbq6EKuaEcjGMIqQDzw",
"object": "model_permission",
"created": 1665033038,
"allow_create_engine": true,
"allow_sampling": true,
"allow_logprobs": true,
"allow_search_indices": false,
"allow_view": true,
"allow_fine_tuning": true,
"organization": "org-om1NsPYwZBBiNRoN36vWDTrC",
"group": null,
"is_blocking": false
}
],
"root": "davinci:2020-05-03",
"parent": "davinci:2020-05-03"
} }
] ]
} }

View file

@ -28,6 +28,9 @@ async def handle(incoming_request):
users = UserManager() users = UserManager()
path = incoming_request.url.path.replace('v1/v1/', 'v1/') path = incoming_request.url.path.replace('v1/v1/', 'v1/')
if '/models' in path:
return fastapi.responses.JSONResponse(content=models_list)
try: try:
payload = await incoming_request.json() payload = await incoming_request.json()
except json.decoder.JSONDecodeError: except json.decoder.JSONDecodeError:
@ -52,10 +55,6 @@ async def handle(incoming_request):
if ban_reason: if ban_reason:
return await errors.error(403, f'Your NovaAI account has been banned. Reason: "{ban_reason}".', 'Contact the staff for an appeal.') return await errors.error(403, f'Your NovaAI account has been banned. Reason: "{ban_reason}".', 'Contact the staff for an appeal.')
path_contains_models = '/models' in path
if path_contains_models:
return fastapi.responses.JSONResponse(content=models_list)
costs = config['costs'] costs = config['costs']
cost = costs['other'] cost = costs['other']

BIN
image-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 KiB

BIN
image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 KiB

View file

@ -109,7 +109,7 @@ def test_all():
if __name__ == '__main__': if __name__ == '__main__':
closedai.api_base = api_endpoint closedai.api_base = api_endpoint
closedai.api_key = os.getenv('TEST_NOVA_KEY') closedai.api_key = os.environ['NOVA_KEY']
HEADERS = { HEADERS = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',