Skip to main content

Official Interfaze SDK.

Project description

interfaze-python

The official Interfaze SDK for Python.

  • Familiar chat surface - chat.completions, streaming, tools, and structured output.
  • Typed Interfaze extras - precontext (internal tool output), reasoning, and vcache (semantic-cache hit) on every response.
  • One-line task helpers - OCR, web search, scraping, speech-to-text, translation, object/GUI detection, forecasting.
  • Multimodal inputs - images, PDFs, audio, video, and CSV, by URL or base64.
  • Sync and async, fully typed.

Learn more

Capabilities

Category Capabilities
Chat & text Chat completions, structured output, tools, reasoning
Vision & OCR tasks.ocr - text and structured data from images and PDFs
Web tasks.web_search, tasks.scrape
Audio tasks.transcribe - speech-to-text
Detection tasks.object_detection, tasks.gui_detection
Translation tasks.translate
Forecasting tasks.forecast - time-series prediction

Install

pip install interfaze

Setup

Get an API key from the Interfaze dashboard, then:

from interfaze import Interfaze

interfaze = Interfaze(api_key="sk_...")  # or set INTERFAZE_API_KEY and call Interfaze()

Async is identical via AsyncInterfaze (every call becomes await-able).

Usage

Chat completion:

res = interfaze.chat.completions.create(
    messages=[{"role": "user", "content": "Write a haiku about deterministic AI."}],
)
print(res.choices[0].message.content)
print("cache hit:", res.vcache)          # typed Interfaze extra

Task helpers - each returns the extracted result directly (a dict/list/str, not a completion):

interfaze.tasks.ocr("https://example.com/receipt.jpg")
interfaze.tasks.web_search("latest AI agent news")
interfaze.tasks.transcribe("https://example.com/audio.wav")
interfaze.tasks.scrape("https://example.com/product")
interfaze.tasks.translate("Hello", to="French")
interfaze.tasks.object_detection("https://example.com/photo.jpg")
interfaze.tasks.gui_detection("https://example.com/screenshot.png")
interfaze.tasks.forecast("https://example.com/series.csv", periods=30)

Structured output:

from interfaze import response_format

res = interfaze.chat.completions.create(
    messages=[{"role": "user", "content": "Weather in Tokyo?"}],
    response_format=response_format({
        "type": "object",
        "properties": {"city": {"type": "string"}, "temp_c": {"type": "number"}},
        "required": ["city", "temp_c"],
    }),
)

Streaming - .stream() yields typed events, with the inline <think>/<precontext> side-channels stripped from the content events:

stream = interfaze.chat.completions.stream(
    messages=[{"role": "user", "content": "Tell me a story."}],
)
for event in stream:
    if event.type == "content.delta":
        print(event.delta, end="")
final = stream.get_final_completion()

stream.text_deltas() yields clean visible text only; create(stream=True) returns the raw chunk iterator (side-channel tags not stripped).

Inputs

from interfaze import inputs

inputs.image("https://…/a.png")             # image_url part
inputs.file("https://…/doc.pdf")            # file part (pdf/csv/xml/json/text/video…)
inputs.audio("https://…/a.wav")             # input_audio part
inputs.data_url(raw_bytes, "image/png")     # base64 data URI
inputs.from_path("./doc.pdf")               # read a local file

URLs and base64 both work; image/gif and image/avif are rejected client-side.

Interfaze extras

  • res.precontext - raw outputs of any internal tools that ran (OCR/web/scrape/STT/forecast/…).
  • res.reasoning - reasoning text (with reasoning_effort="high" and no schema).
  • res.vcache - whether the semantic cache was hit.
  • reasoning_effort also accepts "on"/"off"/"auto".
  • Guardrails: create(guard=["S1", "S12_IMAGE"], …).
  • Control options: Interfaze(show_additional_info=..., bypass_moe=..., bypass_cache=..., admin_key=...).

LangChain

pip install interfaze[langchain] adds a chat model pointed at Interfaze that keeps the extras a stock ChatOpenAI drops:

from interfaze.langchain import ChatInterfaze

llm = ChatInterfaze()  # reads INTERFAZE_API_KEY
res = llm.invoke("Summarize the latest AI news")
print(res.response_metadata.get("precontext"), res.response_metadata.get("vcache"))

precontext/reasoning/vcache land on response_metadata, {"type": "video", ...} content blocks are accepted, and inline side-channel tags are stripped.

License

MIT

Project details


Download files

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

Source Distribution

interfaze-1.0.1.tar.gz (199.6 kB view details)

Uploaded Source

Built Distribution

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

interfaze-1.0.1-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file interfaze-1.0.1.tar.gz.

File metadata

  • Download URL: interfaze-1.0.1.tar.gz
  • Upload date:
  • Size: 199.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for interfaze-1.0.1.tar.gz
Algorithm Hash digest
SHA256 64cf8298e38d448e7af6203da0e2917a876491910d53c4044278e427898f152f
MD5 59f57a2d2befa4e420c01642c25e2531
BLAKE2b-256 4518abe8197ff55f639da97651fab4674c1432764d8672f58461384770ec58e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for interfaze-1.0.1.tar.gz:

Publisher: publish.yml on InterfazeAI/interfaze-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file interfaze-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: interfaze-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for interfaze-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 685c6c793b5bf41b39c2f99d677a98b7b7255032bd34474dba2e91b65d209861
MD5 fd6f9fc3e29541854606552ddeb3bb58
BLAKE2b-256 81202a5edfdbb58139c57c76f4b085b4f19e1019a836d2c5211a0ccd42798883

See more details on using hashes here.

Provenance

The following attestation bundles were made for interfaze-1.0.1-py3-none-any.whl:

Publisher: publish.yml on InterfazeAI/interfaze-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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