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.14.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.14-py3-none-any.whl (308.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: timestep-2026.0.14.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.14.tar.gz
Algorithm Hash digest
SHA256 cf3ccc27456c74999229f3fae3342b6b6feae43a4cbcdd9fbe1b8caa37cf08e8
MD5 2242b4ed40ea707d85ca6ddf20354672
BLAKE2b-256 388d326c2f3bd0c33fa4572f2b9717006be9fcc42dafc822400216698a3c8d62

See more details on using hashes here.

File details

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

File metadata

  • Download URL: timestep-2026.0.14-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.14-py3-none-any.whl
Algorithm Hash digest
SHA256 aa59807fe1563066b1bb19dd1271a777a644d62e46a32824a3c1a921dbdfb0d4
MD5 f7fbf764cb8d346b134de9f5b7e73c7b
BLAKE2b-256 8297e3cc3ad2481f12f0a0a8e595e7c52ab62b9aefa40197ea29cbec23926243

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