forked from jitsi/skynet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* master: (61 commits) deps: use pypi provided silero vad, upgrade to latest fix: remove public key validation (jitsi#123) fix: downgrade vllm (jitsi#122) feat: add fallback folder when looking up public keys (jitsi#119) fix: add ffmpeg dependency for pytorch ref: bypass queueing jobs with invalid payload (jitsi#121) fix: replace examplar usage with label for app_id feat: add instrumentation for app_id (jitsi#118) fix: re-enable vLLM multiprocessing (jitsi#116) fix: update incorrect prompt example fix: healthchecks failing due to missing internal id (jitsi#115) feat(openai-api) use Ollama for local development feat: expose openai api endpoints from vllm (jitsi#112) feat: update text hint type prompting (jitsi#111) feat: add meeting hint type and use it as default (jitsi#110) feat: enable requests batching (jitsi#109) metrics: add full duration metric metrics: add a skipped job status which will not count towards duration metrics fix: catch exceptions when echoing fails feat: add support for echoing requests (jitsi#107) ... # Conflicts: # Dockerfile # Makefile # requirements.txt
- Loading branch information
Showing
44 changed files
with
5,075 additions
and
2,410 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,5 @@ models | |
.DS_Store | ||
.env | ||
.idea | ||
llama.log | ||
dump.rdb |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
services: | ||
web: | ||
build: . | ||
environment: | ||
- BYPASS_AUTHORIZATION=true | ||
- REDIS_HOST=redis | ||
platform: linux/amd64 | ||
ports: | ||
- "8000:8000" | ||
- "8001:8001" | ||
- "8003:8003" | ||
redis: | ||
image: "redis:alpine" | ||
platform: linux/amd64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,18 @@ | ||
customer_credentials: | ||
test-customer_id: | ||
api_key: sample-api-key | ||
model_name: gpt-3.5-turbo | ||
testCustomerId: | ||
credentialsMap: | ||
AZURE_OPENAI: | ||
customerId: testCustomerId | ||
enabled: true | ||
metadata: | ||
deploymentName: gpt-4o | ||
endpoint: https://myinstance.openai.azure.com/ | ||
secret: test_secret | ||
type: AZURE_OPENAI | ||
OPENAI: | ||
customerId: testCustomerId | ||
enabled: false | ||
metadata: | ||
model: gpt-3 | ||
secret: test_secret | ||
type: OPENAI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
export class SkynetClient { | ||
constructor(options = {}) { | ||
this._baseUrl = options?.baseUrl ?? 'http://localhost:8000'; | ||
this._token = options?.token; | ||
} | ||
|
||
async summary(text, options) { | ||
return this._fetchAndPoll(`${this._baseUrl}/summaries/v1/summary`, text, options) | ||
} | ||
|
||
async actionItems(text, options) { | ||
return this._fetchAndPoll(`${this._baseUrl}/summaries/v1/action-items`, text, options) | ||
} | ||
|
||
async _fetchAndPoll(url, text, options = {}) { | ||
// Submit the job. | ||
const headers = { | ||
'Content-Type': 'application/json' | ||
}; | ||
|
||
if (this._token) { | ||
headers['Authorization'] = `Bearer ${this._token}`; | ||
} | ||
|
||
const r = await fetch(url, { | ||
method: 'POST', | ||
headers, | ||
body: JSON.stringify({ | ||
hint: options?.hint ?? 'text', | ||
text | ||
}) | ||
}); | ||
const data = await r.json(); | ||
const jobId = data.id; | ||
|
||
if (!jobId) { | ||
throw new Error('Could not create job'); | ||
} | ||
|
||
const d = createDeferred(); | ||
|
||
// Poll for it. | ||
const pHeaders = {}; | ||
|
||
if (this._token) { | ||
pHeaders['Authorization'] = `Bearer ${this._token}`; | ||
} | ||
|
||
const int = setInterval(async () => { | ||
try { | ||
const r = await fetch(`${this._baseUrl}/summaries/v1/job/${jobId}`, { | ||
headers: pHeaders | ||
}); | ||
const data = await r.json(); | ||
|
||
if (data.status === 'success') { | ||
clearInterval(int); | ||
d.resolve(data.result); | ||
} else if (data.status === 'error') { | ||
clearInterval(int); | ||
d.reject(new Error(data.result)); | ||
} | ||
} catch(_) {} | ||
}, 5 * 1000); | ||
|
||
return d.promise; | ||
} | ||
} | ||
|
||
|
||
function createDeferred() { | ||
if (Promise.withResolvers) { | ||
return Promise.withResolvers(); | ||
} | ||
|
||
const d = {}; | ||
|
||
d.promise = new Promise((resolve, reject) => { | ||
d.resolve = resolve; | ||
d.reject = reject; | ||
}) | ||
|
||
return d; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
deb https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu focal main | ||
deb-src https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu focal main | ||
deb https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy main |
Oops, something went wrong.