Skip to main content

Python bindings for the smolcode agent engine (Rust core)

Project description

smolcode-core

Python bindings for smolcode — an SLM-optimized, opencode-class terminal coding agent built in Rust on the LiteForge SDK.

The smolcode_core extension module embeds the Rust agent engine (the agent loop, tool execution, and multi-format tool-call extraction) so Python apps can drive a full coding-agent session against any OpenAI-compatible endpoint.

Install

pip install smolcode-core

Quickstart

import smolcode_core

# Load config (model, base_url, agent profile) and open a session.
session = smolcode_core.Session(
    workspace=".",
    agent="build",
    model="qwen2.5-coder:7b",
    base_url="http://localhost:11434/v1",
)

session.start_turn("Add a docstring to main.py", think=None, yolo=False)
while True:
    event = session.poll_event()
    if event is None:
        break
    print(event)

Session exposes the same engine the smolcode TUI uses: turn streaming via poll_event, tool-approval gating (approve), custom Python tools (register_tool), session persistence (save / load_session / fork), and MCP discovery (list_mcp). Config mirrors the on-disk smolcode configuration.

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

smolcode_core-0.1.0.tar.gz (193.2 kB view details)

Uploaded Source

Built Distributions

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

smolcode_core-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl (13.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

smolcode_core-0.1.0-cp312-cp312-macosx_11_0_arm64.whl (11.3 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

smolcode_core-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl (13.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

smolcode_core-0.1.0-cp311-cp311-macosx_11_0_arm64.whl (11.3 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

smolcode_core-0.1.0-cp310-cp310-manylinux_2_28_x86_64.whl (13.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

smolcode_core-0.1.0-cp310-cp310-macosx_11_0_arm64.whl (11.3 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file smolcode_core-0.1.0.tar.gz.

File metadata

  • Download URL: smolcode_core-0.1.0.tar.gz
  • Upload date:
  • Size: 193.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for smolcode_core-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0b118aa66fe66df42be58b64688a17836d4b5883b662e12454e74289415713d8
MD5 57fc55f3f810dbdd5dffb3a2266343ce
BLAKE2b-256 b06d6d8f3efe8562a3ac4bb36c3a4e6cbf0ae1aec870fb0a8aca41313be9a630

See more details on using hashes here.

Provenance

The following attestation bundles were made for smolcode_core-0.1.0.tar.gz:

Publisher: release.yml on seanpoyner/smolcode

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

File details

Details for the file smolcode_core-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for smolcode_core-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 76d7e634c831fa7bc2d50c5234b5a11d8e01b4fab6a86fbddac56101ab0f16e6
MD5 2c42013d7de767713193c8a023cc81c8
BLAKE2b-256 f17509b0a1b45edbbab3b479d5965343fd8053b13d0f40ad95d62191cbc29433

See more details on using hashes here.

Provenance

The following attestation bundles were made for smolcode_core-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: release.yml on seanpoyner/smolcode

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

File details

Details for the file smolcode_core-0.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for smolcode_core-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 58d6d88ddc01b20df4c0a1db88caa515f9d5605b2853e0390ab526f5c30dfd8f
MD5 10b83e16493132ffd3150c9e37a53613
BLAKE2b-256 079f13dc7c9ec78f9219cdf968a2dcc211ff7900d6e428e31d5654e53281e5e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for smolcode_core-0.1.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on seanpoyner/smolcode

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

File details

Details for the file smolcode_core-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for smolcode_core-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c4fbdb9b9b9ffb1aa89dbe74a7ce19201a12531ad7f267a13712d0063a6c9f32
MD5 3b55be7e7e912d8d020e6b0552e3335b
BLAKE2b-256 db5cc5b7ca353a003a4224ffcf5b6790f9afc828f74911c23fa6977053991f43

See more details on using hashes here.

Provenance

The following attestation bundles were made for smolcode_core-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: release.yml on seanpoyner/smolcode

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

File details

Details for the file smolcode_core-0.1.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for smolcode_core-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 078436b2672ef8e5069f52c84e06f9109d202b4ed78ef611fc240585f6920d21
MD5 e89594b1ffa643e1b499f086197e7fe9
BLAKE2b-256 dc28843bb0d83c9eb7fa018edb44c794fd821ad6c6302f1af76e9887fc297828

See more details on using hashes here.

Provenance

The following attestation bundles were made for smolcode_core-0.1.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on seanpoyner/smolcode

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

File details

Details for the file smolcode_core-0.1.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for smolcode_core-0.1.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 baf0d1a46498e022329592d578a096799b2facc482b6a6b1a5cdea9b05dbbe39
MD5 706ca26ba5bda9618fd72169d128a2b4
BLAKE2b-256 5b85d265bd68372a69262e61b2975df2417757e30dd713f191a6be198478b751

See more details on using hashes here.

Provenance

The following attestation bundles were made for smolcode_core-0.1.0-cp310-cp310-manylinux_2_28_x86_64.whl:

Publisher: release.yml on seanpoyner/smolcode

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

File details

Details for the file smolcode_core-0.1.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for smolcode_core-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6edb3489f370df835d5985154b41e03adb26a6ebd741263fed49a074c8cf41f1
MD5 7702bcbe6a7d67c8d4d2ad2cbd46b334
BLAKE2b-256 5f2ae058830d0d6c370799ffb60098bcddc0b60b23ffd12d9090db00402271a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for smolcode_core-0.1.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: release.yml on seanpoyner/smolcode

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