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
  • Default storage uses PGLite via Node: install Node.js and @electric-sql/pglite (npm install -g @electric-sql/pglite or local install).
  • For better performance use Postgres: set TIMESTEP_DB_URL=postgresql://user:pass@host/db. If you must stay on PGLite, keep a long-lived Node/Deno sidecar that holds a PGlite connection instead of spawning Node per query.

Quick start

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

agent = Agent(model="gpt-4o")
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.9.tar.gz (340.0 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.9-py3-none-any.whl (305.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: timestep-2026.0.9.tar.gz
  • Upload date:
  • Size: 340.0 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.9.tar.gz
Algorithm Hash digest
SHA256 de7fde89787533206ddb418a7a53895b7133abb4bb27ca402d174798fe7eaba0
MD5 9e23e15393b4530d63df47adbef021a2
BLAKE2b-256 b87177b74460bfc3dfddc5bf85ffa39feec431207b21573ff87a9fd386bb39f2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: timestep-2026.0.9-py3-none-any.whl
  • Upload date:
  • Size: 305.3 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.9-py3-none-any.whl
Algorithm Hash digest
SHA256 018bf085be6e08224a30335f21b16995bf1fd50319d5196aca97e1688c058593
MD5 cdc6271a538c36cd9e1a76572d521856
BLAKE2b-256 880e540fdaa4b79b02c0634c73204b66df0702c58fc08c559e77b2a218e7015d

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