Comments (3)
OpenAI API : https://platform.openai.com/docs/api-reference/introduction
- Organizations and projects (optional)
curl https://api.openai.com/v1/models -H "Authorization: Bearer $OPENAI_API_KEY" -H "OpenAI-Organization: YOUR_ORG_ID" -H "OpenAI-Project: $PROJECT_ID"
- List models: GET https://api.openai.com/v1/models
curl https://api.openai.com/v1/models -H "Authorization: Bearer $OPENAI_API_KEY"
Response json data:
{
"data": [
{
"id": "model-id-0",
"object": "model",
"owned_by": "organization-owner",
"permission": [...]
},
{
"id": "model-id-1",
"object": "model",
"owned_by": "organization-owner",
"permission": [...]
},
{
"id": "model-id-2",
"object": "model",
"owned_by": "openai",
"permission": [...]
},
],
"object": "list"
}
- Completions: POST https://api.openai.com/v1/completions
curl https://api.openai.com/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Say this is a test!"}],
"temperature": 0.7
}'
Response json data:
{
"id":"chatcmpl-abc123",
"object":"chat.completion",
"created":1677858242,
"model":"gpt-3.5-turbo-0301",
"usage":{
"prompt_tokens":13,
"completion_tokens":7,
"total_tokens":20
},
"choices":[
{
"message":{
"role":"assistant",
"content":"\n\nThis is a test!"
},
"finish_reason":"stop",
"index":0
}
]
}
- streaming: Post https://api.openai.com/v1/chat/completions
curl https://api.openai.com/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "gpt-3.5-turbo",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hello!"
}
],
"stream": true
}'
Response json data:
{"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0125", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"role":"assistant","content":""},"logprobs":null,"finish_reason":null}]}
{"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0125", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"content":"Hello"},"logprobs":null,"finish_reason":null}]}
....
{"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0125", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}]}
from llm-inference.
Sould be work when set OpenSDK endpoint.
from llm-inference.
done.
from llm-inference.
Related Issues (20)
- Model streaming API enhancement HOT 2
- Support load Qwen1.5-72B-Chat-GPTQ-Int4 by auto_gptq HOT 1
- Failed to load qwen1_5-72b-chat-q5_k_m.gguf HOT 3
- vllm cannot address "runtime_env" HOT 1
- support "revision" in yaml defination HOT 2
- API server startup slow HOT 1
- Model inference cross multi-nodes
- Requested tokens (817) exceed context window of 512 HOT 3
- The usage introduction of `llm-serve` is not correct in quick_start.md
- Add inference SDK for invoke
- enable reset generate config on fly
- vllm, gguf, llamacpp, these integration cannot address local path of model
- avoid to ping huggingface when start serving to speed up the deployement
- vllm implements cannot support download model from repo besides hg HOT 2
- GGUF implements will make duplicate copy since cannot detect config.json file in the cache folder
- Error happen when do inference for wukong dtype=bfloat16 of use default transformer pipeline load model HOT 1
- Upgrade ray 2.20.0 HOT 1
- Auto load models from ./models for when api server start HOT 1
- Api server was blocked when LLM deployment scaling config beyond the cluster resouces
- Api server blocked when one request is in-process HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from llm-inference.