![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
List of currently supported models
The Adapters package facilitates communication between different language model APIs by providing a unified interface for interaction. This ensures ease of use and flexibility in integrating multiple models from various providers.
The package can be installed an used via pip:
pip install martian-adapters
poetry install
poetry run pre-commit install
To run pre-commit manually:
poetry run pre-commit run --all-files
For versioning we follow Semantic Versioning
The package requires certain environment variables to be set by the users:
.env-example
to .env
and populate it with appropriate values.poetry run pytest
from adapters import AdapterFactory
# First component in model path is Provider, then Vendor, and last model name itself
adapter = AdapterFactory.get_adapter_by_path("openai/openai/gpt-4o-mini")
adapter.execute_sync(
[
{role: "system", content: "You are a helpful assistant."},
{
role: "user",
content: "Write a haiku about recursion in programming.",
},
]
)
Adapter paths follows the format provider/vendor/model_name
. Use AdapterFactory.get_supported_models()
to retrieve all supported models. For a given model, model.get_path()
returns the adapter path.
Existing Providers:
Add new models to the MODELS
array if the provider is already supported.
New Providers:
Add the Provider and Model: Update provider_adapters/__init__.py
and test files accordingly.
Write Tests: Add tests in the relevant directories. Use @pytest.mark.vcr
for tests making network requests.
Run Tests:
poetry run pytest
Check-in Cassette Files: Include any new cassette YAML files in your commit.
Send a Pull Request: Ensure all tests pass before requesting a review.
Use the poetry run pytest --record-mode=rewrite
option with pytest to update cassette files.
Some models may only be accessible from specific locations (e.g., the U.S.). In such cases, running tests might require access to a U.S.-based server.
This documentation provides a streamlined approach to using and contributing to the Adapters package, emphasizing practical steps and clear examples.
To optimize throughput and performance, we provide options to configure HTTP networking parameters:
ADAPTERS_MAX_KEEPALIVE_CONNECTIONS_PER_PROCESS = 100
ADAPTERS_MAX_CONNECTIONS_PER_PROCESS = 1000
ADAPTERS_HTTP_CONNECT_TIMEOUT = 5
ADAPTERS_HTTP_TIMEOUT = 600
For stress testing or other purposes, you can override all base URLs by setting the following in your .env file:
_ADAPTERS_OVERRIDE_ALL_BASE_URLS_ = "https://new-base-url.com/api"
This setting ensures that all LLM API calls will route to the specified new base URL.
FAQs
Adapters as API gateways to Different LLM Models
We found that martian-adapters demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.