This release is a pre-release and may not be stable for production use.
Framework to create applications and model adapters for AI DIAL
pip install aidial-sdk==0.46.0.dev8 Copy PIP instructions
Applications and model adapters implemented using this framework will be compatible with AI DIAL API that was designed based on Azure OpenAI API.
Logging-related environment variables (log level, console format, and trace/span correlation) are documented in docs/logging.md.
pip install aidial-sdk Echo application example The echo application example replies to the user by repeating their last message:
# Save this as app.py import uvicorn from aidial_sdk import DIALApp from aidial_sdk.chat_completion import ChatCompletion, Request, Response # ChatCompletion is an abstract class for applications and model adapters class EchoApplication(ChatCompletion): async def chat_completion(self, request: Request, response: Response) -> None: # Get last message (the newest) from the history last_user_message = request.messages[-1] # Generate response with a single choice with response.create_single_choice() as choice: # Fill the content of the response with the last user's content choice.append_content(last_user_message.text()) # DIALApp extends FastAPI to provide a user-friendly interface for routing requests to your applications app = DIALApp() app.add_chat_completion("echo", EchoApplication()) # Run built app if __name__ == "__main__": uvicorn.run(app, port=5000) Run python3 app.py Check Send the next request:
curl http://127.0.0.1:5000/openai/deployments/echo/chat/completions \ -H "Content-Type: application/json" \ -H "Api-Key: DIAL_API_KEY" \ -d '{ "messages": [{"role": "user", "content": "Repeat me!"}] }' You will see the JSON response as:
{ "choices":[ { "index": 0, "finish_reason": "stop", "message": { "role": "assistant", "content": "Repeat me!" } } ], "usage": null, "id": "d08cfda2-d7c8-476f-8b95-424195fcdafe", "created": 1695298034, "object": "chat.completion" } Endpoints Every deployment is exposed under two base paths:
The following endpoints are served under each of them:
request.deployment_id is resolved from the first of the following sources that is set:
An /openai/v1 request with none of the headers set fails with 500 Internal Server Error.
This project requires Python ≥3.11 and Poetry ≥2.1.1 for dependency management.
Install Poetry. See the official installation guide.
(Optional) Specify custom Python or Poetry executables in .env.dev. This is useful if multiple versions are installed. By default, python and poetry are used.
POETRY_PYTHON=path-to-python-exe POETRY=path-to-poetry-exe Create and activate the virtual environment:
make init_env source .venv/bin/activate Install project dependencies (including linting, formatting, and test tools):
make install IDE configuration The recommended IDE is VSCode. Open the project in VSCode and install the recommended extensions. VS Code is configured to use the Ruff formatter.
Alternatively you can use PyCharm that has built-in Ruff support.
make format Test Run unit tests locally for available python versions:
make test Run unit tests for the specific python version:
make test PYTHON=3.11 Git hooks You may optionally install Git hooks that will automatically run the linting step on Git push. You only need to do it once for the given repository.
make install_git_hooks Clean To remove the virtual environment and build artifacts run:
make build Publish To publish the package to PyPI run:
make publish Project links Homepage Documentation Repository Key dates PyPI data Data sourced directly from PyPI's database. Released: Oct 22, 2026 Stable release available (0.45.0) 1 maintainer PyPI data Data sourced directly from PyPI's database. epam Credits Author: EPAM RAIL
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
None of the files in this release were uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.




