Skip to main content

Multi-model provider implementations for OpenAI Agents, supporting both OpenAI and Ollama models

Project description

Timestep (Python)

Python bindings for the Timestep Agents SDK. See the root README.md for the full story; this file highlights Python-specific setup.

Install

pip install timestep

Prerequisites (Python)

  • OPENAI_API_KEY
  • Database storage:
    1. PostgreSQL (recommended): Set PG_CONNECTION_URI=postgresql://user:pass@host/db
    2. PGLite (default): Install Node.js and @electric-sql/pglite (npm install -g @electric-sql/pglite). Uses a high-performance sidecar process for optimal performance.

Quick start

from timestep import run_agent, RunStateStore, consume_result
from agents import Agent, Session

agent = Agent(model="gpt-4.1")
session = Session()
state_store = RunStateStore(agent=agent, session_id=await session._get_session_id())

result = await run_agent(agent, input_items, session, stream=False)
result = await consume_result(result)

if result.interruptions:
    await state_store.save(result.to_state())

Cross-language resume

Save in Python, load in TypeScript with the same session_id and RunStateStore.load().

Model routing

Use MultiModelProvider if you need OpenAI + Ollama routing:

from timestep import MultiModelProvider, MultiModelProviderMap, OllamaModelProvider

provider_map = MultiModelProviderMap()
provider_map.add_provider("ollama", OllamaModelProvider())
model_provider = MultiModelProvider(provider_map=provider_map)

Documentation

Full docs: https://timestep-ai.github.io/timestep/

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

timestep-2026.0.12.tar.gz (342.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

timestep-2026.0.12-py3-none-any.whl (308.5 kB view details)

Uploaded Python 3

File details

Details for the file timestep-2026.0.12.tar.gz.

File metadata

  • Download URL: timestep-2026.0.12.tar.gz
  • Upload date:
  • Size: 342.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for timestep-2026.0.12.tar.gz
Algorithm Hash digest
SHA256 55d66267b18ab290d0039f7026c9141c43c19604820405871c2ef2c9976870da
MD5 ba55e4debd5c33a3269ddd8623c8e85b
BLAKE2b-256 e692da777d3b754d8470114a0e3a4707347fdf1afc54b8e04a4e0cb662453342

See more details on using hashes here.

File details

Details for the file timestep-2026.0.12-py3-none-any.whl.

File metadata

  • Download URL: timestep-2026.0.12-py3-none-any.whl
  • Upload date:
  • Size: 308.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for timestep-2026.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 7e4f73f62665e6c2133e05b9c102c8e377eeedd2fa605269dadcdb8a42386f1d
MD5 ff24eae4d9cdf36d06d7df0306ad6065
BLAKE2b-256 987b65b297a17efb6d37c805acbcda5345ec4c6c2ed68e8c4ba248021a9e5d80

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page