Skip to content

Commit

Permalink
change models api (#54)
Browse files Browse the repository at this point in the history
Co-authored-by: huhuanzhang <[email protected]>
  • Loading branch information
hhz-saner and huhuanzhang authored Sep 9, 2024
1 parent 0685e8c commit aef1455
Showing 1 changed file with 88 additions and 35 deletions.
123 changes: 88 additions & 35 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,12 @@ func (s *ProxyService) models(c *gin.Context) {
"data": []gin.H{
{
"capabilities": gin.H{
"family": "gpt-3.5-turbo",
"object": "model_capabilities",
"type": "chat",
"family": "gpt-3.5-turbo",
"limits": gin.H{"max_prompt_tokens": 12288},
"object": "model_capabilities",
"supports": gin.H{"tool_calls": true},
"tokenizer": "cl100k_base",
"type": "chat",
},
"id": "gpt-3.5-turbo",
"name": "GPT 3.5 Turbo",
Expand All @@ -235,20 +238,26 @@ func (s *ProxyService) models(c *gin.Context) {
},
{
"capabilities": gin.H{
"family": "gpt-3.5-turbo",
"object": "model_capabilities",
"type": "chat",
"family": "gpt-3.5-turbo",
"limits": gin.H{"max_prompt_tokens": 12288},
"object": "model_capabilities",
"supports": gin.H{"tool_calls": true},
"tokenizer": "cl100k_base",
"type": "chat",
},
"id": "gpt-3.5-turbo-0613",
"name": "GPT 3.5 Turbo (2023-06-13)",
"name": "GPT 3.5 Turbo",
"object": "model",
"version": "gpt-3.5-turbo-0613",
},
{
"capabilities": gin.H{
"family": "gpt-4",
"object": "model_capabilities",
"type": "chat",
"family": "gpt-4",
"limits": gin.H{"max_prompt_tokens": 20000},
"object": "model_capabilities",
"supports": gin.H{"tool_calls": true},
"tokenizer": "cl100k_base",
"type": "chat",
},
"id": "gpt-4",
"name": "GPT 4",
Expand All @@ -257,53 +266,95 @@ func (s *ProxyService) models(c *gin.Context) {
},
{
"capabilities": gin.H{
"family": "gpt-4",
"object": "model_capabilities",
"type": "chat",
"family": "gpt-4",
"limits": gin.H{"max_prompt_tokens": 20000},
"object": "model_capabilities",
"supports": gin.H{"tool_calls": true},
"tokenizer": "cl100k_base",
"type": "chat",
},
"id": "gpt-4-0613",
"name": "GPT 4 (2023-06-13)",
"name": "GPT 4",
"object": "model",
"version": "gpt-4-0613",
},
{
"capabilities": gin.H{
"family": "gpt-4-turbo",
"object": "model_capabilities",
"type": "chat",
"family": "gpt-4-turbo",
"limits": gin.H{"max_prompt_tokens": 20000},
"object": "model_capabilities",
"supports": gin.H{"parallel_tool_calls": true, "tool_calls": true},
"tokenizer": "cl100k_base",
"type": "chat",
},
"id": "gpt-4-0125-preview",
"name": "GPT 4 Turbo (2024-01-25 Preview)",
"name": "GPT 4 Turbo",
"object": "model",
"version": "gpt-4-0125-preview",
},
{
"capabilities": gin.H{
"family": "text-embedding-ada-002",
"object": "model_capabilities",
"type": "embeddings",
"family": "gpt-4o",
"limits": gin.H{"max_prompt_tokens": 20000},
"object": "model_capabilities",
"supports": gin.H{"parallel_tool_calls": true, "tool_calls": true},
"tokenizer": "o200k_base",
"type": "chat",
},
"id": "text-embedding-ada-002",
"name": "Embedding V2 Ada",
"id": "gpt-4o",
"name": "GPT 4o",
"object": "model",
"version": "text-embedding-ada-002",
"version": "gpt-4o-2024-05-13",
},
{
"capabilities": gin.H{
"family": "gpt-4o",
"limits": gin.H{"max_prompt_tokens": 20000},
"object": "model_capabilities",
"supports": gin.H{"parallel_tool_calls": true, "tool_calls": true},
"tokenizer": "o200k_base",
"type": "chat",
},
"id": "gpt-4o-2024-05-13",
"name": "GPT 4o",
"object": "model",
"version": "gpt-4o-2024-05-13",
},
{
"capabilities": gin.H{
"family": "gpt-4o",
"limits": gin.H{"max_prompt_tokens": 20000},
"object": "model_capabilities",
"supports": gin.H{"parallel_tool_calls": true, "tool_calls": true},
"tokenizer": "o200k_base",
"type": "chat",
},
"id": "gpt-4-o-preview",
"name": "GPT 4o",
"object": "model",
},
{
"capabilities": gin.H{
"family": "text-embedding-ada-002",
"object": "model_capabilities",
"type": "embeddings",
"family": "text-embedding-ada-002",
"limits": gin.H{"max_inputs": 256},
"object": "model_capabilities",
"supports": gin.H{},
"tokenizer": "cl100k_base",
"type": "embeddings",
},
"id": "text-embedding-ada-002-index",
"name": "Embedding V2 Ada (Index)",
"id": "text-embedding-ada-002",
"name": "Embedding V2 Ada",
"object": "model",
"version": "text-embedding-ada-002",
},
{
"capabilities": gin.H{
"family": "text-embedding-3-small",
"object": "model_capabilities",
"type": "embeddings",
"family": "text-embedding-3-small",
"limits": gin.H{"max_inputs": 256},
"object": "model_capabilities",
"supports": gin.H{"dimensions": true},
"tokenizer": "cl100k_base",
"type": "embeddings",
},
"id": "text-embedding-3-small",
"name": "Embedding V3 small",
Expand All @@ -312,9 +363,11 @@ func (s *ProxyService) models(c *gin.Context) {
},
{
"capabilities": gin.H{
"family": "text-embedding-3-small",
"object": "model_capabilities",
"type": "embeddings",
"family": "text-embedding-3-small",
"object": "model_capabilities",
"supports": gin.H{"dimensions": true},
"tokenizer": "cl100k_base",
"type": "embeddings",
},
"id": "text-embedding-3-small-inference",
"name": "Embedding V3 small (Inference)",
Expand Down

0 comments on commit aef1455

Please sign in to comment.