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 (connection priority):
    1. PostgreSQL (recommended): Set TIMESTEP_DB_URL=postgresql://user:pass@host/db or use local Postgres (auto-detected on localhost:5432)
    2. PGLite: 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/run_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.10.tar.gz (344.6 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.10-py3-none-any.whl (311.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: timestep-2026.0.10.tar.gz
  • Upload date:
  • Size: 344.6 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.10.tar.gz
Algorithm Hash digest
SHA256 bc3539f478fd1c8e9140fc860093620f53f0b5301c36288d0e83fa9474cf4f76
MD5 a8094ce6eac6e6b0de7a406567a97a7b
BLAKE2b-256 44e8f0cc4d4f165a4d35194cf3f6a2373a69b5206962758dca509c5a3049ad7e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: timestep-2026.0.10-py3-none-any.whl
  • Upload date:
  • Size: 311.2 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.10-py3-none-any.whl
Algorithm Hash digest
SHA256 2e72845a6656a93c062bc874607c6da2a1686f0a3c1728e9a68347dde00def5b
MD5 d7c1f7a092fe71e3b3b53e7659868dbd
BLAKE2b-256 776a5c5fa6806e4042468518922630f3223721c7ecea2a3db5734b122cceb6c9

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