-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
1,105 additions
and
10 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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#! /bin/sh | ||
# | ||
# format.sh | ||
pyink agent kernel chat up sdk examples | ||
pyink agent kernel chat up sdk examples serving |
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 |
---|---|---|
|
@@ -21,4 +21,8 @@ tiktoken | |
fastapi | ||
uvicorn | ||
pytest-mock | ||
pydantic-settings | ||
sse-starlette | ||
starlette-context | ||
llama-cpp-python | ||
|
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 @@ | ||
the serving module for octogen |
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,32 @@ | ||
# Copyright (C) 2023 dbpunk.com Author imotai <codego.me@gmail.com> | ||
# SPDX-FileCopyrightText: 2023 imotai <jackwang@octogen.dev> | ||
# SPDX-FileContributor: imotai | ||
# | ||
# SPDX-License-Identifier: Elastic-2.0 | ||
|
||
""" """ | ||
from setuptools import setup, find_packages | ||
|
||
setup( | ||
name="og_serving", | ||
version="0.3.6", | ||
description="Open source code interpreter agent", | ||
author="imotai", | ||
author_email="wangtaize@dbpunk.com", | ||
url="https://github.com/dbpunk-labs/octogen", | ||
long_description=open("README.md").read(), | ||
long_description_content_type="text/markdown", | ||
packages=[ | ||
"og_serving", | ||
], | ||
package_dir={ | ||
"og_serving": "src/og_serving", | ||
}, | ||
install_requires=["fastapi", "pydantic_settings"], | ||
package_data={}, | ||
entry_points={ | ||
"console_scripts": [ | ||
"og_serving_http_server = og_serving.http_serving:run_serving", | ||
] | ||
}, | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# vim:fenc=utf-8 | ||
|
||
# SPDX-FileCopyrightText: 2023 imotai <jackwang@octogen.dev> | ||
# SPDX-FileContributor: imotai | ||
# | ||
# SPDX-License-Identifier: Elastic-2.0 | ||
|
||
""" """ | ||
import os | ||
import sys | ||
import uvicorn | ||
import logging | ||
from dotenv import dotenv_values | ||
from .server_app import create_app, Settings | ||
|
||
config = dotenv_values(".env") | ||
|
||
settings = Settings(_env_file="model.env") | ||
LOG_LEVEL = ( | ||
logging.DEBUG if config.get("log_level", "info") == "debug" else logging.INFO | ||
) | ||
|
||
logging.basicConfig( | ||
level=LOG_LEVEL, | ||
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", | ||
handlers=[logging.StreamHandler(sys.stdout)], | ||
) | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
def run_serving(): | ||
app = create_app(settings) | ||
host = config.get("host", "localhost") | ||
port = int(config.get("port", "9517")) | ||
logger.info(f"Starting serving at {host}:{port}") | ||
uvicorn.run(app, host=host, port=port) |
Oops, something went wrong.