Skip to main content

pulse-ollama

Ollama adapter for PULSE Protocol — run local AI models with the same interface as cloud providers.

Your data never leaves your machine. GDPR-compliant by design.

# Switch from cloud to local — one line changes:
# from pulse_openai import OpenAIAdapter as AI; adapter = AI(api_key="sk-...")
from pulse_ollama import OllamaAdapter as AI; adapter = AI(model="llama3.2")

# Everything below stays EXACTLY the same
msg = PulseMessage(action="ACT.ANALYZE.SENTIMENT", parameters={"text": "I love open source!"})
response = adapter.send(msg)
print(response.content["parameters"]["result"])

Why pulse-ollama?

Feature Cloud (OpenAI/Anthropic) Local (Ollama)
Data leaves your machine Yes No
GDPR compliance Depends on DPA By design
Works offline No Yes
API key required Yes No
Cost per token Yes Free

Installation

pip install pulse-ollama

Requirements: Ollama must be installed and running.

# Install Ollama (macOS/Linux)
curl -fsSL https://ollama.ai/install.sh | sh

# Pull a model
ollama pull llama3.2       # 2GB, fast
ollama pull mistral        # 4GB, high quality
ollama pull phi3           # 2GB, efficient
ollama pull gemma2         # 5GB, Google's model

Quick Start

from pulse import PulseMessage
from pulse_ollama import OllamaAdapter

adapter = OllamaAdapter(model="llama3.2")

# See what models you have installed
print(adapter.list_models())
# ['llama3.2:latest', 'mistral:latest', 'phi3:latest']

# Ask a question
msg = PulseMessage(
    action="ACT.QUERY.DATA",
    parameters={"query": "Explain PULSE Protocol in one sentence"}
)
response = adapter.send(msg)
print(response.content["parameters"]["result"])

# Sentiment analysis
msg = PulseMessage(
    action="ACT.ANALYZE.SENTIMENT",
    parameters={"text": "I love this open source project!"}
)
response = adapter.send(msg)
print(response.content["parameters"]["result"])
# {"sentiment": "positive", "confidence": 0.95, "explanation": "..."}

# Translate
msg = PulseMessage(
    action="ACT.TRANSFORM.TRANSLATE",
    parameters={"text": "Hello, world!", "target_language": "German"}
)
response = adapter.send(msg)
print(response.content["parameters"]["result"])
# Hallo, Welt!

Supported Actions

PULSE Action Description
ACT.QUERY.DATA Ask questions, get answers
ACT.CREATE.TEXT Generate text from instructions
ACT.ANALYZE.SENTIMENT Analyze emotional tone
ACT.ANALYZE.PATTERN Find patterns in data
ACT.TRANSFORM.TRANSLATE Translate between languages
ACT.TRANSFORM.SUMMARIZE Summarize long text

Configuration

adapter = OllamaAdapter(
    model="llama3.2",                        # Default model
    host="http://localhost:11434",           # Ollama server URL
    timeout=120,                             # Inference timeout (seconds)
)

# Override model per-request
msg = PulseMessage(
    action="ACT.CREATE.TEXT",
    parameters={
        "instructions": "Write a poem about AI",
        "model": "mistral",           # Override default
        "temperature": 0.9,           # Creativity
    }
)

# Remote Ollama server (shared team deployment)
adapter = OllamaAdapter(host="http://ai-server.company.com:11434")

Provider Switching

The whole point of PULSE adapters is that switching providers is one line:

# Local model (privacy, offline, free)
from pulse_ollama import OllamaAdapter as AI
adapter = AI(model="llama3.2")

# Cloud (scale, latest models)
# from pulse_openai import OpenAIAdapter as AI
# adapter = AI(api_key="sk-...")

# Everything else stays identical
response = adapter.send(msg)

Part of the PULSE Ecosystem

pulse-protocol    # Core (install this first)
pulse-openai      # OpenAI GPT
pulse-anthropic   # Anthropic Claude
pulse-ollama      # Local models (this package)
pulse-gemini      # Google Gemini
pulse-binance     # Binance exchange
pulse-bybit       # Bybit exchange
pulse-kraken      # Kraken exchange

License

Apache 2.0 — free forever.

GitHub: github.com/pulseprotocolorg-cyber/pulse-python

Metadata

Release files for pulse-ollama 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pulse-ollama 0.1.0
File Size Uploaded Provenance Actions
pulse_ollama-0.1.0.tar.gz 11.0 kB Without provenance Details for pulse_ollama-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pulse-ollama 0.1.0
File Interpreter ABI Platform Actions
pulse_ollama-0.1.0-py3-none-any.whl Python 3 none any Details for pulse_ollama-0.1.0-py3-none-any.whl

Total release size: 18.8 kB

Release files / pulse_ollama-0.1.0.tar.gz

Download URL pulse_ollama-0.1.0.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ad89fab1be32d7709a448d2502f000353029b518b16bdc82a61373bf12512dff
BLAKE2b-256 checksum
How to use checksums
f2943333347d701dc8f45410e95d558a9589d40f62a0689761217469249edcce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / pulse_ollama-0.1.0-py3-none-any.whl

Download URL pulse_ollama-0.1.0-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
873c98d17eed2e0f58ddbfcfe0fe0f0e1ece52e89f33097b1bb1e6bb9acf6b2b
BLAKE2b-256 checksum
How to use checksums
f3656edc10bb59c6c680db8ee3d1f7d48a40cefe97a90b5831e852d72912af2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Security for pulse-ollama 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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