org.slashlib.py.inference.ollama
The official Ollama inference adapter for the org.slashlib.py.agent framework.
1. Overview & Architecture
This project provides a specialized implementation of the InferenceAdapter interface from the core Agent Framework. By decoupling the Ollama logic from the main framework, we ensure a lightweight core and allow for independent updates to the inference logic.
Architectural Role
- Adapter Pattern: Bridges the standardized framework calls to the Ollama-specific API.
- Provider Agnostic: The framework consumes this adapter through a unified interface.
- Plugin-Based: Leverages Python entry points for seamless, zero-config integration.
2. Prerequisites
- Ollama Service: Must be installed and reachable (Default:
http://localhost:11434). - Python: Version 3.10 or higher.
- Base Framework:
org.slashlib.py.agentmust be installed in the same environment.
3. Installation
Production / Standard
pip install org.slashlib.py.inference.ollama
Development (Editable Mode)
If you are developing both the framework and this adapter, install both in editable mode to ensure the Entry Points are correctly registered in your current Python environment:
# 1. Install the framework
cd path/to/org.slashlib.py.agent
pip install -e .
# 2. Install this adapter
cd path/to/org.slashlib.py.inference.ollama
pip install -e .
4. Integration Logic (Entry Points)
This adapter is designed to be "invisible" to the end user. It registers itself via the pyproject.toml entry points:
[project.entry-points."org.slashlib.py.agent.inference"]
ollama = "org.slashlib.py.inference.ollama.adapter:OllamaInferenceAdapter"
The framework automatically scans this group and maps the name ollama to the OllamaInferenceAdapter class.
5. Configuration
The adapter's behavior is controlled via the framework's configuration loader (usually pyproject.json).
| Key | Type | Default | Description |
|---|---|---|---|
model |
string | (required) | The name of the Ollama model (e.g., "llama3", "gemma"). |
think |
boolean | true |
Enables/Disables thinking process visibility if supported. |
timeout |
float | 600.0 |
Connection timeout in seconds. |
Example pyproject.json:
{
"inference": {
"ollama": {
"model": "gemma4",
"think": true,
"timeout": 300.0
}
}
}
6. Usage Example
You do not need to import any classes from this package directly. Use the Framework's factory method:
import asyncio
from org.slashlib.py.agent.agent import Agent
async def main():
# Load the agent - the framework resolves 'ollama' via Entry Points
my_agent = Agent.from_plugin(
identifier="my-local-assistant",
plugin_name="ollama"
)
# All standard Agent methods are now available
response = await my_agent.chat("How does the plugin system work?")
print(f"Assistant: {response.content}")
if __name__ == "__main__":
asyncio.run(main())
7. Development & Testing
Testing with Pytest
pytest tests/
Logging
The adapter logs under the namespace org.slashlib.py.inference.ollama.
8. Documentation & Obsidian
The project root is fully prepared as an Obsidian Vault.
License
Distributed under the MIT License. See LICENSE.md for more information.
© 2026 org.slashlib
Metadata
Release files for org.slashlib.py.inference.ollama 0.1.4
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 |
|---|---|---|---|---|
| org_slashlib_py_inference_ollama-0.1.4.tar.gz | 9.5 kB | Without provenance | Details for org_slashlib_py_inference_ollama-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| org_slashlib_py_inference_ollama-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for org_slashlib_py_inference_ollama-0.1.4-py3-none-any.whl |
Total release size: 19.0 kB
Release files / org_slashlib_py_inference_ollama-0.1.4.tar.gz
| Download URL | org_slashlib_py_inference_ollama-0.1.4.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8afef410695e64d41d6f1f862743482dc7872e47ca14cec22d829367f13b7a15
|
|
BLAKE2b-256 checksum How to use checksums |
e6eb8ed589cc268d5397f9a079f70d73a2e190b6f8def83e0612a945dec0c8fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.6
|
Release files / org_slashlib_py_inference_ollama-0.1.4-py3-none-any.whl
| Download URL | org_slashlib_py_inference_ollama-0.1.4-py3-none-any.whl |
|---|---|
| Size | 9.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f29fe65c9cbc2d8d0d05b3ebbcc3091e6e41c6cf73f3de10e0a011c15bae2689
|
|
BLAKE2b-256 checksum How to use checksums |
c55034fd38f952a3ae82ad346aae4daba15ad0f87b17fb0014ffb1ca2dbedb9a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.6
|
Security for org.slashlib.py.inference.ollama 0.1.4
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.