This release is a pre-release and may not be stable for production use.
llm-chat-completions-server
LLM plugin to serve an OpenAI Chat Completions API endpoint
Installation
Install this plugin in the same environment as LLM.
llm install llm-chat-completions-server
Usage
Start the server:
llm chat-completions-server
It listens on http://127.0.0.1:8002 by default. Use -p or --port to
select a different port:
llm chat-completions-server --port 9000
For development, --reload restarts the server when Python files change:
llm chat-completions-server --reload
The server does not require an API token. Models may still need credentials
configured on the server using the usual llm keys set commands.
List models
GET /v1/models lists the models registered with LLM that provide an async
implementation. Sync-only models are not served.
curl http://127.0.0.1:8002/v1/models
Create a chat completion
POST /v1/chat/completions implements the classic OpenAI Chat Completions
request and response format using LLM's async model API.
curl -s http://127.0.0.1:8002/v1/chat/completions \
-H 'Content-Type: application/json' \
-d '{
"model": "gemini/gemini-2.5-flash",
"messages": [
{"role": "user", "content": "Tell me a short joke about pelicans"}
],
"stream": false
}'
Streaming responses use server-sent events and finish with data: [DONE]:
curl -N http://127.0.0.1:8002/v1/chat/completions \
-H 'Content-Type: application/json' \
-d '{
"model": "gemini/gemini-2.5-flash",
"messages": [
{"role": "user", "content": "Count to three"}
],
"stream": true,
"stream_options": {"include_usage": true}
}'
The endpoint accepts system, developer, user, assistant and tool messages,
including image URL content and function tool calls. Sampling options are
passed through when they are supported by the selected LLM model. Only
n=1 is currently supported.
Completed responses—including streamed responses—are written to LLM's normal
logs.db. This populates both the legacy response tables and the current
content-addressed message and turn tables. The global llm logs off setting
is respected.
Development
This checkout is configured to use the editable in-development LLM checkout
at ~/dev/llm. Run the tests with:
cd llm-chat-completions-server
uv run pytest
To run the server with additional model plugins under development:
uv run \
--with-editable . \
--with-editable ~/dev/llm \
--with-editable ~/dev/ecosystem/llm-gemini \
--with-editable ~/dev/ecosystem/llm-anthropic \
--with-editable ~/dev/ecosystem/llm-apple-foundation \
llm chat-completions-server --reload
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llm_chat_completions_server-0.1a0.tar.gz.
File metadata
- Download URL: llm_chat_completions_server-0.1a0.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c70ef5fab6ef9cf3330b4c335f0650f2daefc7bf12e2447dbb657ff9e6efd23
|
|
| MD5 |
0278dfa91ba726cbd788ba3bd9175094
|
|
| BLAKE2b-256 |
368a10251f5d45e64c445265e742f880772df483d19b5e7cad717aa7a70a5de0
|
Provenance
The following attestation bundles were made for llm_chat_completions_server-0.1a0.tar.gz:
Publisher:
publish.yml on simonw/llm-chat-completions-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_chat_completions_server-0.1a0.tar.gz -
Subject digest:
3c70ef5fab6ef9cf3330b4c335f0650f2daefc7bf12e2447dbb657ff9e6efd23 - Sigstore transparency entry: 2291611182
- Sigstore integration time:
-
Permalink:
simonw/llm-chat-completions-server@7ba6fb9a85ad5e6e8f9f5a575941efee0f64e7d8 -
Branch / Tag:
refs/tags/0.1a0 - Owner: https://github.com/simonw
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7ba6fb9a85ad5e6e8f9f5a575941efee0f64e7d8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file llm_chat_completions_server-0.1a0-py3-none-any.whl.
File metadata
- Download URL: llm_chat_completions_server-0.1a0-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46a864d8a152019cf105765c5b18429fadfdc9061cd1cab38f537512a4b8ad92
|
|
| MD5 |
7350e3311435ced70c169ef7364f17df
|
|
| BLAKE2b-256 |
9a7823c0334e9b006c7057793cf7e0111745e1e9abb3702448afaad976ad46f6
|
Provenance
The following attestation bundles were made for llm_chat_completions_server-0.1a0-py3-none-any.whl:
Publisher:
publish.yml on simonw/llm-chat-completions-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_chat_completions_server-0.1a0-py3-none-any.whl -
Subject digest:
46a864d8a152019cf105765c5b18429fadfdc9061cd1cab38f537512a4b8ad92 - Sigstore transparency entry: 2291611195
- Sigstore integration time:
-
Permalink:
simonw/llm-chat-completions-server@7ba6fb9a85ad5e6e8f9f5a575941efee0f64e7d8 -
Branch / Tag:
refs/tags/0.1a0 - Owner: https://github.com/simonw
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7ba6fb9a85ad5e6e8f9f5a575941efee0f64e7d8 -
Trigger Event:
release
-
Statement type: