Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
6ec65f45
Unverified
Commit
6ec65f45
authored
May 09, 2024
by
Liangsheng Yin
Committed by
GitHub
May 09, 2024
Browse files
Make public APIs more standard. (#416)
parent
e2c31fca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
6 deletions
+55
-6
python/sglang/__init__.py
python/sglang/__init__.py
+54
-1
python/sglang/api.py
python/sglang/api.py
+1
-5
No files found.
python/sglang/__init__.py
View file @
6ec65f45
__version__
=
"0.1.14"
from
sglang.api
import
*
# SGL API Components
from
sglang.api
import
(
Runtime
,
assistant
,
assistant_begin
,
assistant_end
,
flush_cache
,
function
,
gen
,
gen_int
,
gen_string
,
get_server_args
,
image
,
select
,
set_default_backend
,
system
,
user
,
user_begin
,
user_end
,
)
# SGL Backends
from
sglang.backend.anthropic
import
Anthropic
from
sglang.backend.openai
import
OpenAI
from
sglang.backend.runtime_endpoint
import
RuntimeEndpoint
from
sglang.backend.vertexai
import
VertexAI
# Global Configurations
from
sglang.global_config
import
global_config
# public APIs management
__all__
=
[
"global_config"
,
"Anthropic"
,
"OpenAI"
,
"RuntimeEndpoint"
,
"VertexAI"
,
"function"
,
"Runtime"
,
"set_default_backend"
,
"flush_cache"
,
"get_server_args"
,
"gen"
,
"gen_int"
,
"gen_string"
,
"image"
,
"select"
,
"system"
,
"user"
,
"assistant"
,
"user_begin"
,
"user_end"
,
"assistant_begin"
,
"assistant_end"
,
]
python/sglang/api.py
View file @
6ec65f45
"""Public API"""
"""
Some
Public API
Definitions
"""
import
re
from
typing
import
Callable
,
List
,
Optional
,
Union
from
sglang.backend.anthropic
import
Anthropic
from
sglang.backend.base_backend
import
BaseBackend
from
sglang.backend.openai
import
OpenAI
from
sglang.backend.runtime_endpoint
import
RuntimeEndpoint
from
sglang.backend.vertexai
import
VertexAI
from
sglang.global_config
import
global_config
from
sglang.lang.ir
import
(
SglExpr
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment