LocalStack OpenAI Extension
This is a LocalStack extension that allows you to mock the OpenAI API for testing and development purposes. It provides a convenient way to interact with a mock OpenAI service locally using LocalStack.
Installation
You can install this extension directly using the LocalStack extension manager:
localstack extensions install localstack-extension-openai
Using
Once installed, you can access the OpenAI Mock API through localhost:4510/v1.
Example
import openai
openai.organization = "org-test"
openai.api_key = "test"
openai.api_base = "http://localhost:4510/v1"
completion = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
]
)
print(completion.choices)
Coverage
- Chat completion
- Engines Listing
- Transcribe
- Translate
- Generate Image URL
- Generate Image Base64
- Embeddings
- Fine Tuning
- Files
- Moderations
Authors
Cristopher Pinzon cristopher.pinzon@localstack.cloud
Licensing
- The extension code is licensed under the Apache 2.0 License
Thank you for using the LocalStack OpenAI Extension!
Metadata
Release files for localstack-extension-openai 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| localstack_extension_openai-0.1.0.tar.gz | 5.5 kB | Without provenance | Details for localstack_extension_openai-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| localstack_extension_openai-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for localstack_extension_openai-0.1.0-py3-none-any.whl |
Total release size: 11.2 kB
Release files / localstack_extension_openai-0.1.0.tar.gz
| Download URL | localstack_extension_openai-0.1.0.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
447c53716f3c6bd028c56f7c318a3b356943df928a7722fb1e6bedde2ae34bd9
|
|
BLAKE2b-256 checksum How to use checksums |
593ce59d50aebac35d03ab3971520a60e95688325d37516eba7a30d5f1241439
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.5
|
Release files / localstack_extension_openai-0.1.0-py3-none-any.whl
| Download URL | localstack_extension_openai-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3539a9e4b874b8e0875ff7a01605456d794f5ae70f3b370c9e495730df0c9b3d
|
|
BLAKE2b-256 checksum How to use checksums |
9c30bb22497f74201c1e6da569fb96099a709d19a75cd8805e6764847e2ddbce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.5
|
Security for localstack-extension-openai 0.1.0
Provenance
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.