Skip to main content

Bottom AI CHANGELOG LICENSE

org.slashlib.py.inference.ollama

The official Ollama inference adapter for the org.slashlib.py.agent framework.

PyPI version PyPI-Test version License: MIT


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.agent must 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)

Source distribution for org.slashlib.py.inference.ollama 0.1.4
File Size Uploaded
org_slashlib_py_inference_ollama-0.1.4.tar.gz 9.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for org.slashlib.py.inference.ollama 0.1.4
File Interpreter ABI Platform
org_slashlib_py_inference_ollama-0.1.4-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page